/* Header / navbar improvements:
   - increase tappable area, improve vertical alignment, subtle separation from content
   - keep bootstrap collapse behavior and responsiveness
   - Enhanced visual separation between navigation items
*/

.navbar {
  padding: 0.75rem 1rem;
  min-height: 72px; /* Increased height for better spacing */
  border-bottom: 2px solid #e2e8f0;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.navbar .container-fluid {
  align-items: center;
  gap: 1rem;
}

/* Brand adjustments with better visual separation */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #1e293b;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.2s ease;
}

.navbar-brand:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
  color: #1e293b;
  text-decoration: none;
}

.navbar-brand .brand-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.navbar-brand .brand-text {
  display: inline-block;
  white-space: nowrap;
}

/* Enhanced nav links with clear boundaries */
.navbar-nav {
  gap: 0.5rem; /* Space between nav items */
}

.navbar-nav .nav-item {
  position: relative;
}

.navbar-nav .nav-link {
  color: #475569;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  background: white;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin: 0 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  color: #1e40af;
  background: #eff6ff;
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  text-decoration: none;
}

/* Active state for nav links */
.navbar-nav .nav-link.active,
.navbar-nav .nav-link[aria-current="page"] {
  color: #1e40af;
  background: #dbeafe;
  border-color: #3b82f6;
  font-weight: 600;
}

/* Special styling for the Lake Tides link to make it stand out */
.navbar-nav .nav-link[href*="Subscriptions"] {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #10b981;
  color: #065f46;
}

.navbar-nav .nav-link[href*="Subscriptions"]:hover {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: #059669;
  color: #064e3b;
}

/* Dropdown menu styling */
.navbar .dropdown-menu {
  min-width: 240px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
}

.dropdown-item {
  border-radius: 8px;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: #f1f5f9;
  color: #1e40af;
}

/* Keep collapse contents properly aligned */
.navbar-collapse {
  display: flex !important;
  align-items: center;
}

/* Remove default bootstrap box shadow in favor of our custom one */
nav.box-shadow {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* Updated Footer Styles - Match Public Layout */
.public-footer {
  background: #343a40;
  color: white;
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: none;
}

.public-footer h5 {
  color: white;
  font-weight: 600;
  margin-bottom: 1rem;
}

.public-footer p {
  color: #adb5bd;
  line-height: 1.5;
}

.public-footer a {
  color: #adb5bd;
  text-decoration: none;
  transition: color 0.2s ease;
}

.public-footer a:hover {
  color: white;
  text-decoration: underline;
}

.footer-auth-section {
  margin-bottom: 1rem;
}

/* Authentication section in footer - updated for public footer style */
.auth-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  min-height: 44px;
}

.welcome-text {
  color: #e5e7eb;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.sign-out-btn,
.sign-in-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
  min-height: 44px;
  white-space: nowrap;
  touch-action: manipulation;
}

.sign-out-btn:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
  color: white;
  text-decoration: none;
}

.sign-in-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.sign-in-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
  color: white;
  text-decoration: none;
}

.sign-in-section {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  justify-content: flex-end;
}

.sign-out-icon,
.sign-in-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

/* Mobile navigation improvements */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 1rem;
    padding: 1rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  }
  
  .navbar-nav {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }
  
  .navbar-nav .nav-link {
    margin: 0;
    text-align: center;
    padding: 1rem;
  }
}

/* Tablet and smaller desktop adjustments */
@media (max-width: 768px) {
  .public-footer {
    padding: 1.25rem 0;
    margin-top: 1rem;
  }
  
  .public-footer .container {
    padding: 0 0.75rem;
  }
  
  .public-footer .row {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .public-footer .col-md-6 {
    text-align: center;
  }
  
  .auth-section {
    justify-content: center;
    width: 100%;
  }
  
  .user-info {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    text-align: center;
  }
  
  .welcome-text {
    text-align: center;
    justify-content: center;
    white-space: normal;
    word-break: break-word;
    font-size: 0.8rem;
  }
  
  .sign-out-btn,
  .sign-in-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    justify-content: center;
    min-width: 140px;
    width: 100%;
    max-width: 200px;
  }
  
  .sign-in-section {
    width: 100%;
    justify-content: center;
  }

  .footer-auth-section {
    order: 1;
    margin-bottom: 1.5rem;
  }
}

/* Small screen adjustments */
@media (max-width: 575.98px) {
  .navbar {
    padding: 0.5rem 0.75rem;
    min-height: 64px;
  }
  
  .navbar-brand {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
  }
  
  .navbar-brand .brand-icon {
    font-size: 1.2rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  .public-footer {
    padding: 1rem 0;
  }
  
  .public-footer .container {
    padding: 0 0.5rem;
  }
  
  .user-info {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  .welcome-text {
    font-size: 0.75rem;
    line-height: 1.3;
  }
  
  .sign-out-btn,
  .sign-in-btn {
    font-size: 0.8rem;
    padding: 0.75rem 1rem;
    gap: 0.375rem;
    min-width: 120px;
  }
  
  .sign-out-icon,
  .sign-in-icon {
    font-size: 0.9rem;
  }
}

/* Very small screens (phones in portrait) */
@media (max-width: 480px) {
  .public-footer .row {
    gap: 0.75rem;
  }
  
  .public-footer p {
    font-size: 0.875rem;
  }
  
  .user-info {
    padding: 0.625rem;
    gap: 0.5rem;
    max-width: 280px;
  }
  
  .welcome-text {
    font-size: 0.7rem;
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .sign-out-btn,
  .sign-in-btn {
    font-size: 0.75rem;
    padding: 0.625rem 0.75rem;
    min-width: 100px;
    gap: 0.25rem;
  }
  
  .sign-out-icon,
  .sign-in-icon {
    font-size: 0.8rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .navbar-brand,
  .navbar-nav .nav-link {
    border: 2px solid #000;
    background: #fff;
    color: #000;
  }
  
  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link:focus {
    background: #000;
    color: #fff;
  }
  
  .sign-out-btn,
  .sign-in-btn {
    background: #000;
    color: #fff;
    border: 2px solid #000;
  }
  
  .user-info {
    border: 2px solid #000;
    background: #fff;
  }
  
  .public-footer {
    border-top: 2px solid #000;
    background: #fff;
    color: #000;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .navbar-brand,
  .navbar-nav .nav-link,
  .sign-out-btn,
  .sign-in-btn {
    transition: none;
  }
  
  .navbar-nav .nav-link:hover,
  .sign-out-btn:hover,
  .sign-in-btn:hover {
    transform: none;
  }
}

/* Focus indicators for accessibility */
.navbar-brand:focus-visible,
.navbar-nav .nav-link:focus-visible,
.sign-out-btn:focus-visible,
.sign-in-btn:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

/* Landscape orientation adjustments for tablets */
@media (max-width: 1024px) and (orientation: landscape) {
  .public-footer .row {
    flex-direction: row;
  }
  
  .public-footer .col-md-6:first-child {
    text-align: left;
  }
  
  .public-footer .col-md-6:last-child {
    text-align: right;
  }
  
  .auth-section {
    justify-content: flex-end;
    width: auto;
  }
  
  .user-info {
    flex-direction: row;
    width: auto;
    max-width: none;
  }
  
  .welcome-text {
    font-size: 0.8rem;
    white-space: nowrap;
  }
  
  .sign-out-btn,
  .sign-in-btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    width: auto;
  }
}

/* Fix for iOS Safari viewport units */
@supports (-webkit-touch-callout: none) {
  .public-footer {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  }
  
  @media (max-width: 768px) {
    .public-footer {
      padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }
  }
  
  @media (max-width: 575.98px) {
    .public-footer {
      padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
  }
}

/* Print styles */
@media print {
  .navbar {
    background: white !important;
    border-bottom: 2px solid #000;
    box-shadow: none;
  }
  
  .navbar-brand,
  .navbar-nav .nav-link {
    background: white !important;
    color: #000 !important;
    border: 1px solid #000;
  }
  
  .public-footer {
    background: white !important;
    border-top: 2px solid #000;
    box-shadow: none;
    page-break-inside: avoid;
    color: #000 !important;
  }
  
  .sign-out-btn,
  .sign-in-btn {
    background: white !important;
    color: #000 !important;
    border: 1px solid #000;
  }
  
  .auth-section {
    display: none; /* Hide authentication in print */
  }
}

/* Dark mode considerations */
@media (prefers-color-scheme: dark) {
  .public-footer {
    background: #1f2937;
    color: #e5e7eb;
  }
  
  .public-footer h5 {
    color: #f3f4f6;
  }
  
  .public-footer p {
    color: #d1d5db;
  }
  
  .public-footer a {
    color: #60a5fa;
  }
  
  .public-footer a:hover {
    color: #93c5fd;
  }
  
  .user-info {
    background: rgba(31, 41, 55, 0.8);
    border-color: #374151;
  }
  
  .welcome-text {
    color: #e5e7eb;
  }
}