/* e-Tanuan Main Style Rules */

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

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background-color: var(--bg-light);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings Typography */
h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-headings);
  font-weight: 600;
  color: var(--primary-color);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* General Layout Utilities */
.bg-forest-green {
  background-color: var(--primary-color) !important;
}

.text-forest-green {
  color: var(--primary-color) !important;
}

.text-gold {
  color: var(--accent-color) !important;
}

/* Ensure images never overflow their containers */
img {
  max-width: 100%;
  height: auto;
}

/* Public Navbar Styling */
.navbar-custom {
  background-color: var(--primary-color);
  padding: 0.75rem 1.5rem;
  box-shadow: var(--shadow-md);
  border-bottom: 2px solid var(--accent-color);
}

.navbar-custom .navbar-brand {
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--white) !important;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.navbar-custom .navbar-brand img {
  height: 42px;
  width: auto;
  margin-right: 10px;
  flex-shrink: 0;
}

.navbar-custom .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  transition: var(--transition-fast);
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
  color: var(--accent-color) !important;
}

/* Navbar toggler improved mobile touch target */
.navbar-custom .navbar-toggler {
  padding: 0.4rem 0.6rem;
  border: none;
  outline: none;
  box-shadow: none;
}

.navbar-custom .navbar-toggler:focus {
  box-shadow: none;
}

/* Rounded Theme Banners */
.hero-banner {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--white);
  padding: 5rem 1rem;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(var(--accent-color) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.05;
}

/* Button UX */
.btn-custom-primary {
  background-color: var(--primary-color);
  color: var(--white);
  border: 1px solid var(--primary-color);
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-headings);
  font-weight: 500;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .btn-custom-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

.btn-custom-primary:active {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: var(--white);
}

.btn-custom-accent {
  background-color: var(--accent-color);
  color: var(--primary-color);
  border: 1px solid var(--accent-color);
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-headings);
  font-weight: 600;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-accent);
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .btn-custom-accent:hover {
    background-color: #c49e2e;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
  }
}

.btn-custom-accent:active {
  background-color: #c49e2e;
  color: var(--primary-color);
}

/* Cards Design System */
.card-custom {
  background-color: var(--white);
  border: 1px solid rgba(27, 67, 50, 0.08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

/* Only apply hover transforms on desktop mice, not touch */
@media (hover: hover) and (pointer: fine) {
  .card-custom:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
  }
}

.card-custom .card-header-green {
  background-color: var(--bg-mint-faint);
  border-bottom: 2px solid rgba(45, 106, 79, 0.1);
  padding: 1.25rem;
}

/* Stepper Form / Status Timeline styling */
.stepper-timeline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  width: 100%;
  padding: 1rem 0;
  gap: 4px;
}

.stepper-timeline::before {
  content: '';
  position: absolute;
  top: 28px; /* Centered on icon */
  left: 10%;
  right: 10%;
  height: 4px;
  background-color: #dee2e6;
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  text-align: center;
  flex: 1;
  min-width: 0; /* Allow shrinking */
}

.step-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: #dee2e6;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem auto;
  font-weight: bold;
  border: 3px solid var(--white);
  transition: var(--transition-normal);
  flex-shrink: 0;
}

.step-item.active-done .step-icon {
  background-color: var(--status-approved);
  color: var(--white);
}

.step-item.active .step-icon {
  background-color: var(--accent-color);
  color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
}

.step-item.rejected .step-icon {
  background-color: var(--status-rejected);
  color: var(--white);
}

.step-item p {
  font-size: 0.8rem;
  font-weight: 500;
  margin: 0;
  color: var(--text-dark);
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.2;
}

/* Leaflet Map placeholder styles */
#leaflet-map-container {
  height: 400px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 2px solid var(--primary-color);
  width: 100%;
}

/* Explicit Contrast & Visibility Overrides for headings on dark backgrounds */
.text-white, 
h1.text-white, 
h2.text-white, 
h3.text-white, 
h4.text-white, 
h5.text-white, 
h6.text-white,
.font-heading.text-white,
.hero-banner h1,
.hero-banner h2,
.hero-banner p,
.bg-forest-green h1,
.bg-forest-green h2,
.bg-forest-green h3,
.bg-forest-green h4,
.bg-forest-green h5,
.bg-forest-green h6,
.bg-forest-green p {
  color: var(--white) !important;
}

.text-gold,
h1.text-gold,
h2.text-gold,
h3.text-gold,
h4.text-gold,
h5.text-gold,
h6.text-gold,
.font-heading.text-gold,
.hero-banner .text-gold,
.bg-forest-green .text-gold {
  color: var(--accent-color) !important;
}

/* ========================================
   TABLET RESPONSIVENESS (max-width: 991.98px)
   ======================================== */
@media (max-width: 991.98px) {
  .hero-banner {
    padding: 3rem 1rem;
  }

  .hero-banner h1 {
    font-size: 2rem !important;
  }

  .hero-banner .lead {
    font-size: 1rem !important;
  }

  #leaflet-map-container {
    height: 300px;
  }
}

/* ========================================
   MOBILE RESPONSIVENESS (max-width: 767.98px)
   ======================================== */
@media (max-width: 767.98px) {
  .hero-banner {
    padding: 2.5rem 0.75rem;
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
  }

  .hero-banner h1 {
    font-size: 1.6rem !important;
    line-height: 1.3;
  }

  .hero-banner .lead {
    font-size: 0.9rem !important;
    line-height: 1.5;
  }

  .hero-banner .btn-lg {
    padding: 0.6rem 1.2rem !important;
    font-size: 0.9rem !important;
  }

  /* Navbar mobile */
  .navbar-custom {
    padding: 0.5rem 0.75rem;
  }

  .navbar-custom .navbar-brand {
    font-size: 1.2rem;
  }

  .navbar-custom .navbar-brand img {
    height: 32px;
    margin-right: 6px;
  }

  /* Collapsed navbar - add padding and spacing to menu items */
  .navbar-custom .navbar-collapse {
    padding: 1rem 0;
  }

  .navbar-custom .navbar-collapse .d-flex {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.5rem;
  }

  .navbar-custom .navbar-collapse .d-flex .btn {
    width: 100%;
    text-align: center;
  }

  /* Map container responsive */
  #leaflet-map-container {
    height: 250px;
  }

  /* Section padding reduction */
  section.py-5 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  /* Card hover disabled on touch */
  .card-custom:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  /* Stepper mobile */
  .step-icon {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
    border-width: 2px;
  }

  .step-item p {
    font-size: 0.65rem;
  }

  .stepper-timeline::before {
    top: 22px;
  }

  /* Display utility classes responsive */
  .display-4 {
    font-size: 1.8rem !important;
  }

  .display-5 {
    font-size: 1.5rem !important;
  }

  .display-6 {
    font-size: 1.3rem !important;
  }

  /* CTA section padding */
  .card-custom.p-5 {
    padding: 2rem 1rem !important;
  }
}

/* ========================================
   EXTRA SMALL (max-width: 399.98px)
   ======================================== */
@media (max-width: 399.98px) {
  h1, .h1 { font-size: 1.5rem !important; }
  h2, .h2 { font-size: 1.25rem !important; }
  h3, .h3 { font-size: 1.1rem !important; }
  h4, .h4 { font-size: 1rem !important; }
  h5, .h5 { font-size: 0.9rem !important; }
  h6, .h6 { font-size: 0.8rem !important; }
  
  .hero-banner h1 {
    font-size: 1.4rem !important;
  }

  .step-icon {
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
  }

  .step-item p {
    font-size: 0.6rem;
  }

  .stepper-timeline::before {
    top: 18px;
  }

  .navbar-custom .navbar-brand {
    font-size: 1rem;
  }

  .navbar-custom .navbar-brand img {
    height: 28px;
  }
}
