/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.navbar {
  background-color: var(--card);
  position: sticky;
  top: 0;
  width: 100%;
  z-index: var(--z-nav);
  border-bottom: 1px solid var(--muted-2);
  padding: var(--space-2) 0;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.navbar.scrolled {
  padding: var(--space-1) 0;
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
  color: var(--black);
  text-decoration: none;
}

.logo i {
  color: var(--accent); /* Updated to use accent color */
  margin-right: var(--space-1);
  font-size: 1.25em;
}

.navbar-search {
  flex: 1;
  max-width: 400px;
  margin: 0 var(--space-4);
}

.navbar-search .search-container {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--divider);
  transition: all var(--transition-fast);
}

.navbar-search .search-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-weak);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.navbar-link {
  color: var(--black);
  font-weight: var(--font-weight-medium);
  position: relative;
  padding: var(--space-1) 0;
}

.navbar-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: width var(--transition-normal);
}

.navbar-link:hover::after,
.navbar-link.active::after {
  width: 100%;
}

.navbar-link:hover {
  color: var(--primary);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Mobile menu */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--black);
  font-size: var(--font-size-xl);
  cursor: pointer;
}

@media (max-width: 992px) {
  .navbar-container {
    flex-wrap: wrap;
  }
  
  .logo-and-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .navbar-search,
  .navbar-links {
    display: none;
    width: 100%;
    margin: var(--space-2) 0 0;
  }
  
  .navbar-links {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
  
  .navbar-search.open,
  .navbar-links.open {
    display: block;
  }
  
  .navbar-actions {
    width: 100%;
    justify-content: flex-start;
    margin-top: var(--space-2);
  }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  background-color: var(--surface);
  padding: var(--space-4) 0 var(--space-6); /* Reduced vertical height */
  text-align: center;
  background-image: linear-gradient(180deg, rgba(43, 111, 110, 0.03), transparent 60%); /* Muted teal */
  border-bottom: 1px solid var(--divider);
  max-height: 300px; /* Cap the height to push content above fold */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-title {
  font-size: var(--font-size-4xl); /* Slightly smaller */
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-1); /* Tighter spacing */
  line-height: var(--line-height-tight);
}

.hero-subtitle {
  font-size: var(--font-size-lg); /* Smaller subtitle */
  max-width: 600px;
  margin: 0 auto var(--space-3); /* Adjusted margins */
  color: var(--muted); /* Muted text color */
  margin-bottom: var(--space-4);
  color: var(--muted);
}

.hero-search-container {
  max-width: 600px;
  margin: var(--space-2) auto var(--space-3);
  position: relative;
}

.hero-search-input {
  width: 100%;
  padding: var(--space-2) var(--space-6) var(--space-2) var(--space-6);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--divider);
  box-shadow: var(--shadow);
  transition: all var(--transition-normal);
  background-color: var(--surface);
}

.hero-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.2), var(--shadow-md);
}

.hero-search-icon {
  position: absolute;
  left: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: var(--font-size-xl);
}

.hero-search-button {
  position: absolute;
  right: var(--space-1);
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--accent); /* Updated accent color */
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-3); /* Slightly wider button */
  font-weight: var(--font-weight-semibold); /* More prominent */
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); /* Subtle shadow for depth */
}

.hero-search-button:hover {
  background-color: #0d47a1;
}

/* ==========================================================================
   Category Section
   ========================================================================== */

.category-section {
  padding: var(--space-6) 0;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-3);
}

.category-card {
  background-color: var(--surface);
  border-radius: var(--radius-lg); /* Increased radius */
  box-shadow: var(--shadow);
  padding: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: all var(--transition-normal);
  cursor: pointer;
  border: 1px solid var(--divider); /* Light border */
  text-decoration: none; /* For <a> elements */
  color: var(--text); /* Ensure text color is consistent */
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent); /* New accent color */
}

.category-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background-color: var(--accent-weak); /* Using accent-weak for icons */
  color: var(--accent); /* New accent color */
  font-size: var(--font-size-2xl);
}

.category-info {
  flex: 1;
}

.category-name {
  margin: 0 0 var(--space-0-5);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
}

.category-count {
  color: var(--muted);
  font-size: var(--font-size-sm);
}

/* ==========================================================================
   Document List Section
   ========================================================================== */

.documents-section {
  padding: var(--space-6) 0;
}

.documents-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-3);
}

.document-card {
  background-color: var(--surface);
  border-radius: var(--radius-lg); /* Increased radius */
  box-shadow: var(--shadow);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all var(--transition-normal);
  border: 1px solid var(--divider); /* Light border */
}

.document-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--accent); /* New accent color */
}

.document-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(21, 101, 192, 0.1);
  color: var(--primary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-lg);
}

.document-title {
  font-size: var(--font-size-lg);
  margin: 0 0 var(--space-1);
  font-weight: var(--font-weight-medium);
  color: var(--black);
}

.document-description {
  color: var(--muted);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  flex: 1;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--muted);
}

.document-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-0-5);
}

.document-meta-icon {
  font-size: 0.875em;
}

.document-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: auto;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background-color: white;
  border-top: 1px solid var(--muted-2);
  padding: var(--space-6) 0;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.footer-section h4 {
  margin-bottom: var(--space-2);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-link {
  margin-bottom: var(--space-1);
}

.footer-link a {
  color: var(--muted);
  transition: color var(--transition-fast);
  font-size: var(--font-size-sm);
}

.footer-link a:hover {
  color: var(--primary);
}

.footer-bottom {
  margin-top: var(--space-4);
  padding-top: var(--space-2);
  border-top: 1px solid var(--muted-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.footer-copyright {
  color: var(--muted);
  font-size: var(--font-size-sm);
}

.footer-social {
  display: flex;
  gap: var(--space-2);
}

.footer-social-link {
  color: var(--muted);
  font-size: var(--font-size-lg);
  transition: color var(--transition-fast);
}

.footer-social-link:hover {
  color: var(--primary);
}

/* ==========================================================================
   CTA Section
   ========================================================================== */

.cta-section {
  background-color: rgba(21, 101, 192, 0.05);
  padding: var(--space-6) 0;
  text-align: center;
}

.cta-title {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-2);
}

.cta-subtitle {
  font-size: var(--font-size-lg);
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto var(--space-4);
}

/* ==========================================================================
   Features Section
   ========================================================================== */

.features-section {
  padding: var(--space-6) 0;
  background-color: white;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
}

.feature-item {
  text-align: center;
  padding: var(--space-3);
}

.feature-icon {
  background-color: var(--accent-weak);
  color: var(--accent);
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-2);
  font-size: var(--font-size-2xl);
  box-shadow: 0 4px 12px rgba(43, 111, 110, 0.08);
}

.feature-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

.feature-description {
  color: var(--muted);
  font-size: var(--font-size-base);
}

/* ==========================================================================
   Responsive adjustments
   ========================================================================== */

/* ========================================================================== 
   Skeleton Loaders & Error States
   ========================================================================== */

/* Skeleton loaders */
.skeleton {
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.6) 50%, 
    rgba(255, 255, 255, 0) 100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Skeleton shapes */
.skeleton-icon {
  width: 48px;
  height: 48px;
  background-color: var(--divider);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
}

.skeleton-title {
  height: 24px;
  background-color: var(--divider);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
  width: 80%;
}

.skeleton-text {
  height: 16px;
  background-color: var(--divider);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-1);
  width: 90%;
}

.skeleton-text.small {
  height: 12px;
  width: 70%;
}

.skeleton-content {
  flex: 1;
}

.skeleton-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.skeleton-button {
  height: 32px;
  width: 80px;
  background-color: var(--divider);
  border-radius: var(--radius-sm);
}

/* Error states */
.error-state {
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--divider);
  padding: var(--space-4);
  text-align: center;
  margin: var(--space-4) auto;
  max-width: 500px;
}

.error-icon {
  font-size: 3rem;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.error-title {
  margin: 0 0 var(--space-1);
  color: var(--text);
}

.error-message {
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* Static Page Styles */
.static-page-content {
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--divider);
  padding: var(--space-6);
  margin: var(--space-4) auto;
  max-width: 800px;
  box-shadow: var(--shadow);
}

.static-page-content h2 {
  margin-top: 0;
  margin-bottom: var(--space-4);
  color: var(--text);
  position: relative;
}

.static-page-content h2::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--accent);
}

.static-page-content p {
  color: var(--muted);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-3);
}

/* About page specific */
.about-content {
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--divider);
  padding: var(--space-6);
  margin: var(--space-4) auto;
  max-width: 800px;
  box-shadow: var(--shadow);
}

/* Mobile Styles */
@media (max-width: 768px) {
  .hero-title {
    font-size: var(--font-size-4xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-lg);
  }
  
  .documents-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }
  
  .hero {
    padding: var(--space-4) 0;
  }
  
  .section {
    padding: var(--space-4) 0;
  }
}

/* ==========================================================================
   Animations
   ========================================================================== */

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

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.fade-in-1 { animation-delay: 0.1s; }
.fade-in-2 { animation-delay: 0.2s; }
.fade-in-3 { animation-delay: 0.3s; }
.fade-in-4 { animation-delay: 0.4s; }
.fade-in-5 { animation-delay: 0.5s; }
