

        * {
      box-sizing: border-box;
    }

    #map canvas {
      pointer-events: auto;
    }

    .maplibregl-ctrl-bottom-right > * {
      margin-bottom: 8px;
      z-index: 101 !important;
    }

    .maplibregl-ctrl-group {
      border-radius: 8px !important;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
      border: 1px solid rgba(0,0,0,0.08) !important;
      overflow: hidden;
      pointer-events: auto !important;
      z-index: 1001 !important;
    }

    .maplibregl-ctrl-group button {
      width: 38px !important;
      height: 38px !important;
      border: none !important;
      background: white !important;
      transition: all 0.2s ease !important;
      pointer-events: auto !important;
    }

    .maplibregl-ctrl-group button:hover {
      background: #f8fafc !important;
    }

    .maplibregl-ctrl-group button:not(:last-child) {
      border-bottom: 1px solid rgba(0,0,0,0.08) !important;
    }

    .map-footer {
      position: absolute;
      right: 10px;
      bottom: 8px;
      font-size: 12px;
      color: #444;
      background: rgba(255,255,255,0.8);
      padding: 2px 6px;
      border-radius: 4px;
      z-index: 2;
      user-select: none;
      font-family: 'Inter', sans-serif;
    }

    .menu-open .map-footer { pointer-events: none; }

    .maplibregl-popup-content {
      font-size: 13px;
      line-height: 1.4;
      background: transparent !important;
      border-radius: 0 !important;
      padding: 0 !important;
      color: #222;
      box-shadow: none !important;
      font-weight: 500;
      text-align: center;
      font-family: 'Inter', sans-serif;
    }

    .maplibregl-popup-tip {
      display: none !important;
    }

    /* Ensure popups work properly */
    .maplibregl-popup {
      pointer-events: auto !important;
    }

    .marine-sighting-popup .maplibregl-popup-content {
      pointer-events: auto !important;
    }

    .hamburger-menu {
      width: 40px;
      height: 40px;
      background: none;
      border: none;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 3px;
      margin-left: 8px;
      transition: all 0.15s cubic-bezier(0.4,0,0.2,1);
      flex-shrink: 0;
    }

    .hamburger-menu:hover {
      background-color: rgba(60,64,67,0.08);
    }

    .hamburger-menu:active {
      background-color: rgba(60,64,67,0.12);
      transform: scale(0.95);
    }

    .hamburger-menu span {
      width: 18px;
      height: 2px;
      background: #5f6368;
      border-radius: 1px;
      transition: all 0.2s ease;
    }

    .search-container {
      position: relative;
      display: flex;
      align-items: center;
      background: #fff;
      border-radius: 32px;
      box-shadow: 0 1px 6px rgba(32,33,36,.28);
      border: 1px solid transparent;
      min-width: 400px;
      height: 56px;
      transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    }

    .search-container:hover {
      box-shadow: 0 2px 8px rgba(32,33,36,.28);
    }

    .search-container:focus-within {
      box-shadow: 0 2px 8px rgba(32,33,36,.28);
      border-color: #4285f4;
      background: #fff;
    }

    #searchInput {
      border: none;
      outline: none;
      padding: 0 20px;
      font-size: 16px;
      flex: 1;
      background: transparent;
      font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
      color: #202124;
      height: 100%;
      font-weight: 400;
    }

    #searchInput::placeholder {
      color: #9aa0a6;
      font-weight: 400;
    }

    .search-btn {
      background: none;
      border: none;
      padding: 16px;
      cursor: pointer;
      color: #5f6368;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      margin-right: 8px;
      transition: all 0.15s cubic-bezier(0.4,0,0.2,1);
      flex-shrink: 0;
    }

    .search-btn:hover {
      background-color: rgba(60,64,67,0.08);
    }

    .search-btn:active {
      background-color: rgba(60,64,67,0.12);
      transform: scale(0.95);
    }

    .search-btn svg {
      width: 20px;
      height: 20px;
    }

    #map {
      width: 100%;
      height: 100%;
    }

    /* Search Results - FIXED VERSION */
    .search-results, #searchResults {
      position: absolute;
      top: calc(100% + 8px);  /* Increased gap from 4px to 8px */
      left: 0;
      right: 0;
      background: #fff;
      border-radius: 16px;  /* More rounded to match container */
      box-shadow: 0 4px 16px rgba(32,33,36,.28);  /* Consistent with container */
      border: 1px solid #dadce0;
      max-height: 320px;
      overflow-y: auto;
      display: none;
      z-index: 2000;
    }

    .search-results.visible,
    #searchResults.visible {
      display: block !important;
    }

    /* Autocomplete suggestion overlay */

    .search-autocomplete-overlay {
      position: absolute;
      left: 47px;
      top: 0;
      height: 100%;
      padding: 0 20px;
      font-size: 16px;
      font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
      color: #9aa0a6;
      pointer-events: none;
      display: flex;
      align-items: center;
      z-index: 1;
    }

    #searchInput {
      position: relative;
      z-index: 2;
      background: transparent;
    }

    .install-app-tooltip {
      position: fixed;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%) translateY(20px);
      z-index: 2000;
      pointer-events: none;
      opacity: 0;
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Hide on desktop - PWAs are primarily for mobile */
    @media (min-width: 769px) {
      .install-app-tooltip {
        display: none !important;
      }
    }

    .install-app-tooltip.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
      pointer-events: auto;
    }


    .install-tooltip-content {
      background: white;
      border-radius: 16px;
      box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.08);
      border: 1px solid rgba(0, 0, 0, 0.06);
      padding: 16px 20px;
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 280px;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      font-family: 'Inter', sans-serif;
    }

    .install-tooltip-content:hover {
      transform: translateY(-2px);
      box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .install-tooltip-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
      border-radius: 12px;
      color: white;
      flex-shrink: 0;
      box-shadow: 0 2px 8px rgba(54, 209, 220, 0.3);
    }

    .install-tooltip-text {
      flex: 1;
      min-width: 0;
    }

    .install-tooltip-title {
      font-size: 15px;
      font-weight: 600;
      color: #1e293b;
      line-height: 1.2;
      margin-bottom: 2px;
    }

    .install-tooltip-subtitle {
      font-size: 13px;
      color: #64748b;
      line-height: 1.3;
    }

    .install-tooltip-close {
      position: absolute;
      top: 8px;
      right: 8px;
      background: none;
      border: none;
      color: #9ca3af;
      cursor: pointer;
      padding: 4px;
      border-radius: 6px;
      transition: all 0.15s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
    }

    .install-tooltip-close:hover {
      background: #f3f4f6;
      color: #6b7280;
      transform: scale(1.1);
    }

    /* Mobile responsive */
    @media (max-width: 768px) {
      .install-app-tooltip {
        top: 8px !important;
        left: 16px !important;
        right: 16px !important;
        bottom: auto !important;
        transform: none !important;
      }
      
      .install-app-tooltip.show {
        transform: none !important;
      }
      
      .install-tooltip-content {
        min-width: auto;
        width: 100%;
        max-width: calc(100vw - 32px);
        padding: 14px 16px;
        border-radius: 12px;
      }
      
      .install-tooltip-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
      }
      
      .install-tooltip-title {
        font-size: 14px;
      }
      
      .install-tooltip-subtitle {
        font-size: 12px;
      }
    }

    /* Animation keyframes */
    @keyframes slideInFromRight {
      from {
        opacity: 0;
        transform: translateY(-10px) translateX(30px);
      }
      to {
        opacity: 1;
        transform: translateY(0) translateX(0);
      }
    }

    /* Pulse effect for the install icon */
    @keyframes installPulse {
      0%, 100% {
        box-shadow: 0 2px 8px rgba(54, 209, 220, 0.3);
      }
      50% {
        box-shadow: 0 2px 8px rgba(54, 209, 220, 0.5), 0 0 0 4px rgba(54, 209, 220, 0.1);
      }
    }

    .install-tooltip-content:hover .install-tooltip-icon {
      animation: installPulse 2s ease-in-out infinite;
    }

    /* Ultra-Clean Login Modal with Your Gradient */
    .login-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 10010;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, backdrop-filter 0.25s ease;
    }

    .login-modal[style*="display: flex"],
    .login-modal[style*="display:flex"] {
        opacity: 1;
        visibility: visible;
    }

    .login-modal-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        cursor: pointer;
    }

    .login-modal-content {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: 24px;
        width: 90%;
        max-width: 440px;
        padding: 56px 48px;
        box-shadow: 
            0 25px 50px -12px rgba(0, 0, 0, 0.25),
            0 0 0 1px rgba(255, 255, 255, 0.1),
            inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
        z-index: 10011;
        position: relative;
        transform: scale(0.95);
        transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .login-modal[style*="display: flex"] .login-modal-content,
    .login-modal[style*="display:flex"] .login-modal-content {
        transform: scale(1);
    }

    .login-modal-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: rgba(0, 0, 0, 0.04);
        border: none;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #6b7280;
        font-size: 26px;
        line-height: 1;
        border-radius: 50%;
        transition: all 0.2s ease;
        padding: 0;
    }

    .login-modal-close:hover {
        background: rgba(0, 0, 0, 0.08);
        color: #374151;
        transform: rotate(90deg);
    }

    .login-message {
        padding: 14px 18px;
        border-radius: 12px;
        margin-bottom: 28px;
        font-size: 14px;
        text-align: center;
        display: none;
        background: rgba(254, 243, 199, 0.9);
        color: #92400e;
        border: 1px solid rgba(251, 191, 36, 0.3);
    }

    .login-message:not(:empty) {
        display: block;
    }

    form[name="siteloklogin"] {
        padding: 0;
    }

    .login-form-group {
        margin-bottom: 18px;
    }

    .login-form-group input[type="text"],
    .login-form-group input[type="email"],
    .login-form-group input[type="password"] {
        width: 100%;
        padding: 18px 20px;
        font-size: 16px;
        border: 2px solid #e5e7eb;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.9);
        transition: all 0.2s ease;
        box-sizing: border-box;
        font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
        color: #111827;
    }

    .login-form-group input::placeholder {
        color: #9ca3af;
    }

    .login-form-group input:hover {
        border-color: #d1d5db;
    }

    .login-form-group input:focus {
        outline: none;
        border-color: #36d1dc;
        background: #ffffff;
        box-shadow: 0 0 0 4px rgba(54, 209, 220, 0.1);
    }

    .login-submit-btn {
        width: 100%;
        padding: 18px;
        font-size: 16px;
        font-weight: 600;
        color: #ffffff;
        background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
        border: none;
        border-radius: 16px;
        cursor: pointer;
        transition: all 0.2s ease;
        margin-bottom: 0px;
        font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
        box-shadow: 0 4px 14px rgba(54, 209, 220, 0.35);
    }

    .login-submit-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(54, 209, 220, 0.45);
    }

    .login-submit-btn:active {
        transform: translateY(0);
    }

    .login-form-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 14px;
    }

    .remember-checkbox {
        display: flex;
        align-items: center;
        cursor: pointer;
        color: #6b7280;
        user-select: none;
    }

    .remember-checkbox input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin: 0 8px 0 0;
        cursor: pointer;
        accent-color: #36d1dc;
    }

    .remember-checkbox span {
        font-weight: 400;
    }

    .forgot-link {
        color: #36d1dc;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.2s ease;
    }

    .forgot-link:hover {
        color: #5b86e5;
    }

    .create-account-btn {
        display: block;
        width: 100%;
        padding: 18px;
        font-size: 16px;
        font-weight: 600;
        color: #ffffff;
        background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
        border: none;
        border-radius: 16px;
        cursor: pointer;
        transition: all 0.2s ease;
        text-align: center;
        text-decoration: none;
        font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
        box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
        margin-bottom: 24px;
    }

    .create-account-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(6, 182, 212, 0.45);
    }

    .create-account-btn:active {
        transform: translateY(0);
    }

    /* Registration Password Requirements */
    #password-requirements {
        font-size: 12px;
        margin-top: 8px;
        line-height: 1.6;
        padding: 12px;
        background: rgba(243, 244, 246, 0.5);
        border-radius: 8px;
        border: 1px solid #e5e7eb;
    }

    #password-requirements > div {
        transition: color 0.2s ease;
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 4px 0;
    }

    #password-requirements > div::before {
        content: '';
        display: inline-block;
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: currentColor;
    }

    /* Mobile Responsive */
    @media (max-width: 768px) {
        .login-modal-content {
            width: 92%;
            max-width: none;
            padding: 44px 32px;
            border-radius: 20px;
        }
        
        .login-form-footer {
            flex-direction: column;
            align-items: flex-start;
            gap: 14px;
        }
    }


    /* Enhanced Install Modal Styles */
    .install-modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(8px);
      z-index: 10002;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      opacity: 0;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .install-modal-overlay.show {
      opacity: 1;
    }

    .install-modal-overlay.closing {
      opacity: 0;
      transform: scale(0.95);
    }

    .install-modal-content {
      background: white;
      border-radius: 20px;
      width: 100%;
      max-width: 420px;
      max-height: 90vh;
      overflow: hidden;
      box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.05);
      transform: scale(0.9) translateY(20px);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .install-modal-overlay.show .install-modal-content {
      transform: scale(1) translateY(0);
    }

    .install-modal-header {
      padding: 24px 24px 0;
      display: flex;
      align-items: flex-start;
      gap: 16px;
      position: relative;
    }

    .install-modal-icon {
      width: 48px;
      height: 48px;
      background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      flex-shrink: 0;
      box-shadow: 0 4px 12px rgba(54, 209, 220, 0.3);
    }

    .install-modal-title {
      font-size: 20px;
      font-weight: 700;
      color: #1e293b;
      margin: 0;
      line-height: 1.3;
      flex: 1;
      padding-top: 8px;
    }

    .install-modal-close {
      position: absolute;
      top: 0;
      right: 0;
      background: none;
      border: none;
      color: #9ca3af;
      cursor: pointer;
      padding: 8px;
      border-radius: 10px;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .install-modal-close:hover {
      background: #f3f4f6;
      color: #6b7280;
      transform: scale(1.1);
    }

    .install-modal-body {
      padding: 20px 24px;
    }

    .install-modal-instructions {
      font-size: 16px;
      color: #64748b;
      line-height: 1.6;
      margin: 0 0 24px 0;
    }

    .install-modal-steps {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .install-step {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 16px;
      background: #f8fafc;
      border-radius: 12px;
      border: 1px solid #e2e8f0;
    }

    .step-number {
      width: 32px;
      height: 32px;
      background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
      color: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      font-weight: 600;
      flex-shrink: 0;
    }

    .step-text {
      font-size: 15px;
      color: #475569;
      font-weight: 500;
    }

    .install-modal-footer {
      padding: 0 24px 24px;
      display: flex;
      justify-content: center;
      gap: 12px;
    }

    .install-modal-btn {
      flex: 1;
      padding: 14px 20px;
      border: none;
      border-radius: 12px;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .install-modal-btn-secondary {
      background: #f1f5f9;
      color: #64748b;
      border: 1px solid #e2e8f0;
    }

    .install-modal-btn-secondary:hover {
      background: #e2e8f0;
      color: #475569;
      transform: translateY(-1px);
    }

    .install-modal-btn-primary {
      background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
      color: white;
      box-shadow: 0 4px 12px rgba(54, 209, 220, 0.3);
    }

    .install-modal-btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(54, 209, 220, 0.4);
    }

    /* Mobile responsive adjustments */
    @media (max-width: 480px) {
      .install-modal-overlay {
        padding: 16px;
      }
      
      .install-modal-content {
        border-radius: 16px;
        max-width: none;
      }
      
      .install-modal-header {
        padding: 20px 20px 0;
        gap: 12px;
      }
      
      .install-modal-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
      }
      
      .install-modal-title {
        font-size: 18px;
        padding-top: 6px;
      }
      
      .install-modal-body {
        padding: 16px 20px;
      }
      
      .install-modal-instructions {
        font-size: 15px;
        margin-bottom: 20px;
      }
      
      .install-step {
        padding: 14px;
        gap: 12px;
      }
      
      .step-number {
        width: 28px;
        height: 28px;
        font-size: 13px;
      }
      
      .step-text {
        font-size: 14px;
      }
      
      .install-modal-footer {
        padding: 0 20px 20px;
        flex-direction: column;
      }
      
      .install-modal-btn {
        padding: 12px 18px;
        font-size: 15px;
      }
    }

    /* Additional styles for browser-specific steps */
.step-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 12px;
}

.step-icon {
  font-size: 20px;
  opacity: 0.8;
  flex-shrink: 0;
}

.install-step-fallback {
  background: #fef3f2;
  border: 1px solid #fecaca;
  text-align: center;
  flex-direction: column;
  gap: 12px;
  padding: 24px 16px;
}

.step-icon-large {
  font-size: 32px;
  margin-bottom: 8px;
}

.step-content-centered {
  text-align: center;
}

.step-text-large {
  font-size: 16px;
  font-weight: 600;
  color: #dc2626;
  margin-bottom: 4px;
}

.step-text-small {
  font-size: 14px;
  color: #7f1d1d;
  line-height: 1.4;
}

/* Enhanced step styling for better visual hierarchy */
.install-step {
  transition: all 0.2s ease;
}

.install-step:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(54, 209, 220, 0.15);
}

.step-number {
  box-shadow: 0 2px 4px rgba(54, 209, 220, 0.2);
}

/* Animation for steps appearing */
.install-modal-steps .install-step {
  opacity: 0;
  transform: translateY(10px);
  animation: stepFadeIn 0.3s ease forwards;
}

.install-modal-steps .install-step:nth-child(1) {
  animation-delay: 0.1s;
}

.install-modal-steps .install-step:nth-child(2) {
  animation-delay: 0.2s;
}

.install-modal-steps .install-step:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes stepFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile adjustments for new elements */
@media (max-width: 480px) {
  .step-content {
    gap: 8px;
  }
  
  .step-icon {
    font-size: 18px;
  }
  
  .step-icon-large {
    font-size: 28px;
  }
  
  .install-step-fallback {
    padding: 20px 12px;
  }
  
  .step-text-large {
    font-size: 15px;
  }
  
  .step-text-small {
    font-size: 13px;
  }
}

    /* ==========================================
   SETTINGS CONTROL & PANEL
   ========================================== */

    .settings-control {
      background: white;
      border-radius: 8px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
      border: 1px solid rgba(0,0,0,0.08);
      overflow: hidden;
      width: 38px;
      margin-bottom: -3px;
      margin-right: 1px;
    }

    .settings-btn {
      width: 37px;
      height: 37px;
      background: white;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      color: #5f6368;
    }

    .settings-btn:hover {
      background: #f8fafc;
    }

    .settings-btn.active {
      background: #e5e7eb;
      color: #374151;
    }

    .settings-panel {
      position: fixed;
      bottom: 35px;
      right: 60px;
      background: white;
      border-radius: 12px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.15);
      border: 1px solid rgba(0,0,0,0.08);
      width: 300px;
      max-height: 500px;
      overflow: hidden;
      display: none;
      flex-direction: column;
      contain: layout;
  isolation: isolate;
    }

    .settings-panel.active {
      display: flex;
      pointer-events: auto;
    }

    .settings-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px 20px;
      border-bottom: 1px solid #e5e7eb;
    }

    .settings-header h3 {
      margin: 0;
      font-size: 16px;
      font-weight: 600;
      color: #1e293b;
    }

    .settings-close {
      background: none;
      border: none;
      font-size: 24px;
      color: #64748b;
      cursor: pointer;
      width: 28px;
      height: 28px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
      transition: all 0.2s;
    }

    .settings-close:hover {
      background: #f1f5f9;
      color: #1e293b;
    }

    .settings-content {
      padding: 16px;
      overflow-y: auto;
      max-height: 450px;
    }

    .settings-section {
      margin-bottom: 20px;
    }

    .settings-section:last-child {
      margin-bottom: 0;
    }

    .settings-section-title {
      font-size: 13px;
      font-weight: 600;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 12px;
    }

    .settings-options {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .settings-option {
      padding: 10px 16px;
      background: #f8fafc;
      border: 2px solid transparent;
      border-radius: 8px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      color: #475569;
      transition: all 0.2s;
    }

    .settings-option:hover {
      background: #f1f5f9;
    }

    .settings-option.active {
      background: #e0f2fe;
      border-color: #0284c7;
      color: #0284c7;
    }

    .settings-toggle-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 0;
      font-size: 14px;
      color: #1e293b;
    }

    /* Toggle Switch */
    .toggle-switch {
      position: relative;
      display: inline-block;
      width: 44px;
      height: 24px;
      contain: layout style paint;
  will-change: auto;
    }

    .toggle-switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .toggle-slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #cbd5e1;
      border-radius: 24px;
      contain: layout style paint;
    }

    .toggle-slider:before {
      position: absolute;
      content: "";
      height: 18px;
      width: 18px;
      left: 3px;
      bottom: 3px;
      background-color: white;
      border-radius: 50%;
    }

    .toggle-switch input:checked + .toggle-slider {
      background-color: #0284c7;
    }

    .toggle-switch input:checked + .toggle-slider:before {
      transform: translateX(20px);
    }

    .settings-action-btn {
      width: 100%;
      padding: 12px 16px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      color: #475569;
      display: flex;
      align-items: center;
      gap: 8px;
      justify-content: center;
      transition: all 0.2s;
    }

    .settings-action-btn:hover {
      background: #f1f5f9;
      border-color: #cbd5e1;
    }

    /* ==========================================
    TOURS MODAL (PRO only)
    ========================================== */

    .tours-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 10000;
        backdrop-filter: blur(4px);
    }

    .tours-modal.active {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tours-modal-content {
        background: white;
        border-radius: 12px;
        width: 90%;
        max-width: 320px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }

    .tours-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid #e2e8f0;
    }

    .tours-modal-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: #1e293b;
    }

    .tours-modal-close {
        background: none;
        border: none;
        font-size: 24px;
        color: #64748b;
        cursor: pointer;
        padding: 0;
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        transition: all 0.2s;
    }

    .tours-modal-close:hover {
        background: #f1f5f9;
        color: #1e293b;
    }

    .tours-modal-body {
        padding: 16px;
    }

    .tours-modal-body .settings-action-btn {
        margin-bottom: 8px;
    }

    .tours-modal-body .settings-action-btn:last-child {
        margin-bottom: 0;
    }

    /* ==========================================
      LEGEND MODAL
      ========================================== */

    .legend-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.5);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 10010;
      box-sizing: border-box;
      overflow: hidden;
    }

    .legend-modal.active {
      display: flex;
    }

    .legend-modal-content {
      background: white;
      border-radius: 12px;
      width: 90%;
      max-width: 500px;
      max-height: calc(100% - 40px);
      overflow: auto;
      display: flex;
      flex-direction: column;
      box-shadow: 0 20px 60px rgba(0,0,0,0.3);
      padding: 20px;
      box-sizing: border-box;
    }


    .legend-modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20px 24px;
      border-bottom: 1px solid #e5e7eb;
    }

    .legend-modal-header h3 {
      margin: 0;
      font-size: 18px;
      font-weight: 600;
      color: #1e293b;
    }

    .legend-modal-close {
      background: none;
      border: none;
      font-size: 28px;
      color: #64748b;
      cursor: pointer;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
      transition: all 0.2s;
    }

    .legend-modal-close:hover {
      background: #f1f5f9;
      color: #1e293b;
    }

    .legend-modal-body {
      padding: 24px;
      overflow-y: auto;
    }

    .legend-category {
      margin-bottom: 28px;
    }

    .legend-category:last-child {
      margin-bottom: 0;
    }

    .legend-category h4 {
      margin: 0 0 16px 0;
      font-size: 14px;
      font-weight: 600;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .legend-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 12px;
      border-radius: 8px;
      transition: background 0.2s;
      margin-bottom: 8px;
    }

    .legend-item:hover {
      background: #f8fafc;
    }

    .legend-item img {
      flex-shrink: 0;
      margin-top: 2px;
    }

    .legend-item-text {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .legend-item-text strong {
      font-size: 14px;
      font-weight: 600;
      color: #1e293b;
    }

    .legend-item-text span {
      font-size: 13px;
      color: #64748b;
      line-height: 1.4;
    }
      
      .legend-modal-content {
        width: 95%;
        max-height: 90vh;
      }

    /* Zoom Controls */
    .modern-nav-control {
      background: white;
      border-radius: 8px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
      border: 1px solid rgba(0,0,0,0.08);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      margin-bottom: 20px;
    }

    .modern-nav-btn {
      width: 38px;
      height: 38px;
      background: white;
      border: none;
      cursor: pointer;
      font-size: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      user-select: none;
      margin: 0;
      color: #5f6368;
      outline: none;
    }

    .modern-nav-btn:hover {
      background: #f8fafc;
    }

    .modern-nav-btn:active {
      background: #e5e7eb;
      transform: scale(0.98);
    }

    .modern-nav-btn:not(:last-child) {
      border-bottom: 1px solid rgba(0,0,0,0.08);
    }

    .modern-nav-btn svg {
      display: block;
      margin: 0 auto;
    }

    /* ==========================================
      ROBUST MOBILE BOTTOM CONTROLS SOLUTION
      ========================================== */

    /* Reset and base setup */
    html, body {
      margin: 0;
      padding: 0;
      height: 100%;
      width: 100%;
      overflow: hidden;
      font-family: 'Inter', sans-serif;
      font-size: 14px;
    }

    .map-container {
      position: fixed;
      inset: 0;
      overflow: hidden;
      width: 100%;
      height: 100%;
      z-index: 1;
    }

    #map {
      width: 100%;
      height: 100%;
    }

    /* ==========================================
      BOTTOM CONTROLS - MOBILE FIRST APPROACH
      ========================================== */

    .map-controls {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      pointer-events: none;
      z-index: 1000;
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      
      /* Base padding for desktop */
      padding: 20px;
      padding-bottom: 20px;
      
      /* Use safe area insets for mobile devices */
      padding-bottom: max(20px, env(safe-area-inset-bottom));
      padding-left: max(20px, env(safe-area-inset-left));
      padding-right: max(20px, env(safe-area-inset-right));
      
      /* Minimum height to prevent cramping */
      min-height: 80px;
      
      /* Ensure controls stay above bottom browser bars */
      transform: translateY(0);
    }

    /* Mobile-specific adjustments */
    @media (max-width: 768px) {
      .map-controls {
        padding-bottom: max(env(safe-area-inset-bottom), 20px);
        padding-left: max(env(safe-area-inset-left), 15px);
        padding-right: max(env(safe-area-inset-right), 15px);
        padding-top: 15px;
        min-height: 80px;
      }
    }

    /* PWA-specific styles (when running as standalone app) */
    @media (display-mode: standalone) {
      .map-controls {
        /* PWA has more predictable safe areas */
        padding-bottom: max(env(safe-area-inset-bottom), 40px);
      }
    }

    /* iPhone-specific handling */
    @supports (-webkit-touch-callout: none) {
      .map-controls {
        /* Extra padding for iOS devices */
        padding-bottom: max(env(safe-area-inset-bottom), 70px);
      }
      
      @media (max-width: 768px) and (orientation: portrait) {
        .map-controls {
          padding-bottom: max(env(safe-area-inset-bottom), 85px);
        }
      }
    }

    /* ==========================================
      CONTROL GROUPS POSITIONING
      ========================================== */

    .controls-bottom-left,
    .controls-bottom-right {
      pointer-events: auto;
      display: flex;
      flex-direction: column;
      gap: 10px;
      align-items: flex-start;
      max-height: 60vh;
      overflow: visible;
      transition: none !important;
    }

    .controls-bottom-right {
      align-items: flex-end;
      position: absolute;
      bottom: 17px;
      right: 10px;
        }

    .controls-bottom-left {
      position: absolute;
      bottom: 20px;
      left: 20px;
    }

    /* ==========================================
      SEARCH CONTROLS - TOP POSITIONING
      ========================================== */

    .search-menu-controls {
      position: absolute;
      top: 20px;
      left: 20px;
      z-index: 1000;
      
      /* Safe area adjustments for top */
      top: max(20px, env(safe-area-inset-top));
      left: max(20px, env(safe-area-inset-left));
    }

    @media (max-width: 768px) {
      .search-menu-controls {
        top: max(16px, env(safe-area-inset-top));
        left: max(16px, env(safe-area-inset-left));
        right: max(16px, env(safe-area-inset-right));
      }
      
      .search-container {
        min-width: auto;
        width: 100%;
        height: 50px; /* Slightly smaller on mobile */
      }
      
      #searchInput {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0 16px;
      }
    }

    /* ==========================================
      UTILITY CLASSES FOR DEBUGGING
      ========================================== */

    /* Add this class to .map-controls for debugging */
    .debug-controls {
      background: rgba(255, 0, 0, 0.2) !important;
      border: 2px solid red !important;
    }

    /* Add this class to body for safe area visualization */
    .debug-safe-areas::before {
      content: '';
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      pointer-events: none;
      z-index: 9999;
      border-top: env(safe-area-inset-top) solid rgba(0, 255, 0, 0.3);
      border-bottom: env(safe-area-inset-bottom) solid rgba(0, 255, 0, 0.3);
      border-left: env(safe-area-inset-left) solid rgba(0, 255, 0, 0.3);
      border-right: env(safe-area-inset-right) solid rgba(0, 255, 0, 0.3);
    }

    /* ==========================================
      LANDSCAPE ORIENTATION ADJUSTMENTS
      ========================================== */

    @media (max-width: 768px) and (orientation: landscape) {
      .map-controls {
        /* Reduce padding in landscape to save space */
        padding-bottom: max(env(safe-area-inset-bottom), 40px);
        min-height: 70px;
      }
      
      .search-menu-controls {
        top: max(12px, env(safe-area-inset-top));
      }
      
      .search-container {
        height: 44px; /* Smaller in landscape */
      }
    }

    /* ==========================================
      FALLBACK FOR OLDER BROWSERS
      ========================================== */

    /* Fallback for browsers that don't support env() */
    @supports not (padding: max(0px, env(safe-area-inset-bottom))) {
      @media (max-width: 768px) {
        .map-controls {
          padding-bottom: 80px; /* Fixed fallback value */
        }
        
        .search-menu-controls {
          top: 20px;
        }
      }
    }

    /* Premium Button */
    .menu-item.premium-item {
      margin-top: auto;
      margin-bottom: 20px;
      margin-left: 16px;
      margin-right: 16px;
      border-radius: 12px;
      background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
      color: white;
      font-weight: 600;
      border: none;
      border-bottom: none;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      overflow: hidden; /* Contain any visual effects */
      position: relative;
    }

    .menu-item.premium-item:hover {
      background: linear-gradient(135deg, #2dd4da 0%, #4c63d2 100%);
      color: white;
      transform: translateY(-1px);
      box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    }

    /* Remove the separator line for premium item */
    .menu-item.premium-item {
      border-bottom: none;
    }

    /* Premium item shine effect */
    .menu-item.premium-item::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
      transition: left 0.5s ease;
    }

    .menu-item.premium-item:hover::before {
      left: 100%;
    }

    /* Premium icon styling */
    .menu-item.premium-item img {
      filter: brightness(0) invert(1); /* Make icon white */
    }

    /* Crown or star icon for premium */
    .premium-icon {
      position: relative;
    }

    .premium-icon::after {
      content: '👑';
      position: absolute;
      top: -2px;
      right: -2px;
      font-size: 12px;
    }

    /* Mobile responsive adjustments */
    @media (max-width: 768px) {
      .menu-item.premium-item {
        margin: 8px 12px 12px 12px;
        padding: 14px 16px;
      }
    }

    /* Subtle gradient background for the entire menu */
    .side-panel-content {
      background: linear-gradient(180deg, #fafafa 0%, #f8fafc 100%);
    }

    .side-panel {
      position: fixed;
      top: 0;
      left: -280px;
      width: 280px;
      height: 100%;
      background: white;
      box-shadow: 2px 0 12px rgba(0,0,0,0.15);
      z-index: 5000;
      transition: left 0.3s ease;
      display: flex;
      flex-direction: column;
      isolation: isolate;
    }

    .side-panel.open {
      left: 0;
      z-index: 5000; /* Ensure it stays on top when open */
    }

    .side-panel-header {
      padding: 24px 20px;
      border-bottom: 1px solid #e5e7eb;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #f8fafc;
    }

    .side-panel-header h3 {
      margin: 0;
      font-size: 20px;
      font-weight: 600;
      color: #1e293b;
    }

    .close-panel {
      background: none;
      border: none;
      font-size: 24px;
      cursor: pointer;
      color: #64748b;
      padding: 4px;
      border-radius: 4px;
      transition: all 0.2s ease;
    }

    .close-panel:hover {
      background: #e2e8f0;
      color: #1e293b;
    }

    .side-panel-content {
      flex: 1;
      padding: 0;
      display: flex;
      flex-direction: column;
      height: 100%;
      min-height: 0;
    }

    .menu-item {
      display: block;
      padding: 16px 20px;
      text-decoration: none;
      color: #374151;
      font-size: 16px;
      transition: all 0.2s ease;
      border-bottom: 1px solid #f1f5f9;
      position: relative;
    }

    .menu-item:hover {
      background: #f8fafc;
      color: #1e293b;
    }

    .side-panel-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.5);
      z-index: 1400;
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease, visibility 0.3s ease; 
    }

    .side-panel-overlay.active {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    .search-result-item {
      padding: 16px 20px;
      cursor: pointer;
      border-bottom: 1px solid #f1f3f4;
      transition: background-color 0.1s cubic-bezier(0.4,0,0.2,1);
      font-size: 16px; 
      color: #202124;
      display: flex;
      align-items: center;
      font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif; 
      min-height: 48px;
      font-weight: 400;
}

    .search-result-item:hover {
      background-color: #f8f9fa;
    }

    .search-result-item:first-child {
      border-radius: 16px 16px 0 0;  /* Rounded top corners */
    }

    .search-result-item:last-child {
      border-bottom: none;
      border-radius: 0 0 16px 16px;  /* Rounded bottom corners */
    }

    .search-results::-webkit-scrollbar {
        width: 6px;
      }

      .search-results::-webkit-scrollbar-thumb {
        background: #dadce0;
        border-radius: 3px;
      }

      .search-results::-webkit-scrollbar-thumb:hover {
        background: #bdc1c6;
      }
      
      .side-panel {
        width: 280px;
      }
    
    /* Desktop and Tablet Menu Behavior (screens larger than 768px) */
    @media (min-width: 769px) {
      .side-panel {
        left: 0 !important; /* Menu visible by default */
        transition: left 0.3s ease;
        width: 280px;
        z-index: 5000; /* Ensure menu is above map */
      }
      
      .side-panel.closed {
        left: -280px !important; /* Hidden when closed */
      }
      
      /* No overlay needed on desktop/tablet when menu is open by default */
      .side-panel-overlay {
        display: none;
      }
      
      /* Keep map full width */
      .map-container {
        margin-left: 0 !important;
        transition: none;
      }
      
      .map-container.menu-closed {
        margin-left: 0 !important;
      }
      
      /* Push search bar right when menu is open */
      .search-menu-controls {
        margin-left: 300px; /* 280px menu + 20px gap */
        transition: margin-left 0.3s ease;
      }
      
      /* Search bar in center when menu is closed */
      .search-menu-controls.menu-closed {
        margin-left: 20px; /* Normal position */
      }
    }

    /* Drawing Controls - Premium Page */
    .custom-draw-control {
      z-index: 150;
      margin-bottom: -3px;
      margin-right: 1px;
    }

.draw-control-group {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 38px;
}

.draw-toggle-btn {
  width: 37px;
  height: 37px;
  background: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
  margin: 0;
}

.draw-toggle-btn:hover {
  background: #f8fafc;
}

.draw-toggle-btn.active {
  background: #e5e7eb;
  color: #374151;
}

/* Drawing Controls Panel - positioned to the left of draw button */
.draw-controls-panel {
  position: fixed;
  bottom: 35px;
  right: 60px; /* 20px margin + 38px button + 20px gap */
  z-index: 150;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: 1px solid #e2e8f0;
  padding: 12px;
  font-family: 'Inter', sans-serif;
  display: none;
  flex-direction: column;
  gap: 8px;
  width: 150px;
  max-width: 150px;
}

.draw-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin: 0;
  background: #f8fafc;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
  text-align: center;
}

.draw-btn:hover {
  background: #f1f5f9;
}

.draw-btn.active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0284c7;
}

.measure-display {
  position: absolute;
  top: 80px;
  left: 10px;
  z-index: 15;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.25);
  padding: 10px 15px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  min-width: 240px;
  display: none;
}

.measure-item {
  margin: 3px 0;
  font-weight: 500;
}

.measure-label {
  color: #666;
  font-weight: 400;
}

.segment-label {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #1e293b;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  backdrop-filter: blur(16px);
  min-width: 45px;
  text-align: center;
  line-height: 1.4;
}

.segment-label .distance {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  display: block;
  margin-bottom: 2px;
}

.segment-label .bearing {
  font-size: 15px;
  color: #64748b;
  font-weight: 500;
  display: block;
  opacity: 0.9;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .draw-controls-panel {
    /* Keep existing positioning for the panel that pops out */
    bottom: 35px;
    right: 60px;
  }
}

    /* =========================
      POPUP STYLES - ADD THIS
      ========================= */
    .feature-popup {
        position: fixed;
        background: white;
        border-radius: 16px;
        box-shadow: 
            0 25px 50px rgba(0, 0, 0, 0.25),
            0 10px 20px rgba(0, 0, 0, 0.1);
        z-index: 10001;
        overflow: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        font-size: 16px;
        line-height: 1.5;
        backdrop-filter: blur(10px);
        pointer-events: auto;
    }

    @media (max-width: 768px) {
        .feature-popup {
            bottom: 0;
            left: 0;
            right: 0;
            max-height: 80vh;
            border-radius: 24px 24px 0 0;
            transform: translateY(100%);
            pointer-events: none;
        }
        .feature-popup.active {
            transform: translateY(0);
            pointer-events: auto;
        }
    }

    @media (min-width: 769px) {
        .feature-popup {
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.9);
            opacity: 0;
            width: 500px;
            max-height: 55vh;
            border: 1px solid rgba(0, 0, 0, 0.1);
            pointer-events: none;
        }
        .feature-popup.active {
            transform: translate(-50%, -50%) scale(1);
            opacity: 1;
            pointer-events: auto;
        }
    }

    .popup-header {
        background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
        color: white;
        padding: 20px;
        position: relative;
    }

    .popup-title {
        font-size: 20px;
        font-weight: 600;
        margin: 0;
        padding-right: 40px;
    }

    .popup-close {
        position: absolute;
        top: 16px;
        right: 16px;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: white;
        font-size: 18px;
        transition: background 0.2s;
    }

    .popup-close:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .popup-content {
        padding: 0;
        max-height: calc(80vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    @media (min-width: 769px) {
        .popup-content {
            max-height: calc(55vh - 80px);
        }
    }

    .feature-grid {
        display: grid;
        gap: 0;
    }

    .feature-item {
        border-bottom: 1px solid #f0f0f0;
        padding: 16px 20px;
        transition: background 0.2s;
    }

    .feature-item:last-child {
        border-bottom: none;
    }

    .feature-item:hover {
        background: #f8f9fa;
    }

    .feature-label {
        font-weight: 600;
        color: #374151;
        margin-bottom: 4px;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .feature-value {
        color: #4b5563;
        font-size: 16px;
        line-height: 1.7;
        word-wrap: break-word;
    }

    .feature-item.long-content {
        padding: 20px;
    }

    .feature-item.long-content .feature-value {
        font-size: 16px;
        line-height: 1.7;
        word-wrap: break-word;
    }

    .popup-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 10000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.5s ease;
        pointer-events: none;
        backdrop-filter: blur(8px) saturate(150%); /* Stronger blur + color enhancement */
        -webkit-backdrop-filter: blur(8px) saturate(150%);
    }

    .popup-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .popup-content::-webkit-scrollbar {
        width: 6px;
    }

    .popup-content::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .popup-content::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }

    .popup-content::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

    /* Modern button styles */
    .modern-btn {
    background: linear-gradient(135deg, #FF9A8B 0%, #FFB38A 100%);
    box-shadow: 0 2px 8px rgba(255, 154, 86, 0.3);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

    .modern-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }

    .modern-btn-small {
    padding: 6px 12px;
    font-size: 13px;
    }

    /* Top Right Menu */
    .top-menu {
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 1000;
      display: flex;
      align-items: center;
      gap: 4px;
      background: linear-gradient(135deg, rgba(79, 217, 220, 0.95) 0%, rgba(79, 217, 220, 0.85) 100%);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border-radius: 20px;
      padding: 6px 12px;
      box-shadow: 0 4px 16px rgba(79, 217, 220, 0.25);
      border: 1px solid rgba(255, 255, 255, 0.3);
      transition: all 0.3s ease;
    }

    .top-menu:hover {
      transform: translateY(-1px);
      box-shadow: 0 6px 20px rgba(79, 217, 220, 0.35);
    }

    .menu-btn {
      background: none;
      border: none;
      color: white;
      padding: 8px 12px;
      border-radius: 16px;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 14px;
      font-weight: 600;
      font-family: 'Inter', sans-serif;
    }

    .menu-btn:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: scale(1.02);
    }

    .menu-icon {
      font-size: 16px;
    }

    .menu-label {
      font-size: 13px;
    }

    /* Mobile responsive */
    @media (max-width: 768px) {
      .top-menu {
        padding: 4px 8px;
        gap: 2px;
      }
      
      .menu-btn {
        padding: 6px 8px;
        gap: 4px;
      }
      
      .menu-label {
        display: none;
      }
      
      .menu-icon {
        font-size: 18px;
      }
    }

    /* Message delete styling */
    .message-actions {
      font-size: 11px;
      color: #94a3b8;
      margin-left: 8px;
    }

    .message-actions a {
      color: #94a3b8;
      text-decoration: none;
      cursor: pointer;
    }

    .message-actions a:hover {
      color: #ef4444;
      text-decoration: underline;
    }

    /* ==========================================
      DIVE CONNECT FEED STYLES
      ========================================== */

    /* Feed Modal */
    #dive-connect-modal {
      z-index: 10002 !important;
    }

    #dive-connect-modal .modal-content {
      overflow-y: hidden !important;
    }

    #dive-connect-modal .modal-body {
      overflow: visible !important;
    }

    /* Feed Layout */
    .feed-composer {
      background: white;
      border-radius: 12px;
      padding: 16px;
      margin-bottom: 16px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .composer-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 12px;
    }

    .user-badge {
      font-weight: 600;
      color: #1e293b;
      padding: 4px 8px;
      background: #f1f5f9;
      border-radius: 6px;
      font-size: 14px;
    }

    .user-badge.pro-badge {
      background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
      color: white;
    }

    .composer-body {
      width: 100%;
    }

    .post-input {
      width: 100%;
      min-height: 80px;
      padding: 12px;
      border: 2px solid #e2e8f0;
      border-radius: 8px;
      font-size: 14px;
      font-family: inherit;
      resize: vertical;
      box-sizing: border-box;
    }

    .post-input:focus {
      outline: none;
      border-color: #10b981;
      box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    }

    .composer-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 12px;
      gap: 8px;
    }

    /* Feed Buttons */
    .feed-btn {
      background: #e2e8f0;
      color: #475569;
      border: none;
      padding: 8px 16px;
      border-radius: 6px;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;
      font-family: inherit;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .feed-btn:hover {
      background: #cbd5e1;
      transform: translateY(-1px);
    }

    .feed-btn-primary {
      background: linear-gradient(135deg, #10b981 0%, #059669 100%);
      color: white;
    }

    .feed-btn-primary:hover {
      background: linear-gradient(135deg, #059669 0%, #047857 100%);
      box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }

    .feed-btn-secondary {
      background: #f8fafc;
      color: #64748b;
      border: 1px solid #e2e8f0;
    }

    .feed-btn-secondary:hover {
      background: #f1f5f9;
      border-color: #cbd5e1;
    }

    .feed-btn-small {
      padding: 6px 12px;
      font-size: 12px;
    }

    .feed-btn-icon {
      padding: 6px 10px;
    }

    /* Photo Preview */
    .photo-preview {
      margin-top: 12px;
      padding: 12px;
      background: #f8fafc;
      border-radius: 8px;
      border: 2px dashed #cbd5e1;
    }

    .preview-image {
      position: relative;
      display: inline-block;
      margin-bottom: 8px;
    }

    .preview-image img {
      max-width: 200px;
      max-height: 150px;
      border-radius: 6px;
      object-fit: cover;
    }

    .remove-photo {
      position: absolute;
      top: -8px;
      right: -8px;
      background: #ef4444;
      color: white;
      border: none;
      width: 24px;
      height: 24px;
      border-radius: 50%;
      font-size: 16px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .caption-input {
      width: 100%;
      padding: 8px;
      border: 1px solid #e2e8f0;
      border-radius: 4px;
      font-size: 13px;
      box-sizing: border-box;
    }

    /* Feed Posts */
    .feed-post {
      background: white;
      border-radius: 12px;
      padding: 20px;
      margin-bottom: 16px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      transition: all 0.2s ease;
    }

    .feed-post:hover {
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    }

    .post-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 12px;
    }

    .post-author {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .author-name {
      font-weight: 600;
      color: #1e293b;
      font-size: 15px;
    }

    .author-name.pro-user {
      color: #f59e0b;
    }

    .pro-badge-small {
      background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
      color: white;
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .post-time {
      color: #64748b;
      font-size: 13px;
    }

    .post-content {
      margin-bottom: 16px;
    }

    .post-photo {
      margin-bottom: 12px;
    }

    .post-photo img {
      width: 100%;
      max-height: 400px;
      object-fit: cover;
      border-radius: 8px;
      cursor: pointer;
      transition: transform 0.2s ease;
    }

    .post-photo img:hover {
      transform: scale(1.02);
    }

    .photo-caption {
      margin: 8px 0 0 0;
      color: #64748b;
      font-size: 14px;
      font-style: italic;
    }

    .post-text {
      color: #374151;
      line-height: 1.6;
      font-size: 15px;
      margin: 0;
    }

    /* Post Actions */
    .post-actions {
      display: flex;
      gap: 16px;
      align-items: center;
      padding-top: 12px;
      border-top: 1px solid #f1f5f9;
    }

    .action-btn {
      background: none;
      border: none;
      color: #64748b;
      cursor: pointer;
      padding: 6px 12px;
      border-radius: 6px;
      font-size: 14px;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s ease;
    }

    .action-btn:hover {
      background: #f8fafc;
      color: #374151;
    }

    .action-btn.liked {
      color: #ef4444;
    }

    .action-display {
      color: #64748b;
      font-size: 14px;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .upgrade-hint {
      color: #94a3b8;
      font-size: 12px;
      font-style: italic;
      margin-left: auto;
    }

    .upgrade-hint a {
      color: #10b981;
      text-decoration: none;
    }

    /* Comments Section */
    .post-comments {
      margin-top: 16px;
      padding-top: 16px;
      border-top: 1px solid #f1f5f9;
    }

    .comment {
      padding: 8px 0;
      border-bottom: 1px solid #f8fafc;
    }

    .comment:last-child {
      border-bottom: none;
    }

    .comment-author {
      font-weight: 600;
      color: #374151;
      font-size: 13px;
      margin-right: 8px;
    }

    .comment-author.pro-user {
      color: #f59e0b;
    }

    .comment-text {
      color: #4b5563;
      font-size: 14px;
    }

    .comment-time {
      color: #9ca3af;
      font-size: 12px;
      float: right;
    }

    .comment-composer {
      display: flex;
      gap: 8px;
      margin-top: 12px;
    }

    .comment-input {
      flex: 1;
      padding: 8px 12px;
      border: 1px solid #e2e8f0;
      border-radius: 6px;
      font-size: 13px;
    }

    .comment-input:focus {
      outline: none;
      border-color: #10b981;
    }

    /* Viewer Notice (for FREE users) */
    .feed-viewer-notice {
      background: white;
      border-radius: 12px;
      padding: 16px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .viewer-info {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 12px;
    }

    .upgrade-notice {
      background: #fef3c7;
      padding: 12px;
      border-radius: 8px;
      border-left: 4px solid #f59e0b;
    }

    .upgrade-notice p {
      margin: 0;
      color: #92400e;
      font-size: 14px;
    }

    .upgrade-link {
      color: #10b981;
      text-decoration: none;
      font-weight: 600;
    }

    .upgrade-link:hover {
      text-decoration: underline;
    }

    /* Nickname Setup */
    .nickname-setup {
      text-align: center;
      padding: 20px;
    }

    .nickname-input {
      padding: 12px 16px;
      border: 2px solid #e2e8f0;
      border-radius: 8px;
      font-size: 16px;
      margin: 0 8px;
      width: 200px;
      font-family: inherit;
    }

    .nickname-input:focus {
      outline: none;
      border-color: #10b981;
      box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    }

    /* Photo Modal */
    .photo-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.9);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10003;
      cursor: pointer;
    }

    .photo-modal-content {
      position: relative;
      max-width: 90vw;
      max-height: 90vh;
    }

    .photo-modal-content img {
      max-width: 100%;
      max-height: 100%;
      border-radius: 8px;
    }

    .photo-modal-close {
      position: absolute;
      top: -10px;
      right: -10px;
      background: white;
      border: none;
      border-radius: 50%;
      width: 30px;
      height: 30px;
      font-size: 18px;
      cursor: pointer;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    /* Responsive Design */
    @media (min-width: 769px) {
      #dive-connect-modal .modal-content {
        max-width: 600px !important;
        height: 80vh !important;
        max-height: 700px !important;
      }
      
      #dive-connect-feed {
        height: calc(80vh - 200px) !important;
        overflow-y: auto !important;
      }
    }

    @media (max-width: 768px) {
      #dive-connect-modal .modal-content {
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        display: flex !important;
        flex-direction: column !important;
      }
      
      #dive-connect-modal .modal-header {
        flex-shrink: 0 !important;
      }
      
      #dive-connect-modal .modal-body {
        flex: 1 !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        overflow: hidden !important;
      }
      
      #dive-connect-feed {
        flex: 1 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
      }
      
      #dive-connect-input {
        flex-shrink: 0 !important;
      }
    }

    /* Scrollbar Styling */
    #dive-connect-feed::-webkit-scrollbar {
      width: 6px;
    }

    #dive-connect-feed::-webkit-scrollbar-track {
      background: #f1f1f1;
    }

    #dive-connect-feed::-webkit-scrollbar-thumb {
      background: #c1c1c1;
      border-radius: 3px;
    }

    /* Buddy notice styling - centered announcement */
    .buddy-notice {
      display: flex;
      justify-content: center;
      margin: 16px 0;
      padding: 0 20px;
    }

    .buddy-notice-content {
      background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
      border: 2px solid #f59e0b;
      border-radius: 12px;
      padding: 16px 20px;
      text-align: center;
      max-width: 80%;
      box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
    }

    .buddy-notice-text {
      font-size: 15px;
      font-weight: 600;
      color: #92400e;
      margin-bottom: 6px;
      line-height: 1.4;
    }

    .buddy-notice-time {
      font-size: 12px;
      color: #a16207;
      opacity: 0.8;
    }

    .buddy-suggestions {
    margin-top: 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    }

    .suggestion-btn {
        background: rgba(255, 255, 255, 0.8);
        border: 1px solid #f59e0b;
        border-radius: 16px;
        padding: 4px 10px;
        font-size: 12px;
        cursor: pointer;
        transition: all 0.2s;
        color: #92400e;
        font-weight: 500;
    }

    .suggestion-btn:hover {
        background: white;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
    }

    /* Mobile responsive */
    @media (max-width: 768px) {
      .buddy-notice-content {
        max-width: 90%;
        padding: 12px 16px;
      }
      
      .buddy-notice-text {
        font-size: 14px;
      }
    }

    /* Shimmer loading animation */
    .shimmer-line {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: shimmer 1.5s infinite;
        border-radius: 4px;
        display: inline-block;
    }

    @keyframes shimmer {
        0% { background-position: -200% 0; }
        100% { background-position: 200% 0; }
    }

    .condition-stat.shimmer {
        background: #f8f9fa;
        border: 1px solid #e9ecef;
    }

    /* Latest conditions in popup */
    .latest-conditions-container {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    border: 1px solid #e0f2fe;
    }

    #latest-condition-display {
        min-height: 90px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .conditions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    }

    .conditions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    font-size: 13px;
    }

    .condition-stat {
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .condition-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
    }

    .condition-value {
    font-size: 16px;
    font-weight: bold;
    color: #1e40af;
    }

   /* Universal condition colors - Keep existing colors, fix yellow and orange text */
.swell-low,
.visibility-good,
.temp-hot,
.condition-stat.swell-low,
.condition-stat.visibility-good,
.condition-stat.temp-hot { 
  background-color: #e6f4ea !important; 
  color: #137333 !important;  /* Keep existing green */
}

.swell-medium,
.visibility-fair,
.temp-warm,
.condition-stat.swell-medium,
.condition-stat.visibility-fair,
.condition-stat.temp-warm { 
  background-color: #fefce8 !important; 
  color: #ca8a04 !important;  /* More yellow, less brown */
}

.swell-high,
.visibility-limited,
.temp-cool,
.condition-stat.swell-high,
.condition-stat.visibility-limited,
.condition-stat.temp-cool { 
  background-color: #fef2e2 !important; 
  color: #ea580c !important;  /* More orange, less red */
}

.swell-extreme,
.visibility-poor,
.temp-cold,
.condition-stat.swell-extreme,
.condition-stat.visibility-poor,
.condition-stat.temp-cold { 
  background-color: #fce8e6 !important; 
  color: #d93025 !important;  /* Keep existing red */
}

/* Popup specific text color overrides */
.condition-stat.swell-low .condition-value,
.condition-stat.visibility-good .condition-value,
.condition-stat.temp-hot .condition-value { color: #137333 !important; }

.condition-stat.swell-medium .condition-value,
.condition-stat.visibility-fair .condition-value,
.condition-stat.temp-warm .condition-value { color: #ca8a04 !important; }

.condition-stat.swell-high .condition-value,
.condition-stat.visibility-limited .condition-value,
.condition-stat.temp-cool .condition-value { color: #ea580c !important; }

.condition-stat.swell-extreme .condition-value,
.condition-stat.visibility-poor .condition-value,
.condition-stat.temp-cold .condition-value { color: #d93025 !important; }

    /* Mobile */
    @media (max-width: 768px) {
      .fullscreen-modal .modal-header .modal-title {
        font-size: 16px !important;
      }
    }

    /* Fullscreen mobile modals - Marine Life and Conditions */
@media (max-width: 768px) {
  /* Marine Life Sightings Modal */
  #marine-life-modal .modal-content,
  #report-sighting-modal .modal-content,
  /* Conditions Feed Modal */
  #conditions-feed-modal .modal-content,
  #report-modal .modal-content,
  #confirmation-modal .modal-content {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Modal headers stay fixed */
  #marine-life-modal .modal-header,
  #report-sighting-modal .modal-header,
  #conditions-feed-modal .modal-header,
  #report-modal .modal-header,
  #confirmation-modal .modal-header {
    flex-shrink: 0 !important;
  }
  
  /* Modal bodies expand to fill space */
  #marine-life-modal .modal-body,
  #report-sighting-modal .modal-body,
  #conditions-feed-modal .modal-body,
  #report-modal .modal-body,
  #confirmation-modal .modal-body {
    flex: 1 !important;
    overflow-y: auto !important;
    min-height: 0 !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

    /* Full screen modal */
    .fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    }

    .fullscreen-modal.active {
    opacity: 1;
    visibility: visible;
    }

    .modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform: translateY(30px);
    transition: transform 0.3s ease;
    z-index: 10011;
    position: relative;
    }

    .fullscreen-modal.active .modal-content {
    transform: translateY(0);
    }

    .modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px 16px 0 0;
    }

    .modal-title {
    font-size: 24px;
    font-weight: bold;
    color: #1e293b;
    margin: 0;
    }

    .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    }

    .close-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
    }

    .modal-body {
    padding: 32px;
    }

    /* Animated Modal Headers - Green beacon with pulsing glow effect */
    .fullscreen-modal .modal-header .modal-title {
      font-size: 18px !important;
      font-weight: 600;
      position: relative;
      padding-left: 20px;           /* Space for dot */
    }

    .fullscreen-modal .modal-header .modal-title::before {
      content: '';
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 8px;
      height: 8px;
      background: #10b981;
      border-radius: 50%;
      animation: beacon 2s ease-in-out infinite;
    }

    @keyframes beacon {
      0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
      50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    }

    /* Mobile */
    @media (max-width: 768px) {
      .fullscreen-modal .modal-header .modal-title {
        font-size: 16px !important;
      }
    }

    /* Marine sighting modals - Blue beacon */
    #marine-life-modal .modal-header .modal-title::before,
    #report-sighting-modal .modal-header .modal-title::before {
      background: #3b82f6;
      animation: beacon-blue 2s ease-in-out infinite;
    }

    @keyframes beacon-blue {
      0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
      50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
    }

    /* About Modal */
    .about-modal-content {
      max-width: 600px;
    }

    .about-modal-body {
      padding: 32px;
      text-align: center;
      background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    }

    .about-logo-section {
      margin-bottom: 16px;
    }

    .about-logo {
      width: 140px;
      height: auto;
      object-fit: contain;
      filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    }

    .about-version-info {
      font-size: 14px;
      color: #64748b;
      margin-bottom: 32px;
      font-weight: 500;
    }

    .about-description {
      font-size: 18px;
      line-height: 1.6;
      color: #1e293b;
      margin-bottom: 40px;
      max-width: 480px;
      margin-left: auto;
      margin-right: auto;
    }

    .about-credits {
      border-top: 1px solid #e2e8f0;
      padding-top: 32px;
      margin-top: 32px;
    }

    .credits-section {
      margin-bottom: 24px;
    }

    .credits-section:last-child {
      margin-bottom: 0;
    }

    .credits-section h4 {
      font-size: 16px;
      font-weight: 600;
      color: #36d1dc;
      margin: 0 0 8px 0;
    }

    .credits-section p {
      font-size: 14px;
      line-height: 1.5;
      color: #64748b;
      margin: 0;
    }

    /* Mobile responsiveness for about modal */
    @media (max-width: 768px) {
      .about-modal-body {
        padding: 24px;
      }
      
      .about-logo {
        width: 120px;
      }
      
      .about-description {
        font-size: 16px;
      }
    }

    /* Fix marine sighting marker positioning and hover */
    .maplibregl-marker {
      transform-origin: center center !important;
      pointer-events: auto !important;
      /* Remove any transform animations that cause flickering */
      transition: none !important;
    }

    .maplibregl-marker img {
      transform-origin: center center !important;
      pointer-events: auto !important;
      user-select: none !important;
      -webkit-user-drag: none !important;
      -webkit-user-select: none !important;
      -moz-user-select: none !important;
      -ms-user-select: none !important;
      display: block !important;
      position: relative !important;
      /* Prevent any hover transforms that cause flickering */
      transition: none !important;
    }

    /* Additional fixes for marker stability */
    .maplibregl-marker .marine-sighting-marker {
      pointer-events: auto !important;
      position: relative !important;
      z-index: 50 !important;
      /* Prevent any unwanted transforms */
      transform: none !important;
      transition: none !important;
    }

    /* If you have custom marker elements, ensure they're stable */
    .marine-marker-icon {
      pointer-events: auto !important;
      transition: none !important;
      transform: none !important;
      backface-visibility: hidden !important;
      -webkit-backface-visibility: hidden !important;
    }

    /* Marine life beacon cursor - override all conflicts */
    .maplibregl-marker[data-marine-life] {
      cursor: pointer !important;
    }

    .maplibregl-marker[data-marine-life] * {
      cursor: pointer !important;
    }

    /* Target the pulsing beacon specifically */
    .maplibregl-marker div[style*="pulsing-dot"] {
      cursor: pointer !important;
    }

    /* Additional backup selectors */
    .maplibregl-marker:has([style*="pulsing-dot"]) {
      cursor: pointer !important;
    }

    /* Mobile responsive */
    @media (max-width: 768px) {
      .sightings-header {
        justify-content: center; /* Center the button on mobile */
        margin-bottom: 20px;
      }
      
      #report-sighting-btn {
        width: 100%; /* Full width on mobile like upgrade button */
        max-width: 300px;
        justify-content: center;
        padding: 16px 24px;
      }
    }

    /* Marine Life Sightings Styles */
    .sightings-header {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 24px;
      padding-bottom: 16px;
      border-bottom: 1px solid #e5e7eb;
    }

    #sightings-list {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    /* Enhanced Sighting Card Layout */
    .sighting-card {
      background: white;
      border: 1px solid #e5e7eb;
      border-radius: 16px; /* More rounded for modern look */
      padding: 20px;
      transition: all 0.2s ease;
      box-shadow: 0 2px 8px rgba(0,0,0,0.06); /* Softer shadow */
      transform-style: preserve-3d;
      position: relative;
      overflow: hidden;
    }

    .sighting-card:hover {
      box-shadow: 0 8px 24px rgba(0,0,0,0.12); /* Enhanced hover shadow */
      transform: translateY(-4px); /* More pronounced lift */
      border-color: #36d1dc;
      isolation: isolate;
    }

    /* Add a subtle left border for visual interest */
    .sighting-card::before {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 4px;
      background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
      border-radius: 0 2px 2px 0;
    }

    /* Add click indicator */
    .sighting-card {
      cursor: pointer;
    }

    .sighting-card::after {
      content: '👁️ View on Map';
      position: absolute;
      bottom: 12px;
      right: 16px;
      font-size: 12px;
      color: #64748b;
      opacity: 0;
      transition: opacity 0.2s ease;
      pointer-events: none;
    }

    .sighting-card:hover::after {
      opacity: 1;
    }

    .sighting-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 16px; /* Increased spacing */
    }

    .species-info {
      display: flex;
      align-items: flex-start;
      gap: 16px;
      flex: 1;
    }

    /* Enhanced species display */
    .species-details h3 {
      margin: 0 0 6px 0;
      font-size: 20px; /* Slightly larger */
      font-weight: 700; /* Bolder */
      color: #1e293b;
      line-height: 1.2;
    }

    .species-count {
      font-size: 14px;
      color: #64748b;
      background: #f1f5f9;
      padding: 4px 10px;
      border-radius: 12px;
      font-weight: 500;
      display: inline-block;
    }

    /* Better time and status display */
    .sighting-time {
      text-align: right;
      font-size: 13px;
      color: #64748b;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 6px;
    }

    /* Enhanced location display */
    .sighting-location {
      font-weight: 600;
      color: #374151;
      margin-bottom: 12px;
      padding: 8px 12px;
      background: #f8fafc;
      border-radius: 8px;
      border-left: 3px solid #36d1dc;
      font-size: 14px;
    }

    /* Better notes styling */
    .sighting-notes {
      color: #4b5563;
      line-height: 1.6;
      margin-bottom: 16px;
      font-style: italic;
      padding: 12px;
      background: #fafafa;
      border-radius: 8px;
      border-left: 3px solid #e5e7eb;
    }

    /* Enhanced photo display */
    .sighting-photo {
      width: 100%;
      max-width: 100%;
      height: 220px; /* Fixed height for consistency */
      object-fit: cover;
      border-radius: 12px;
      margin-top: 16px;
      cursor: pointer;
      transition: all 0.3s ease;
      will-change: transform;
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .sighting-photo:hover {
      transform: scale(1.02);
      box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    }

    .empty-sightings {
      text-align: center;
      padding: 60px 20px;
      color: #64748b;
    }

    .empty-sightings-icon {
      font-size: 64px;
      margin-bottom: 16px;
      opacity: 0.5;
    }

    /* Mobile responsive improvements */
    @media (max-width: 768px) {
      .sighting-header {
        flex-direction: column;
        gap: 12px;
      }
      
      .species-info {
        flex-direction: column;
        text-align: left;
        gap: 8px;
      }
      
      .sighting-time {
        text-align: left;
        align-items: flex-start;
      }
      
      .species-details h3 {
        font-size: 18px;
      }
      
      .sighting-photo {
        height: 180px;
      }
      
      .sighting-card::after {
        display: none; /* Hide "View on Map" text on mobile */
      }
    }

    /* Report Sighting Modal Styles */
.photo-upload-area {
  border: 2px dashed #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafafa;
}

.photo-upload-area:hover {
  border-color: #36d1dc;
  background: #f0fdff;
}

.photo-upload-area.drag-over {
  border-color: #36d1dc;
  background: #e0f9ff;
  transform: scale(1.02);
}

.upload-placeholder {
  pointer-events: none;
}

.photo-preview {
  position: relative;
}

.remove-photo-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.remove-photo-btn:hover {
  background: rgba(239, 68, 68, 1);
}

#other-species-group {
  transition: all 0.3s ease;
}

#other-species-group.show {
  display: block !important;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
  }
  to {
    opacity: 1;
    max-height: 100px;
    margin-bottom: 24px;
  }
}

/* Location picker map styling */
#location-picker-map {
  position: relative;
  cursor: crosshair;
}

#location-picker-map .maplibregl-canvas {
  cursor: crosshair !important;
}

/* Form improvements */
.form-grid input[type="date"],
.form-grid input[type="time"] {
  font-family: inherit;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr !important;
  }
  
  #location-picker-map {
    height: 200px !important;
  }
  
  .photo-upload-area {
    padding: 16px;
  }
}

/* Make the report sighting button larger and more prominent */
#report-sighting-btn {
  background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
  color: white;
  border: none;
  padding: 14px 24px; /* Increased from 6px 12px */
  border-radius: 12px; /* Increased border radius */
  font-size: 16px; /* Increased from 12px */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(54, 209, 220, 0.3);
  display: flex;
  align-items: center;
  gap: 8px; /* Increased gap */
  min-height: 48px; /* Ensure good touch target */
}

#report-sighting-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(54, 209, 220, 0.4);
  background: linear-gradient(135deg, #2dd4da 0%, #4c63d2 100%);
}

/* Marine Sighting Popup Styles */
.maplibregl-popup.marine-sighting-popup .maplibregl-popup-content {
  padding: 0;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  border: none;
  pointer-events: auto !important;
}

.maplibregl-popup.marine-sighting-popup .maplibregl-popup-tip {
  border-top-color: white;
}

@keyframes pulsing-dot {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2.0);
    opacity: 0;
  }
}

.marine-sighting-marker {
  transform-origin: center center !important;
  pointer-events: auto !important;
  transition: none !important;
  position: relative !important;
  z-index: 50 !important;
}

/* Success notification animation */
@keyframes slideInRight {
  from { 
    transform: translateX(100%); 
    opacity: 0; 
  }
  to { 
    transform: translateX(0); 
    opacity: 1; 
  }
}

    /* Species Autocomplete Styles */
    .species-autocomplete-container {
      position: relative;
    }

    .species-suggestions {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: white;
      border: 1px solid #e5e7eb;
      border-top: none;
      border-radius: 0 0 8px 8px;
      max-height: 200px;
      overflow-y: auto;
      z-index: 1000;
      display: none;
      box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .species-suggestion {
      padding: 12px 16px;
      cursor: pointer;
      border-bottom: 1px solid #f1f5f9;
      display: flex;
      align-items: center;
      gap: 8px;
      transition: background 0.2s ease;
    }

    .species-suggestion:hover,
    .species-suggestion.highlighted {
      background: #f8fafc;
    }

    .species-suggestion:last-child {
      border-bottom: none;
    }

    .species-name {
      font-weight: 500;
      color: #1e293b;
    }

    .species-common {
      font-size: 12px;
      color: #64748b;
      margin-left: auto;
    }

    /* Input focus state */
    #species-input:focus + .species-suggestions {
      display: block;
    }

    .species-autocomplete-container:focus-within .species-suggestions {
      display: block;
    }

    /* Enhanced map status badges */
    .map-status {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px 10px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .map-status.active {
      background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
      color: #166534;
      border: 1px solid #86efac;
    }

    .map-status.expired {
      background: #f3f4f6;
      color: #6b7280;
      border: 1px solid #d1d5db;
    }

    /* Form styles */
    .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    }

    .form-group {
    display: flex;
    flex-direction: column;
    }

    .form-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    }

    .form-input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    }

    .form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .form-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 32px;
    }

    /* Modern Google-like Conditions Feed Styling */

/* Modal Header - Clean and Minimal */
.conditions-feed-modal .modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid #e8eaed;
  background: white;
}

.conditions-feed-modal .modal-title {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
  margin: 0;
  letter-spacing: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Close button - Google style */
.conditions-feed-modal .close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #5f6368;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.conditions-feed-modal .close-btn:hover {
  background-color: #f1f3f4;
}

/* Table Container */
#conditions-table-container {
  padding: 0;
  background: white;
}

/* Modern Clean Table */
.conditions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: white;
  border-radius: 0;
  box-shadow: none;
  border: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Table Headers - Google style */
.conditions-table th {
  background: white;
  color: #5f6368;
  padding: 16px;
  text-align: left;
  font-weight: 600;
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0.25px;
  border-bottom: 1px solid #e8eaed;
  position: sticky;
  top: 0;
  z-index: 10;
  line-height: 1.4;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dive Site column - narrower */
.conditions-table th:nth-child(1) {
  width: 140px;
  padding-left: 17px;
}

/* Center specific headers */
.conditions-table th:nth-child(2), /* When */
.conditions-table th:nth-child(3), /* Swell */
.conditions-table th:nth-child(4), /* Visibility */
.conditions-table th:nth-child(5), /* Water Temp */
.conditions-table th:nth-child(6)  /* Region */ {
  text-align: center;
}

/* Table Cells */
.conditions-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f3f4;
  vertical-align: middle;
  transition: background-color 0.15s ease;
  font-size: 16px;
  line-height: 1.4;
}

/* Row Hover - Subtle Google style */
.conditions-table tr:hover {
  background-color: #f8f9fa;
}

/* Column-specific styling */
.site-name-col {
  font-weight: 500;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 17px;
}

.timestamp-col {
  color: #5f6368;
  font-size: 13px;
  white-space: nowrap;
  text-align: center;
  min-width: 80px;
}

.swell-col, .visibility-col, .temp-col {
  text-align: center;
  font-weight: 500;
  color: #202124;
  min-width: 170px;    /* Same width for all three */
  max-width: 170px;    /* Force exact width */
  width: 170px;        /* Ensure consistency */
}

.region-col {
  color: #5f6368;
  text-align: center;
  font-size: 13px;
  min-width: 100px;
}

/* Empty State - Google style */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #5f6368;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
  margin: 0 0 8px 0;
}

.empty-state p {
  font-size: 14px;
  color: #5f6368;
  margin: 0;
}

/* Loading State - Google style */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: #5f6368;
}

.loading-spinner {
  font-size: 24px;
  margin-bottom: 16px;
  animation: spin 1s linear infinite;
}

.loading-state p {
  font-size: 14px;
  color: #5f6368;
  margin: 0;
}

/* Mobile Responsive - Clean and Readable */
@media (max-width: 768px) {
  .conditions-feed-modal .modal-title {
    font-size: 16px;
  }
  
  .conditions-feed-modal .modal-header {
    padding: 12px 16px;
  }
  
  .conditions-table {
    font-size: 12px;
    border-spacing: 0 1px;
  }
  
  .conditions-table th {
    padding: 8px 6px;
    font-size: 16px;
    font-weight: 600;
  }
  
  .conditions-table td {
    padding: 8px 6px;
    font-size: 15px;
  }
  
  .site-name-col {
  max-width: 50px;
  font-size: 16px;
  padding-left: 17px !important;
}

.timestamp-col {
  font-size: 16px;
  min-width: 65px;
}

.swell-col, .visibility-col, .temp-col {
  font-size: 15px;
  min-width: 70px;    /* Keep mobile width the same */
  max-width: 70px;
  width: 70px;
}

/* Mobile header text overrides */
.conditions-table th:nth-child(3)::after {
  content: "Viz"; 
}

.conditions-table th:nth-child(4)::after {
  content: "Swell"; 
}

.conditions-table th:nth-child(5)::after {
  content: "Temp";  
}

.conditions-table th:nth-child(3),
.conditions-table th:nth-child(4),
.conditions-table th:nth-child(5) {
  font-size: 0;
}

.conditions-table th:nth-child(3)::after,
.conditions-table th:nth-child(4)::after,
.conditions-table th:nth-child(5)::after {
  font-size: 16px;
}
  
  /* Condition badges on mobile */
  .swell-low, .swell-medium, .swell-high, .swell-extreme,
  .visibility-poor, .visibility-limited, .visibility-fair, .visibility-good,
  .temp-cold, .temp-cool, .temp-warm, .temp-hot {
    padding: 2px 6px;
    font-size: 10px;
  }
  
  /* Hide region column on mobile */
  .conditions-table th:nth-child(6),
  .conditions-table td:nth-child(6) {
    display: none;
  }

  /* Center the text in headers with icons */
  .conditions-table th:nth-child(3), /* Viz */
  .conditions-table th:nth-child(4), /* Swell */
  .conditions-table th:nth-child(5)  /* Temp */ {
    text-align: center;
  }
  
  /* Make header icons smaller on mobile */
  .conditions-table th img {
    width: 17px !important;
    height: 17px !important;
    margin: 0 auto 4px auto !important;
    display: block;
  }

}

    .navi-code-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
    }

    .navi-code-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
    }

    .conditions-buttons {
        display: flex;
        gap: 8px;
        align-items: stretch;
    }

    .conditions-buttons button {
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Layer Management */

    #map {
      pointer-events: auto !important;
    }

    .maplibregl-canvas {
      pointer-events: auto !important;
    }

    .maplibregl-control-container * {
      pointer-events: auto !important;
      z-index: 100 !important;
    }

    .draw-toggle-btn {
      position: relative !important;
      z-index: 10000 !important;
      pointer-events: auto !important;
    }

    .custom-draw-control {
      z-index: 150 !important;
      pointer-events: auto !important;
    }


    .draw-controls-panel, .draw-controls-panel * {
      pointer-events: auto !important;
      z-index: 150 !important;
    }

    .draw-btn {
      pointer-events: auto !important;
      position: relative !important;
      z-index: 201 !important;
    }

    /* Settings control pointer events */
    .settings-control,
    .settings-control * {
      pointer-events: auto !important;
      z-index: 10000 !important;
    }

    .settings-btn {
      pointer-events: auto !important;
      z-index: 10001 !important;
    }

    /* Settings panel pointer events */
    .settings-panel,
    .settings-panel * {
      pointer-events: auto !important;
      z-index: 10007 !important;
    }

    /* Settings panel buttons - ensure they're clickable */
    .settings-option,
    .settings-action-btn,
    .toggle-switch,
    .settings-close {
      pointer-events: auto !important;
      position: relative;
      z-index: 10004 !important;
    }

    /* Make sure content area is also interactive */
    .settings-content {
      pointer-events: auto !important;
      z-index: 10003 !important;
    }

    .live-weather-box {
      position: absolute;
      top: 30px;
      right: 30px;
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      border-radius: 12px;
      padding: 12px 16px;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
      z-index: 100;
      min-width: 320px;
      max-width: 500px;
      transition: none !important;
    }

    .live-weather-box.hidden {
      display: none;
    }

    .live-weather-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      padding-bottom: 8px;
      border-bottom: 1px solid #e5e7eb;
    }

    .live-weather-location {
      font-weight: 600;
      color: #1e293b;
      font-size: 14px;
    }

    .live-weather-period {
      font-size: 11px;
      color: #64748b;
      margin-left: 8px;
    }

    .confidence-icon {
      width: 12px;
      height: 12px;
      display: inline-block;
      vertical-align: middle;
      margin-right: 3px;
    }

    .live-weather-close {
      background: none;
      border: none;
      font-size: 20px;
      color: #64748b;
      cursor: pointer;
      padding: 0;
      width: 24px;
      height: 24px;
      border-radius: 4px;
      transition: all 0.2s;
    }

    .live-weather-close:hover {
      background: #f1f5f9;
      color: #1e293b;
    }

    .live-weather-data {
      display: flex;
      gap: 16px;
      justify-content: space-between;
      padding: 0 22px;
    }

    /* Live Weather Item with color indicator */
    .live-weather-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
    }

    .live-weather-value-group {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding-left: 16px;
      position: relative;
      min-width: 50px;
    }
    
    .live-weather-value-group::before {
      content: '';
      position: absolute;
      left: 0px;
      top: 2px;
      bottom: 2px;
      width: 7px;
      background-color: transparent;
      border-radius: 4px;
      transition: background-color 0.3s;
    }

    /* Widget-specific visibility colors (border only) */
    .live-weather-item.widget-visibility-good .live-weather-value-group::before { background-color: #57cc99; }
    .live-weather-item.widget-visibility-fair .live-weather-value-group::before { background-color: #ffd93d; }
    .live-weather-item.widget-visibility-limited .live-weather-value-group::before { background-color: #ff9f43; }
    .live-weather-item.widget-visibility-poor .live-weather-value-group::before { background-color: #ee5a6f; }

    /* Widget-specific swell colors (border only) */
    .live-weather-item.widget-swell-low .live-weather-value-group::before { background-color: #57cc99; }
    .live-weather-item.widget-swell-medium .live-weather-value-group::before { background-color: #ffd93d; }
    .live-weather-item.widget-swell-high .live-weather-value-group::before { background-color: #ff9f43; }
    .live-weather-item.widget-swell-extreme .live-weather-value-group::before { background-color: #ee5a6f; }

    /* Widget-specific wind colors (border only) */
    .live-weather-item.widget-wind-calm .live-weather-value-group::before { background-color: #57cc99; }
    .live-weather-item.widget-wind-light .live-weather-value-group::before { background-color: #ffd93d; }
    .live-weather-item.widget-wind-moderate .live-weather-value-group::before { background-color: #ff9f43; }
    .live-weather-item.widget-wind-strong .live-weather-value-group::before { background-color: #ee5a6f; }

    /* Widget-specific temp colors (border only) */
    .live-weather-item.widget-temp-hot .live-weather-value-group::before { background-color: #57cc99; }
    .live-weather-item.widget-temp-warm .live-weather-value-group::before { background-color: #ffd93d; }
    .live-weather-item.widget-temp-cool .live-weather-value-group::before { background-color: #ff9f43; }
    .live-weather-item.widget-temp-cold .live-weather-value-group::before { background-color: #3b82f6; }

    .live-weather-icon {
      width: 20px;
      height: 20px;
      object-fit: contain;
      margin-bottom: 6px;
      margin-left: 3px;
    }

    .live-weather-value {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

    .live-weather-unit {
      font-size: 11px;
      margin-left: -10px;
      color: #64748b;
    }

    .trend-arrow {
      font-size: 12px;
      font-weight: bold;
      display: inline-block;
    }

    .trend-arrow.trend-up-good {
        color: #16a34a;
    }

    .trend-arrow.trend-down-good {
        color: #16a34a;
    }

    .trend-arrow.trend-up-bad {
        color: #f97316;
    }

    .trend-arrow.trend-down-bad {
        color: #f97316;
    }

    .trend-arrow.trend-neutral {
        color: #94a3b8;
    }

    .live-weather-label {
      font-size: 11px;
      color: #64748b;
      font-weight: 600;
      text-align: center;
      width: 100%;
      padding-left: 8px;
    }

    .value-with-trend {
    display: flex;
    align-items: center;
    gap: 3px;
}

    .live-weather-warning {
      margin-top: 8px;
      padding: 8px;
      background: #fef2f2;
      border: 1px solid #fecaca;
      border-radius: 6px;
      color: #991b1b;
      font-size: 12px;
      text-align: center;
      font-weight: 500;
    }

    @media (max-width: 768px) {
      .live-weather-box {
        position: fixed;
        top: 80px;
        left: 20px;
        right: 20px;
        width: auto;
        max-width: none;
        transform: none;
        margin: 0;
        box-sizing: border-box;
        z-index: 100;
        text-align: center;
      }

      .live-weather-label {
        padding-left: 4px;
      }

      .live-weather-icon {
        margin-left: 4px;
      }
      
      .live-weather-data {
        gap: 12px;
        padding: 0;
        justify-content: center;
      }

      .live-weather-value-group {
        padding-left: 6;
      }
      
      .live-weather-value {
        font-size: 26px;
      }
      
      .live-weather-icon {
        font-size: 18px;
      }
    }

    /* Modern Tooltip Bubbles */
    .live-weather-item {
      position: relative;
      cursor: help;
    }

    .live-weather-item::before {
      content: attr(data-tooltip);
      position: absolute;
      bottom: 100%;
      left: 50%;
      transform: translateX(-50%) translateY(-8px);
      background: rgba(30, 41, 59, 0.95);
      color: white;
      padding: 8px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 500;
      white-space: normal;
      display: inline-block;
      width: 100px;
      text-align: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease, transform 0.2s ease;
      z-index: 1000;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .live-weather-item::after {
      content: '';
      position: absolute;
      bottom: 100%;
      left: 50%;
      transform: translateX(-50%) translateY(-2px);
      border: 6px solid transparent;
      border-top-color: rgba(30, 41, 59, 0.95);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease, transform 0.2s ease;
      z-index: 1000;
    }

    .live-weather-item:hover::before {
      opacity: 1;
      transform: translateX(-50%) translateY(-12px);
    }

    .live-weather-item:hover::after {
      opacity: 1;
      transform: translateX(-50%) translateY(-6px);
    }

    .simple-toggle-btn {
      width: 44px;
      height: 24px;
      background: #cbd5e1;
      border: none;
      border-radius: 24px;
      position: relative;
      cursor: pointer;
      transition: none;
      padding: 0;
    }

    .simple-toggle-btn[data-active="true"] {
      background: #0284c7;
    }

    .toggle-indicator {
      position: absolute;
      width: 18px;
      height: 18px;
      background: white;
      border-radius: 50%;
      top: 3px;
      left: 3px;
      transition: none;
    }

    .simple-toggle-btn[data-active="true"] .toggle-indicator {
      left: 23px;
    }

    /* Map page must have zero padding */
    body.map-page {
      padding: 0 !important;
      overflow: hidden !important;
      background: #000; /* optional: hides any flash behind the map */
    }

    /* Changelog Modal Styles */
    .changelog-modal-body {
      max-height: 70vh;
      overflow-y: auto;
      padding: 24px;
    }

    .changelog-entry {
      margin-bottom: 32px;
      padding-bottom: 24px;
      border-bottom: 1px solid #e5e7eb;
    }

    .changelog-entry:last-child {
      border-bottom: none;
      margin-bottom: 0;
    }

    .changelog-version {
      font-size: 20px;
      font-weight: 700;
      color: #1e293b;
      margin-bottom: 4px;
    }

    .changelog-date {
      font-size: 13px;
      color: #64748b;
      margin-bottom: 16px;
    }

    .changelog-items {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .changelog-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      font-size: 14px;
      line-height: 1.6;
      color: #475569;
    }

    .changelog-badge {
      flex-shrink: 0;
      padding: 4px 10px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .changelog-badge.new {
      background: #dcfce7;
      color: #15803d;
    }

    .changelog-badge.improved {
      background: #dbeafe;
      color: #1e40af;
    }

    .changelog-badge.fixed {
      background: #fef3c7;
      color: #92400e;
    }

    /* About Modal - Contact button on its own row */
    #contact-button {
      flex-basis: 100% !important;
    }