:root {
    --brand-red: #dc2626;
    --brand-red-dark: #b91c1c;
    --gray-light: #f3f4f6;
    --gray-medium: #9ca3af;
    --gray-dark: #374151;
    --text-light: #e5e7eb;
    --text-dark: #1f2937;
}

/* Basic styles for light/dark mode and layout */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--gray-light);
}

.dark body {
    background-color: var(--gray-dark);
    color: var(--text-light);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.dark .material-symbols-outlined {
    color: var(--text-light);
}

/* Leaflet map height and z-index fix */
#map-container, #check-ins-map-container {
    position: relative;
    z-index: 10;
    height: 100%; /* Ensure container has height */
    overflow: hidden;
}

#detail-map-container {
    position: relative;
    z-index: 10;
    height: 24rem; /* h-96 for desktop */
}

@media (max-width: 767px) {
    #detail-map-container {
        height: auto;
        aspect-ratio: 1 / 1;
    }
}

#map, #detail-map, #check-ins-map {
    height: 100%;
    width: 100%;
}

/* Custom scrollbar for a cleaner look */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #a1a1aa; /* zinc-400 */
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #71717a; /* zinc-500 */
}

.dark ::-webkit-scrollbar-thumb {
    background: #52525b; /* zinc-600 */
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #71717a; /* zinc-500 */
}

/* Custom focus ring color */
.focus-ring-red {
    --tw-ring-color: var(--brand-red);
}

/* Styles for details view */
.detail-label {
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    color: #6b7280; /* gray-500 */
}

.dark .detail-label {
    color: var(--gray-medium);
}

.detail-value {
    font-size: 1rem; /* text-base */
    color: var(--text-dark);
}

.dark .detail-value {
    color: var(--text-light);
}

.detail-section {
    margin-top: 1.5rem; /* mt-6 */
    padding-top: 1.5rem; /* pt-6 */
    border-top: 1px solid #e5e7eb; /* border-t border-gray-200 */
}

.dark .detail-section {
     border-top-color: var(--gray-dark);
}

/* AI Chat Styles */
.ai-chat-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
}

.ai-chat-user {
    background-color: var(--brand-red);
    color: white;
    border-bottom-right-radius: 0.25rem;
    align-self: flex-end;
}

.ai-chat-gemini {
    background-color: var(--gray-light);
    color: var(--text-dark);
    border-bottom-left-radius: 0.25rem;
    align-self: flex-start;
}

.dark .ai-chat-gemini {
    background-color: var(--gray-dark);
    color: var(--text-light);
}

.video-thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.2s;
}

.video-thumbnail-overlay:hover {
    opacity: 0.8;
}

.blinking-cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Style for the collapsible AI section */
#ai-details-section summary::-webkit-details-marker {
    display: none; /* Hide default arrow in Chrome/Safari */
}

#ai-details-section summary {
    list-style: none; /* Hide default arrow in Firefox */
}

#ai-details-section[open] summary .material-symbols-outlined.expand-icon {
    transform: rotate(180deg);
}

/* Filled star for favorites */
.favorite-star.material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 700;
    color: #f59e0b; /* amber-500 */
}

/* Basic prose styles for AI content */
.prose h3 { font-size: 1.1em; font-weight: 600; margin-top: 1em; margin-bottom: 0.5em; }
.prose ul { list-style-type: disc; padding-left: 1.5em; margin-top: 0.5em; }
.prose li { margin-bottom: 0.25em; }
.prose p { margin-bottom: 0.75em; }
.prose strong { font-weight: 600; }

/* Toast Notification Styles */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transform: translateX(120%);
    transition: transform 0.3s ease-in-out;
    color: white;
}

.toast.show {
    transform: translateX(0);
}

.toast-success { background-color: #22c55e; }
.toast-error { background-color: var(--brand-red); }
.toast-info { background-color: #3b82f6; }

/* Spinner Styles */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--brand-red);
    animation: spin 1s ease infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Lightbox Styles */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

#lightbox-close, #lightbox-prev, #lightbox-next {
    position: absolute;
    color: white;
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 1001;
    background-color: rgba(0,0,0,0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#lightbox-close:hover, #lightbox-prev:hover, #lightbox-next:hover {
    background-color: rgba(0,0,0,0.6);
}

#lightbox-close { top: 1rem; right: 1rem; }
#lightbox-prev { top: 50%; left: 1rem; transform: translateY(-50%); }
#lightbox-next { top: 50%; right: 1rem; transform: translateY(-50%); }

.upload-drop-zone {
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
}

.upload-drop-zone .sr-only {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.drag-over {
    background-color: #fef2f2; /* brand-red-50 */
    border-color: var(--brand-red);
}

.dark .drag-over {
    background-color: #450a0a; /* brand-red-950 */
}

/* Mobile View Toggles */
.mobile-view-toggle {
    display: flex; /* visible by default on mobile */
    z-index: 50; /* Ensure it's above the absolute positioned sidebar and other elements */
}

@media (min-width: 768px) { /* md breakpoint */
    .mobile-view-toggle {
        display: none;
    }
}

/* Google Sign-in Button */
.google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db; /* gray-300 */
    background-color: white;
    color: var(--text-dark);
    font-weight: 500;
    transition: background-color 0.2s;
}

.google-btn:hover {
    background-color: var(--gray-light);
}

.dark .google-btn {
    border-color: var(--gray-dark);
    background-color: var(--gray-dark);
    color: var(--text-light);
}

.dark .google-btn:hover {
    background-color: #4b5563; /* gray-600 */
}

.google-btn svg {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
}

.modal-flicker-fix {
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
}

.weather-legend {
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

.legend-section {
    margin-top: 5px;
}

.legend-colors {
    height: 20px;
    margin-top: 5px;
    position: relative;
}

.dark .weather-legend, .dark .legend-section {
    color: #333 !important;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.dark-text {
    color: #333 !important;
}

.dark .weather-legend .legend-labels {
    color: #333 !important;
}

.bg-green-500 { background-color: #22c55e; }
.bg-yellow-500 { background-color: #eab308; }
.bg-red-500 { background-color: var(--brand-red); }

.info-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--gray-medium);
    color: white;
    text-align: center;
    font-size: 10px;
    line-height: 14px;
    cursor: help;
}

.logo-container {
  background-color: var(--brand-red);
  border-radius: 0.5rem;
  padding: 8px;
}

.logo-image {
  height: 40px;
}

@media (max-width: 767px) {
  .logo-container {
    padding: 4px;
  }
  .logo-image {
    height: 32px;
  }
}

/* Profile Menu */
.profile-menu-container {
    position: relative;
    z-index: 100;
}

.profile-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background-color: white;
    dark:bg-gray-700;
    border: 1px solid #e5e7eb;
    dark:border-gray-600;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: 12rem;
    z-index: 50;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.notification-menu-container {
    position: relative;
}

.notification-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: 20rem;
    z-index: 50;
    max-height: 60vh;
    flex-direction: column;
}

.dark .notification-menu {
    background-color: #374151; /* gray-700 */
    border-color: #4b5563; /* gray-600 */
}

.notification-menu.show {
    display: flex;
}

.notification-list {
    overflow-y: auto;
    flex-grow: 1;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
}
.dark .notification-item {
    border-bottom-color: #4b5563; /* gray-600 */
}

.notification-item:hover {
    background-color: #f9fafb; /* gray-50 */
}
.dark .notification-item:hover {
    background-color: #4b5563; /* gray-600 */
}

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


.feed-filter-button {
    background-color: transparent;
    color: #4b5563; /* gray-600 */
    transition: all 0.2s ease-in-out;
}
.dark .feed-filter-button {
    color: #d1d5db; /* gray-300 */
}

.feed-filter-button.active {
    background-color: white;
    color: #1f2937; /* gray-800 */
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}
.dark .feed-filter-button.active {
    background-color: #4b5563; /* gray-600 */
    color: #f9fafb; /* gray-50 */
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #dc2626; /* red-600 */
    color: white;
    border-radius: 9999px;
    width: 1rem;
    height: 1rem;
    font-size: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.dark .profile-menu {
    background-color: #374151; /* gray-700 */
    border-color: #4b5563; /* gray-600 */
}

.profile-menu.show {
    display: block;
}

.profile-menu.show {
    display: block;
}

.profile-menu a, .profile-menu button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.dark .profile-menu a, .dark .profile-menu button {
    color: var(--text-light);
}

.profile-menu a:hover, .profile-menu button:hover {
    background-color: var(--gray-light);
}

.dark .profile-menu a:hover, .dark .profile-menu button:hover {
    background-color: #4b5563; /* gray-600 */
}

.rotate-180 {
    transform: rotate(180deg);
}

.admin-tab {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.admin-tab.active {
    background-color: var(--brand-.red);
    color: white;
}

.admin-tab:not(.active):hover {
    background-color: var(--gray-light);
}

.dark .admin-tab:not(.active):hover {
    background-color: #4b5563; /* gray-600 */
}

/* --- Reaction Styles --- */
.add-reaction-container {
    position: relative;
}

.reaction-picker {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0; /* Align to the left of the container */
    transform: translateX(0); /* No horizontal translation */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 8px;
    white-space: nowrap;
    z-index: 20;
}

.add-reaction-container:hover .reaction-picker,
.reaction-picker:hover,
.add-reaction-button:focus + .reaction-picker {
    display: flex;
}

.reaction-option {
    background: none;
    border: none;
    font-size: 1.25rem;
    padding: 4px;
    cursor: pointer;
    transition: transform 0.1s ease-in-out;
}

.reaction-option:hover {
    transform: scale(1.2);
}

.reaction-chip {
    display: flex;
    align-items: center;
    background-color: #e5e7eb; /* gray-200 */
    border: 1px solid transparent;
    border-radius: 9999px;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.dark .reaction-chip {
    background-color: #374151; /* gray-700 */
}

.reaction-chip:hover {
    background-color: #d1d5db; /* gray-300 */
}
.dark .reaction-chip:hover {
    background-color: #4b5563; /* gray-600 */
}

.reaction-chip.reacted {
    background-color: #fef2f2; /* red-50 */
    border-color: #ef4444; /* red-500 */
    color: #b91c1c; /* red-700 */
}
.dark .reaction-chip.reacted {
    background-color: #450a0a; /* red-950 */
    border-color: #ef4444; /* red-500 */
    color: #fca5a5; /* red-300 */
}

/* LZ Modal Tabs */
.lz-tab {
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    color: #6b7280; /* gray-500 */
    font-weight: 500;
    transition: all 0.2s;
}
.dark .lz-tab {
    color: #9ca3af; /* gray-400 */
}
.lz-tab:hover {
    border-bottom-color: #d1d5db; /* gray-300 */
    color: #1f2937; /* gray-800 */
}
.dark .lz-tab:hover {
    border-bottom-color: #4b5563; /* gray-600 */
    color: #f3f4f6; /* gray-100 */
}
.lz-tab.active {
    border-bottom-color: var(--brand-red);
    color: var(--brand-red);
}
.dark .lz-tab.active {
    color: var(--brand-red);
}

/* --- Comment Reaction Styles --- */
.add-reaction-container-sm:hover .reaction-picker,
.reaction-picker:hover,
.add-reaction-button-sm:focus + .reaction-picker {
    display: flex;
}

.reaction-chip-sm {
    display: flex;
    align-items: center;
    background-color: #f3f4f6; /* gray-100 */
    border: 1px solid transparent;
    border-radius: 9999px;
    padding: 1px 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.dark .reaction-chip-sm {
    background-color: #4b5563; /* gray-600 */
}
.reaction-chip-sm.reacted {
    background-color: #fef2f2; /* red-50 */
    border-color: #fca5a5; /* red-300 */
}
.dark .reaction-chip-sm.reacted {
    background-color: #991b1b; /* red-800 */
    border-color: #f87171; /* red-400 */
}

.add-reaction-button-sm {
    padding: 2px;
    border-radius: 9999px;
    line-height: 1;
}
.add-reaction-button-sm:hover {
    background-color: #e5e7eb; /* gray-200 */
}
.dark .add-reaction-button-sm:hover {
    background-color: #4b5563; /* gray-600 */
}

.add-reaction-container-sm .reaction-picker {
    bottom: 80%;
}

#sidebar {
    min-width: 300px; /* Minimum width for the sidebar */
    max-width: 80vw; /* Maximum width for the sidebar */
}

@media (max-width: 767px) {
  #sidebar {
    width: 100% !important;
    max-width: none !important;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20; /* Ensure it's on top of the map */
  }

  #map-container {
      display: none; /* Hide map by default on mobile */
  }

  #main-content.map-view #sidebar {
      display: none;
  }

  #main-content.map-view #map-container {
      display: block;
      width: 100%;
      height: 100%;
  }

  #sidebar-resizer {
    display: none;
  }
}

@media (max-width: 767px) {
  #feed-sidebar {
    height: 100%;
  }
  
  #feed-map-container {
    display: none; /* Hide map by default on mobile */
  }

  #feed-view.map-view #feed-sidebar {
      display: none;
  }

  #feed-view.map-view #feed-map-container {
      display: block;
      width: 100%;
      height: 100%;
  }
  
  #feed-sidebar > .flex-shrink-0.p-4 {
    padding-top: 0.5rem;
  }
}