/* Base Styles */
:root {
  --primary-color: #4285f4;
  --secondary-color: #f5f5f5;
  --text-color: #333;
  --border-color: #ccc;
  --footer-bg: #f0f0f0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Styles */
header {
  background-color: var(--secondary-color);
  padding: 2.5rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
  display: flex;
  flex-direction: row; /* Changed from column to row */
  justify-content: space-between; /* Pushes logo left and search right */
  align-items: center;
  max-width: 1920px;
  margin: 0 auto;
  width: 100%;
  gap: 1rem;
}

.logo {
  margin-right: auto; /* Pushes logo to the left */
  transform: scale(1.50); /* Direct 50% scale */
  transform-origin: left center; /* Scales from left side */
}

.logo img {
  height: 75px;
  width: auto;
  max-width: 100%;
}

.logo img {
  /* For JPEGs with white background - this will make white transparent */
  mix-blend-mode: multiply;
  /* Alternative approach */
  filter: brightness(1.1) contrast(1.1);
}

.search-bar {
  display: flex;
  width: auto; /* Changed from 100% to auto */
  max-width: 600px;
  margin-left: auto; /* Pushes search to the right */
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .logo {
    margin-right: 0;
    margin-bottom: 1rem;
    text-align: left;
  }
  
  .search-bar {
    width: 100%;
    margin-left: 0;
  }
}

.search-bar input {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px 0 0 4px;
  flex-grow: 1;
  font-size: 1rem;
}

.search-bar button {
  padding: 0.5rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
}

.search-bar button:hover {
  background-color: #3367d6;
}

/* Navigation Grid */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 4 columns by default */
  gap: 1.0rem;
  list-style: none;
  padding: 0.50rem;
  max-width:1920px;
  margin: 1.0rem auto;
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 1920px) {
  .nav-grid {
    grid-template-columns: repeat(4, 1fr); /* 3 columns on medium screens */
  }
}

@media (max-width: 1440px) {
  .nav-grid {
    grid-template-columns: repeat(3, 1fr); /* 2 columns on small screens */
  }
}

@media (max-width: 1080px) {
  .nav-grid {
    grid-template-columns: 1fr; /* 1 column on mobile */
  }
}

.nav-grid li {
  transition: transform 0.3s;
}

.nav-grid li:hover {
  transform: translateY(-5px);
}

.nav-grid li a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-color);
  background-color: white;
  border-radius: 10px;
  padding: 0.750rem 0.75rem;
  height: 100%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s;
}

.nav-grid li a:hover {
  box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.nav-grid li img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 1.5rem;
}

.tile-content {
  text-align: center;
  width: 100%;
}

.tile-title {
  font-weight: bold;
  display: block;
  margin-bottom: 0.5rem;
}

.tile-divider {
  color: var(--border-color);
  display: block;
  margin: 0.5rem 0;
}

.tile-description {
  font-size: 0.8rem;
  display: block;
  margin-bottom: 0.rem;
}

/* Model Viewer Container Styles */
.model-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 0rem;
  max-width: 1920px;
  margin: 0 auto;
  width: 100%;
}

model-viewer {
  flex: 1 1 calc(50% - 1rem); /* Each takes half minus gap */
  min-width: 300px; /* Minimum width before stacking */
  height: 400px;
  background-color: #f8f8ff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);

}


/* Footer Styles */
footer {
  background-color: var(--footer-bg);
  padding: 1.0rem;
  margin-top: auto;
 border-radius: 8px;
}

.footer-content {
  max-width: 1920px;
  margin: 0 auto;
  text-align: right; /* Right-align all footer content */
}

.footer-content ul {
  list-style: none;
  font-size: 0.6em; /* Reduced by 60% (1em × 0.6 = 0.6em) */
}

.footer-content li {
  margin-bottom: 0.5rem;
}

.footer-content a {
  color: var(--primary-color);
  text-decoration: none;
}

.footer-content a:hover {
  text-decoration: underline;
}


    .nav-grid {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  }
}
