/* Modern Navbar & Footer Styles - Complete Redesign */
:root {
  /* centralize navbar height used by other components (sticky sidebars) */
  --navbar-height: 48px;
  --container-max-width: 100%;
  --container-padding: 16px;
}

/* ============================================
   NAVBAR - Sleek Modern Design
   ============================================ */
.navbar-modern {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 9999;
  height: var(--navbar-height);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.navbar-modern > .container-fluid {
  max-width: 100%;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
  display: flex;
  align-items: center;
}

.navbar-modern.scrolled {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Brand */
.navbar-brand-modern {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a202c;
  transition: all 0.2s ease;
  padding: 6px 0;
}

.navbar-brand-modern:hover {
  color: #667eea;
}

.logo-modern {
  height: 36px;
  width: 36px;
  object-fit: contain;
}

.brand-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Navbar Toggler - Hidden on desktop, visible on mobile */
.navbar-toggler-modern {
  display: none; /* Hidden by default on desktop */
  border: none;
  background: transparent;
  padding: 6px;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  justify-content: center;
  align-items: center;
}

.navbar-toggler-modern span {
  display: block;
  width: 20px;
  height: 2px;
  background: #475569;
  border-radius: 1px;
  transition: all 0.2s ease;
}

.navbar-toggler-modern[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.navbar-toggler-modern[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.navbar-toggler-modern[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* Nav Links - Centered */
.navbar-nav-modern {
  gap: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  margin: 0 auto;
}

.nav-link-modern {
  color: #64748b;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  white-space: nowrap;
  position: relative;
}

.nav-link-modern:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.08);
}

.nav-link-modern.active {
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  font-weight: 600;
}

.nav-link-modern.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 3px 3px 0 0;
}

.nav-link-modern i {
  font-size: 0.9rem;
}

/* Navbar Actions */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* Search Button */
.nav-search-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-search-btn:hover {
  background: rgba(102, 126, 234, 0.08);
  color: #667eea;
}

/* Search Overlay - Full screen backdrop */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}

.search-overlay.active {
  display: flex;
}

/* Search Modal Box */
.search-modal {
  width: 100%;
  max-width: 600px;
  margin: 0 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: searchModalSlideDown 0.3s ease;
}

@keyframes searchModalSlideDown {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Search Input Container */
.search-input-container {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  gap: 12px;
}

.search-input-container .search-icon {
  color: #667eea;
  font-size: 1rem;
  flex-shrink: 0;
}

.search-input-container .search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: #1f2937;
  background: transparent;
}

.search-input-container .search-input::placeholder {
  color: #9ca3af;
}

.search-close-btn {
  background: #f3f4f6;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.search-close-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

/* Search Suggestions */
.search-suggestions {
  max-height: 400px;
  overflow-y: auto;
}

.search-section {
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.search-section:last-child {
  border-bottom: none;
}

.search-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 16px 8px;
  display: flex;
  align-items: center;
}

.suggestion-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  text-decoration: none;
  color: #374151;
  transition: all 0.15s ease;
  gap: 12px;
}

.suggestion-item:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  color: #667eea;
}

.suggestion-item i {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #6b7280;
  flex-shrink: 0;
}

.suggestion-item:hover i {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.suggestion-content {
  flex: 1;
  min-width: 0;
}

.suggestion-title {
  display: block;
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-meta {
  display: block;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 2px;
}

/* Search Loading */
.search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: #6b7280;
  font-size: 0.85rem;
}

.search-loading .spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* No Results */
.search-no-results {
  text-align: center;
  padding: 32px 16px;
  color: #6b7280;
}

.search-no-results i {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.5;
}

.search-no-results p {
  margin: 0 0 4px;
  font-weight: 500;
  color: #374151;
}

.search-no-results small {
  font-size: 0.8rem;
}

/* View All Results */
.search-view-all {
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.search-view-all a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #667eea;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.search-view-all a:hover {
  color: #764ba2;
}

/* Search Error */
.search-error {
  padding: 24px;
  text-align: center;
  color: #ef4444;
  font-size: 0.85rem;
}

/* Profile Dropdown */
.nav-profile-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: #475569;
  font-weight: 500;
  transition: all 0.15s ease;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-profile-btn:hover {
  background: rgba(102, 126, 234, 0.08);
  color: #667eea;
}

.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.7rem;
}

.profile-name-text {
  font-size: 0.8rem;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-profile-btn .bi-chevron-down {
  font-size: 0.65rem;
  opacity: 0.7;
}

.profile-dropdown-menu {
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 6px;
  margin-top: 4px;
  min-width: 160px;
  z-index: 10000;
}

.profile-dropdown-menu .dropdown-item {
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  font-size: 0.8rem;
}

.profile-dropdown-menu .dropdown-item:hover {
  background: rgba(102, 126, 234, 0.08);
  color: #667eea;
}

.profile-dropdown-menu .dropdown-item i {
  width: 16px;
  font-size: 0.85rem;
}

.profile-dropdown-menu .dropdown-divider {
  margin: 4px 0;
}

/* Login Button */
.btn-nav-login {
  padding: 6px 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  border: none;
}

.btn-nav-login:hover {
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  color: #fff;
}

/* Theme Toggle */
.theme-toggle-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.9rem;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-btn:hover {
  background: rgba(102, 126, 234, 0.08);
  color: #667eea;
}

.theme-dropdown-menu {
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 6px;
  margin-top: 4px;
  min-width: 120px;
  z-index: 10000;
}

.theme-dropdown-menu .dropdown-item {
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  font-size: 0.8rem;
}

.theme-dropdown-menu .dropdown-item:hover,
.theme-dropdown-menu .dropdown-item.active {
  background: rgba(102, 126, 234, 0.08);
  color: #667eea;
}

.theme-dropdown-menu .dropdown-item i {
  font-size: 0.85rem;
}

/* ============================================
   FOOTER - Compact Modern Design
   ============================================ */
.footer-modern {
  background: var(--footer-bg, linear-gradient(135deg, #1a202c 0%, #2d3748 100%));
  color: var(--footer-text, #e2e8f0);
  padding: 24px 0 0;
  margin-top: 28px;
}

.footer-modern > .container-fluid {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--footer-border, rgba(255, 255, 255, 0.08));
}

.footer-brand {
  max-width: 220px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.footer-logo-img {
  height: 26px;
  width: auto;
}

.footer-brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  background: var(--footer-brand-gradient, linear-gradient(135deg, #fff 0%, #e2e8f0 100%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-description {
  color: var(--footer-muted, #94a3b8);
  line-height: 1.5;
  margin-bottom: 12px;
  font-size: 0.75rem;
}

.footer-social {
  display: flex;
  gap: 6px;
}

.social-link {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--footer-social-bg, rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--footer-social-color, #cbd5e0);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.social-link:hover {
  background: var(--brand, #667eea);
  color: #fff;
}

.footer-col {
  display: flex;
  flex-direction: column;
}

.footer-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--footer-title, #fff);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-links li a {
  color: var(--footer-link, #94a3b8);
  text-decoration: none;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  transition: all 0.15s ease;
  padding: 2px 0;
}

.footer-links li a:hover {
  color: var(--footer-link-hover, #fff);
}

.footer-links li a i {
  font-size: 0.65rem;
  opacity: 0.6;
}

.footer-disclaimer {
  display: flex;
  align-items: center;
  color: var(--footer-disclaimer, #64748b);
  font-size: 0.7rem;
  margin-top: 6px;
}

.footer-bottom {
  padding: 12px 0;
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-copyright {
  margin: 0;
  color: var(--footer-muted, #94a3b8);
  font-size: 0.7rem;
}

.footer-copyright strong {
  color: var(--footer-text, #cbd5e0);
}

.footer-tech {
  margin: 0;
  color: var(--footer-disclaimer, #64748b);
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet and below - show toggler */
@media (max-width: 991.98px) {
  .navbar-toggler-modern {
    display: flex; /* Show toggler on mobile/tablet */
  }

  .navbar-modern {
    height: auto;
    min-height: var(--navbar-height);
    padding: 8px 0;
  }

  .navbar-modern > .container-fluid {
    flex-wrap: wrap;
  }

  .navbar-collapse {
    width: 100%;
    padding: 12px 0;
  }

  .navbar-nav-modern {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 4px;
    margin-top: 12px;
    flex: none;
  }

  .navbar-nav-modern .nav-item {
    width: 100%;
  }

  .nav-link-modern {
    padding: 12px 16px;
    width: 100%;
    border-radius: 10px;
    justify-content: flex-start;
  }

  .nav-link-modern.active::after {
    display: none;
  }

  .navbar-actions {
    width: 100%;
    justify-content: flex-start;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    gap: 12px;
    flex-wrap: wrap;
  }

  .profile-name-text {
    display: none;
  }

  .search-overlay {
    padding-top: 70px;
  }
  
  .search-modal {
    max-width: calc(100% - 32px);
  }

  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-brand {
    max-width: 100%;
  }
}

@media (max-width: 576px) {
  .brand-text {
    font-size: 0.85rem;
  }

  .logo-modern {
    height: 24px;
  }

  .btn-nav-login {
    padding: 8px 16px;
    font-size: 0.8rem;
  }

  .search-overlay {
    padding-top: 60px;
  }
  
  .search-modal {
    margin: 0 8px;
    max-width: calc(100% - 16px);
    border-radius: 12px;
  }
}

/* Dark Theme Support */
[data-theme="dark"] .navbar-modern,
.dark .navbar-modern {
  background: rgba(26, 32, 44, 0.98);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .navbar-brand-modern,
.dark .navbar-brand-modern {
  color: #e2e8f0;
}

[data-theme="dark"] .nav-link-modern,
.dark .nav-link-modern {
  color: #cbd5e0;
}

[data-theme="dark"] .nav-link-modern:hover,
[data-theme="dark"] .nav-link-modern.active,
.dark .nav-link-modern:hover,
.dark .nav-link-modern.active {
  color: #667eea;
  background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .search-overlay,
.dark .search-overlay {
  background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .search-modal,
.dark .search-modal {
  background: #1e293b;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .search-input-container,
.dark .search-input-container {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .search-input-container .search-input,
.dark .search-input-container .search-input {
  color: #e2e8f0;
}

[data-theme="dark"] .search-input-container .search-input::placeholder,
.dark .search-input-container .search-input::placeholder {
  color: #64748b;
}

[data-theme="dark"] .search-close-btn,
.dark .search-close-btn {
  background: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .search-close-btn:hover,
.dark .search-close-btn:hover {
  background: #475569;
  color: #e2e8f0;
}

[data-theme="dark"] .search-section,
.dark .search-section {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .suggestion-item,
.dark .suggestion-item {
  color: #e2e8f0;
}

[data-theme="dark"] .suggestion-item i,
.dark .suggestion-item i {
  background: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .suggestion-item:hover,
.dark .suggestion-item:hover {
  background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .search-view-all,
.dark .search-view-all {
  background: #0f172a;
  border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .search-no-results,
.dark .search-no-results {
  color: #94a3b8;
}

[data-theme="dark"] .search-no-results p,
.dark .search-no-results p {
  color: #e2e8f0;
}

@media (prefers-color-scheme: dark) {
  .navbar-modern {
    background: rgba(26, 32, 44, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .navbar-brand-modern {
    color: #e2e8f0;
  }

  .nav-link-modern {
    color: #cbd5e0;
  }

  .nav-link-modern:hover {
    color: #667eea;
  }
}

