/* CPANation - Professional CPA Directory Theme */

:root {
  /* Brand palette */
  --brand-primary: #1B3C53;
  --brand-primary-dark: #0F2A3A;
  --brand-primary-light: #244A61;
  --brand-secondary: #E58833;
  --brand-secondary-light: #F6A45A;
  --brand-accent: #F0F4F8;
  --brand-accent-strong: #D9E2EC;
  --text-heading: #1B3C53;
  --text-body: #34495E;
  --text-muted: #5D6D7E;
  --text-white: #FFFFFF;
  --border-light: #E2E8F0;
  --border-subtle: #CBD5E1;
  --card: #FFFFFF;
  --surface-soft: #F8FAFC;
  --surface-alt: #EEF2F6;

  /* Spacing & radii */
  --radius: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-2xl: 36px;
  --radius-full: 999px;

  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --transition: 0.2s ease-in-out;
  --transition-normal: 0.3s ease;
  --shadow-soft: 0 18px 36px rgba(15, 42, 58, 0.14);
  --shadow-subtle: 0 12px 26px rgba(15, 42, 58, 0.08);

  --font-weight-medium: 600;
  --font-weight-semibold: 600;

  /* Legacy aliases for existing styles */
  --navy-dark: var(--brand-primary);
  --navy: #254D70;
  --navy-light: #456882;
  --white: #FFFFFF;
  --gray-50: var(--surface-soft);
  --gray-100: var(--border-light);
  --gray-600: #475569;
  --gray-700: #334155;
  --accent: var(--brand-accent);
  --brand-bg-primary: var(--surface-soft);
  --brand: var(--brand-primary);
  --cta-ink: #FDE68A;
  --brand-gray-50: var(--surface-soft);
  --text-primary: var(--brand-primary);
}

/* Base Styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-body);
  background-color: var(--surface-soft);
  line-height: 1.65;
  padding-top: var(--nav-height, 80px); /* dynamic navbar height */
}

/* Navigation */
.navbar {
  background-color: #EFEEEA !important;
  padding: 0.85rem 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.navbar.scrolled {
  background-color: #EFEEEA !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar-brand img {
  height: 38px;
  width: auto;
}

.nav-link {
  color: var(--brand-primary) !important;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 10px;
  transition: all var(--transition);
}

.nav-link:hover,
.nav-link:focus {
  background-color: rgba(27, 60, 83, 0.06);
  color: var(--brand-primary) !important;
}

.navbar-toggler {
  border-color: rgba(27, 60, 83, 0.2);
  padding: 0.45rem;
  border-radius: 10px;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(27, 60, 83, 0.1);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(27, 60, 83, 0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Dropdown Menus */
.dropdown-menu {
  background: var(--white);
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
  margin-top: 0.5rem;
  min-width: 800px;
  z-index: 1035;
}

.dropdown-header {
  color: var(--navy);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.875rem;
  padding: 0 0 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--gray-100);
}

.dropdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  width: 100%;
}

.dropdown-column {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dropdown-item {
  color: var(--gray-700);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.9375rem;
  line-height: 1.4;
  white-space: normal;
}

.dropdown-item:hover {
  background-color: var(--gray-50);
  color: var(--navy);
  transform: translateX(2px);
}

.dropdown-item i {
  color: var(--navy);
  width: 24px;
  margin-right: 0.75rem;
  font-size: 1rem;
  flex-shrink: 0;
}

.dropdown-item span {
  flex: 1;
}

/* Category Count Badge */
.category-count {
  background: var(--gray-50);
  color: var(--navy);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

.dropdown-item:hover .category-count {
  background: var(--navy);
  color: var(--white);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #1B3C53 0%, #10273B 100%);
  color: var(--text-white);
  padding: 8rem 0 4.5rem;
  position: relative;
  overflow: hidden;
  margin-top: -80px;
  z-index: 1;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.28), transparent 55%);
  opacity: 0.65;
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 39, 59, 0.25), transparent 40%);
  pointer-events: none;
}

.hero-section--light {
  background: linear-gradient(135deg, #F8F9FB 0%, #EEF4F8 100%);
  color: var(--text-heading);
}

.hero-section--light::before,
.hero-section--light::after {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 1.5rem 0;
}

.hero-content.hero-content--left {
  text-align: left;
  margin-left: 0;
}

.hero-title {
  font-size: clamp(2.4rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.18;
  margin-bottom: var(--space-3);
}

.hero-subtitle {
  font-size: 1.125rem;
  line-height: 1.75;
  margin-bottom: var(--space-6);
  color: rgba(255, 255, 255, 0.85);
}

.hero-section--light .hero-subtitle {
  color: var(--text-muted);
}

/* Search Form */
.search-form {
  background: var(--white);
  border-radius: 12px;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.search-form .form-control {
  height: 3.5rem;
  border: 2px solid var(--gray-100);
  border-radius: 8px;
  padding: 0 1.25rem;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.search-form .form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(37, 77, 112, 0.1);
}

/* Button Styles */
.btn-primary,
.btn.btn-primary {
  background-color: #1B3C53 !important;
  border: none !important;
  color: white !important;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 16px;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn.btn-primary:hover,
.btn.btn-primary:focus,
.btn.btn-primary:active {
  background-color: #0F2A3A !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 60, 83, 0.3);
}

.btn-lg.btn-primary {
  padding: 1rem 2.5rem;
  font-size: 18px;
}

.btn-secondary,
.btn.btn-secondary {
  background-color: transparent !important;
  border: 2px solid #1B3C53 !important;
  color: #1B3C53 !important;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 16px;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active,
.btn.btn-secondary:hover,
.btn.btn-secondary:focus,
.btn.btn-secondary:active {
  background-color: #1B3C53 !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 60, 83, 0.3);
}

.search-form .btn-primary {
  height: 3.5rem;
  padding: 0 2rem;
}

/* Responsive Design */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: #EFEEEA;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }

  .dropdown-menu {
    min-width: 100%;
    margin: 0.5rem 0;
    padding: 1rem;
    background: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .dropdown-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dropdown-header {
    color: #183B4E;
    font-size: 0.8125rem;
    padding: 0 0 0.75rem;
    margin-bottom: 0.75rem;
}

.dropdown-item {
    color: #183B4E;
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
}

.dropdown-item:hover {
    background-color: var(--gray-50);
    color: #183B4E;
  }

  body { padding-top: 76px; }
}

@media (max-width: 767.98px) {
  body { padding-top: 70px; }
  .dropdown-menu {
    padding: 0.75rem;
  }

  .dropdown-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .dropdown-item {
    padding: 0.5rem 0.75rem;
  }

  .dropdown-header {
    padding: 0 0 0.5rem;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 767.98px) {
  .hero-title { font-size: 2.25rem; }

  .search-form .form-control,
  .search-form .btn-primary {
    height: 3rem;
  }
}

/* Footer */
.footer-main {
  background: var(--brand-primary);
  color: var(--text-white);
  position: relative;
  overflow: hidden;
}

.footer-main::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1), transparent 60%);
  pointer-events: none;
}

.footer-main h5 {
  color: var(--text-white);
  margin-bottom: 1.5rem;
}

.footer-main .text-light {
  color: rgba(255, 255, 255, 0.9) !important;
}

.footer-main hr {
  border-color: rgba(255, 255, 255, 0.1);
}

.footer-main .list-unstyled a {
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
}

.footer-main .list-unstyled a:hover {
  color: var(--text-white);
  transform: translateX(2px);
}

.footer-main .social-links a {
  opacity: 0.8;
  transition: all 0.2s ease;
}

.footer-main .social-links a:hover {
  opacity: 1;
  transform: translateY(-2px);
}