/* ==========================================================================
   1. SETUP & GLOBAL STYLES
   ========================================================================== */

:root {
  --primary-color: #1a237e; /* A professional dark blue */
  --secondary-color: #fdd835; /* A construction-like yellow */
  --text-color: #333;
  --bg-color: #f4f4f4;
  --container-width: 1100px;
}

html {
  height: 100%;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  line-height: 1.6;
  background-color: var(--bg-color);
  color: var(--text-color);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

body.nav-open {
  overflow: hidden; /* For mobile menu scroll lock */
}

/* ==========================================================================
   2. LAYOUT & CORE STRUCTURE
   ========================================================================== */

.site-header {
  background-color: #ffffff;
  padding: 15px 0;
  position: fixed; /* For sticky header */
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.main-content {
  flex-grow: 1; /* For sticky footer */
  padding-top: 100px; /* Fallback for JS, adjusted dynamically */
  transition: padding-top 0.3s ease;
}

.site-footer {
  background-color: #fff;
  text-align: center;
  border-top: 1px solid #ddd;
  margin-top: 40px;
  padding: 20px 0;
  font-size: 0.9em;
  color: #777;
}

/* ==========================================================================
   3. DESKTOP HEADER & NAVIGATION
   ========================================================================== */

.header-container {
  display: flex;
  align-items: center;
  gap: 40px;
}

.logo img {
  height: 40px;
}

.main-nav {
  margin-right: auto; /* Pushes language switcher to the far right */
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 25px;
}

.main-nav ul li a {
  font-weight: bold;
  color: var(--text-color);
  text-transform: uppercase;
  font-size: 0.9em;
  padding: 5px 0;
  position: relative;
  transition: color 0.3s ease;
}

.main-nav ul li a:hover {
  color: var(--primary-color);
}

.main-nav ul li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s ease-out;
}

.main-nav ul li a:hover::after,
.main-nav ul li.active a::after {
  transform: scaleX(1);
  transform-origin: left;
}

.main-nav ul li.active a {
  color: var(--primary-color);
}

.language-switcher ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 15px;
}

.language-switcher a:hover,
.language-switcher li.active a {
  color: var(--primary-color);
}

.language-switcher a {
  font-weight: bold;
  color: #aaa;
  transition: color 0.3s;
}

.menu-toggle,
.lang-toggle {
  display: none; /* Mobile-only elements hidden on desktop */
}

/* ==========================================================================
   4. GENERIC COMPONENTS (BUTTONS, CARDS, FORMS)
   ========================================================================== */

.btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  font-weight: bold;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: #151c68;
}

.content-box {
  background-color: #fff;
  padding: 30px;
  margin-bottom: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.message {
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-weight: bold;
}
.message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ==========================================================================
   5. PAGE-SPECIFIC STYLES
   ========================================================================== */

/* --- Homepage --- */
.company-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  margin-top: 40px;
}
.company-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  padding: 30px;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}
.company-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}
.company-card img {
  max-height: 80px;
  margin: 0 auto 20px auto;
}
.company-card h2 {
  margin: 0;
  color: var(--text-color);
}

/* --- Company Details Page --- */
.company-profile,
.gallery {
  background: #fff;
  padding: 30px;
  margin-top: 40px;
  border-radius: 8px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 20px;
}
/* --- Company Details Page --- */
.gallery-item-link {
  cursor: zoom-in;
  display: block;
  overflow: hidden; /* Helps contain image hover effects */
  border-radius: 4px;
}

.gallery-item img {
  border-radius: 4px;
  width: 100%;
  transition: transform 0.4s ease; /* Add a subtle zoom effect on hover */
}

.gallery-item-link:hover img {
  transform: scale(1.05); /* Zoom in slightly on hover */
}

/* --- Contact Page --- */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 30px;
}
.map-container iframe {
  border-radius: 8px;
  border: none;
}

/* --- About Us Page --- */
.about-page {
  margin-top: 40px;
}
.about-hero {
  text-align: center;
  margin-bottom: 40px;
}
.about-hero h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  color: var(--primary-color);
}
.about-hero .subtitle {
  font-size: 1.2em;
  font-style: italic;
  color: #666;
}
.about-hero .hero-image {
  width: 100%;
  border-radius: 8px;
  margin-top: 20px;
  object-fit: cover;
  max-height: 400px;
}
.about-intro {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 40px;
  align-items: center;
  padding: 40px;
}
.about-intro img {
  border-radius: 8px;
  width: 100%;
}
.about-intro p {
  font-size: 1.1em;
  line-height: 1.7;
}
.features-list {
  list-style: none;
  padding-left: 0;
  font-size: 1.1em;
}
.features-list li {
  padding-left: 30px;
  position: relative;
  margin-bottom: 15px;
}
.features-list li::before {
  content: "✔";
  color: var(--primary-color);
  position: absolute;
  left: 0;
  top: 0;
}
.mission-vision-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
.info-card {
  overflow: hidden;
  margin-bottom: 0;
  padding: 0;
}
.info-card .card-image {
  width: 100%;
}
.info-card h3,
.info-card p {
  padding: 0 30px;
}
.info-card h3 {
  padding-top: 20px;
  border-bottom: 2px solid var(--secondary-color);
  margin: 0 30px 15px 30px;
  padding-bottom: 10px;
}
.info-card p {
  padding-bottom: 30px;
  margin-top: 0;
}
.why-us-section .tagline {
  margin-top: 20px;
  font-size: 1.1em;
  color: var(--primary-color);
}
.business-info-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 20px;
}
.business-info-list dt {
  font-weight: bold;
  color: #555;
}
.business-info-list dd {
  margin-left: 0;
}

/* --- 404 Page --- */
.error-page-section {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px 0;
}
.error-content h1 {
  font-size: 3em;
  color: var(--primary-color);
  margin-bottom: 20px;
}
.error-content p {
  font-size: 1.2em;
  margin-bottom: 30px;
  max-width: 500px;
}

/* ==========================================================================
   6. HOMEPAGE DESKTOP-ONLY ENHANCEMENTS
   ========================================================================== */

@media (min-width: 801px) {
  .home-page .main-content {
    display: flex;
    flex-direction: column;
  }
  .home-page .main-content > .container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    max-width: none;
    padding-left: 40px;
    padding-right: 40px;
    margin: 0;
  }
  .home-page .company-grid {
    flex-grow: 1;
    grid-template-rows: repeat(2, 1fr);
  }
  .home-page .company-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
}

/* ==========================================================================
   7. RESPONSIVE STYLES (Mobile First approach would invert this)
   ========================================================================== */

@media (max-width: 900px) {
  /* Stack grid columns on medium-sized tablets */
  .contact-content,
  .about-intro {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  /* --- Mobile Header --- */
  .header-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    width: 100%;
    gap: 15px;
  }
  .logo {
    grid-column: 2 / 3;
    justify-self: center;
  }
  .main-nav {
    display: none;
  }
  .language-switcher {
    grid-column: 3 / 4;
    justify-self: end;
  }

  /* --- Hamburger Menu & Overlay --- */
  .menu-toggle {
    display: block;
    grid-column: 1 / 2;
    z-index: 1001;
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
  }
  .hamburger {
    display: block;
    position: relative;
    width: 24px;
    height: 2px;
    background: var(--text-color);
    transition: all 0.3s ease-in-out;
  }
  .hamburger::before,
  .hamburger::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text-color);
    transition: all 0.3s ease-in-out;
  }
  .hamburger::before {
    top: -8px;
  }
  .hamburger::after {
    bottom: -8px;
  }
  .nav-open .hamburger {
    background: transparent;
  }
  .nav-open .hamburger::before {
    transform: translateY(8px) rotate(45deg);
    background: #fff;
  }
  .nav-open .hamburger::after {
    transform: translateY(-8px) rotate(-45deg);
    background: #fff;
  }
  body.nav-open .main-nav {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(26, 35, 126, 0.98);
    z-index: 999;
    padding-top: 100px;
    text-align: center;
  }
  body.nav-open .main-nav ul {
    flex-direction: column;
    gap: 20px;
  }
  body.nav-open .main-nav ul li a {
    color: #fff;
    font-size: 1.5em;
  }
  body.nav-open .main-nav ul li a::after {
    display: none;
  } /* Hide hover underline */
  body.nav-open .main-nav ul li.active a {
    background-color: transparent;
    position: relative;
    padding-bottom: 5px;
  } /* Active underline */
  body.nav-open .main-nav ul li.active a::after {
    display: block;
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background-color: #fff;
  }

  /* --- Mobile Language Dropdown --- */
  .language-switcher {
    position: relative;
  }
  .lang-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    font-weight: bold;
    cursor: pointer;
  }
  .lang-toggle svg {
    transition: transform 0.3s ease;
  }
  .language-switcher.is-open .lang-toggle svg {
    transform: rotate(180deg);
  }
  .language-switcher > ul {
    display: none;
  } /* Hide desktop list */
  .language-switcher .lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    list-style: none;
    padding: 5px;
    margin: 0;
    z-index: 100;
    min-width: 80px;
  }
  .language-switcher.is-open .lang-dropdown {
    display: block;
  }
  .language-switcher .lang-dropdown li {
    margin: 0;
  }
  .language-switcher .lang-dropdown li a {
    display: block;
    padding: 8px 12px;
    border-radius: 3px;
    font-weight: bold;
  }
  .language-switcher .lang-dropdown li a:hover {
    background-color: var(--bg-color);
  }
  .language-switcher .lang-dropdown li.active a {
    background-color: var(--primary-color);
    color: #fff;
  }

  /* --- General Column Stacking --- */
  .company-grid,
  .mission-vision-grid,
  .business-info-list {
    grid-template-columns: 1fr;
  }
}
