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

/* Variables */
:root {
  --primary: #1B5E20;      /* Deep green */
  --primary-dark: #2d7a3e; /* Darker green for accents */
  --accent: #FF6F00;       /* Saffron */
  --accent-hover: #e55c00; /* Darker orange for hover */
  --accent-active: #d44c00; /* Even darker for active */
  --bg: #F5F5F5;
  --bg-light: #f9f9f9;
  --surface: #FFFFFF;
  --text: #212121;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-light: #666666;
  --border: #E0E0E0;
  --border-light: #e8e8e8;
  --footer-bg: #1a4d2e;    /* Dark green footer */
}

/* Base */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

[lang="mr"] {
  font-family: 'Noto Sans Devanagari', 'Hind', sans-serif;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 12px;
  }
}

/* Header */
.header {
  background: var(--primary);
  color: white;
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  text-decoration: none;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.logo:hover {
  opacity: 0.85;
}

.logo img {
  height: 40px;
  width: 40px;
  object-fit: contain;
}

/* Navigation */
.nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  transition: background-color 0.3s ease;
  border-radius: 4px;
  letter-spacing: 0.5px;
  border-bottom: 3px solid transparent;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav a.active {
  border-bottom: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
}

.hamburger {
  display: none !important;
  font-size: 2rem;
  cursor: pointer;
  color: white;
  user-select: none;
  position: relative;
  width: 30px;
  height: 24px;
  transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  height: 3px;
  width: 100%;
  background: white;
  left: 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger::before {
  top: 0;
}

.hamburger::after {
  bottom: 0;
}

/* Hamburger middle line (using text content) */
.nav-toggle:not(:checked) ~ label.hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Menu open state - hamburger transforms to X */
.nav-toggle:checked ~ .hamburger {
  color: transparent;
}

.nav-toggle:checked ~ .hamburger::before {
  transform: rotate(45deg);
  top: 50%;
  margin-top: -1.5px;
}

.nav-toggle:checked ~ .hamburger::after {
  transform: rotate(-45deg);
  bottom: 50%;
  margin-bottom: -1.5px;
}

@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
  }

  .hamburger {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    padding: 1rem;
    gap: 0.25rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }

  .nav a {
    width: 100%;
    padding: 1rem;
    text-align: left;
    border-bottom: none;
  }

  .nav a.active {
    border-bottom: none;
    border-left: 3px solid var(--accent);
  }

  .nav-toggle:checked ~ .nav {
    display: flex;
    animation: slideDown 0.3s ease-out;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  padding-left: 16px;
  margin-left: 8px;
}

.lang-toggle a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-weight: 600;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.lang-toggle a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lang-toggle a.active {
  background: rgba(255, 255, 255, 0.2);
  font-weight: 700;
}

/* Main */
.main {
  min-height: 60vh;
  padding: 2rem 0;
}

.main-no-top-padding {
  padding-top: 0;
}

/* Footer */
.footer {
  background: var(--footer-bg);
  color: white;
  padding: 32px 24px;
  text-align: center;
  margin-top: 3rem;
}

.footer p {
  margin: 0.5rem 0;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

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

.footer .footer-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 16px 0;
  padding-top: 16px;
}

.footer .footer-branding {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 8px;
}

.footer .footer-branding a {
  color: var(--accent);
  font-weight: 600;
  transition: all 0.2s ease;
}

.footer .footer-branding a:hover {
  color: #ff9c3d;
  text-decoration: underline;
}

/* Components - Buttons */
.btn {
  display: inline-block;
  padding: 16px 32px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  outline-offset: 2px;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 111, 0, 0.3);
}

.btn:focus-visible {
  outline: 2px solid #ff9c3d;
  outline-offset: 2px;
}

.btn:active {
  background: var(--accent-active);
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: var(--primary);
}

.btn-secondary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 8px rgba(27, 94, 32, 0.3);
}

.btn-secondary:focus-visible {
  outline: 3px solid var(--primary);
}

/* Cards */
.card {
  background: var(--surface);
  padding: 28px 24px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.75rem;
}

.card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.card strong {
  color: var(--primary);
  font-weight: 700;
}

/* Statistics Cards */
.stats {
  margin-bottom: 48px;
}

.stats .grid {
  gap: 24px;
}

@media (min-width: 768px) {
  .stats .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  text-align: center;
  padding: 32px 24px;
  background: #ffffff;
  position: relative;
  overflow: hidden;
  border-left: 5px solid var(--primary-dark);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(27, 94, 32, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.stat-card .value {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.stat-card .label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* Quick Links Section */
.quick-links {
  margin-bottom: 48px;
}

.quick-links .grid {
  gap: 24px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  margin-bottom: 1rem;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid var(--border);
}

th {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

tr:nth-child(even) {
  background: #FAFAFA;
}

/* Mobile table: Stack as cards */
@media (max-width: 768px) {
  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
  }

  td {
    position: relative;
    padding-left: 50%;
    border: none;
    border-bottom: 1px solid var(--border);
  }

  td:last-child {
    border-bottom: none;
  }

  td:before {
    content: attr(data-label);
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    font-weight: 600;
    width: 45%;
  }
}

/* Grid System */
.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Hero Section - Standard (for all pages except homepage) */
.hero {
  padding: 2rem 0;
}

.hero h1 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

/* Hero Section with Carousel Background (homepage only) */
.hero-carousel-wrapper {
  position: relative;
  overflow: hidden;
  min-height: 500px;
  background-color: var(--surface);
}

.hero-carousel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  filter: brightness(0.8);
}

.carousel-slide::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(27, 94, 32, 0.15), rgba(27, 94, 32, 0.25));
  pointer-events: none;
}

/* Override hero styles when inside carousel wrapper */
.hero-carousel-wrapper .hero {
  position: relative;
  z-index: 2;
  padding: 3rem 0;
  color: white;
}

.hero-carousel-wrapper .hero h1 {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.2;
  color: white;
  margin-bottom: 0.75rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-carousel-wrapper .hero p {
  font-size: 1.5rem;
  color: white;
  margin-bottom: 1.5rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.carousel-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 0.5rem;
}

.carousel-dot {
  /* 44px touch target for mobile accessibility */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Inner visible circle (maintains 10px appearance) */
.carousel-dot::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.carousel-dot.active::before {
  background-color: rgba(255, 255, 255, 0.9);
  width: 12px;
  height: 12px;
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-carousel-wrapper {
    min-height: 600px;
  }

  .hero-carousel-wrapper .hero {
    padding: 5rem 0;
  }

  .hero-carousel-wrapper .hero h1 {
    font-size: 56px;
  }

  .hero-carousel-wrapper .hero p {
    font-size: 1.75rem;
  }
}

/* Typography */
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  margin-top: 40px;
  border-bottom: 3px solid var(--primary-dark);
  padding-bottom: 12px;
}

/* First h2 in a section shouldn't have top margin */
.container > h2:first-child,
section > h2:first-child,
.quick-links > h2:first-child {
  margin-top: 0;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

/* Content Sections */
.content-section {
  background: var(--bg-light);
  padding: 20px 24px;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  margin-bottom: 24px;
}

.content-section a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: all 0.2s ease;
}

.content-section a:hover {
  border-bottom: 2px solid var(--accent);
}

/* Badge/Chip */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.badge-accent {
  background: var(--accent);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  min-height: 44px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: white;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

.form-control:invalid:not(:placeholder-shown) {
  border-color: #d32f2f;
}

.form-control:valid:not(:placeholder-shown) {
  border-color: #388e3c;
}

.form-control:not(:placeholder-shown) {
  background: #FAFAFA;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Lists */
ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Info Banners */
.banner {
  padding: 1rem 1.5rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  border-left: 4px solid;
}

.banner-info {
  background: #E3F2FD;
  border-color: #2196F3;
  color: #1565C0;
}

.banner-success {
  background: #E8F5E9;
  border-color: #4CAF50;
  color: #2E7D32;
}

.banner-warning {
  background: #FFF3E0;
  border-color: #FF9800;
  color: #E65100;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 200;
}

.skip-link:focus {
  top: 0;
}

/* Breadcrumb Navigation */
.breadcrumb {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  padding: 0.75rem 0;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--text);
  font-weight: 500;
}

/* Utilities */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-1 {
  margin-top: 1rem;
}

.mt-2 {
  margin-top: 2rem;
}

.mt-3 {
  margin-top: 48px;
}

.mb-1 {
  margin-bottom: 1rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

.mb-3 {
  margin-bottom: 48px;
}

.p-1 {
  padding: 1rem;
}

.p-2 {
  padding: 2rem;
}

/* Section spacing */
section {
  margin-bottom: 48px;
}

/* Responsive Typography */
@media (max-width: 768px) {
  body {
    font-size: 16px; /* Never smaller than 16px on mobile to prevent zoom */
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 20px;
    margin-top: 32px;
    margin-bottom: 16px;
  }

  h3 {
    font-size: 16px;
  }

  .stat-card .value {
    font-size: 36px;
  }

  .card {
    padding: 20px 16px;
  }
}

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

/* Links */
a {
  color: var(--primary);
}

a:hover {
  color: var(--accent);
}

.card h4 a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s;
}

.card h4 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .nav,
  .lang-toggle,
  .btn {
    display: none;
  }

  body {
    background: white;
  }

  .card {
    border: 1px solid #333;
    page-break-inside: avoid;
  }
}
