:root {
    --bg-color: #0b0e14;
    --card-bg: rgba(30, 35, 45, 0.7);
    --glass-bg: rgba(15, 20, 30, 0.8);
    --primary: #4f46e5;
    --primary-hover: #6366f1;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --danger: #ef4444;
    --nav-height: 70px;
    --border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Navbar */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.brand {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand i {
    color: var(--primary);
}

.brand span {
    font-weight: 300;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-main);
}

.nav-item.active i {
    color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: white !important;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Main Content */
main {
    margin-top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 2000;
}

.flash-item {
    background: var(--card-bg);
    border-left: 4px solid var(--primary);
    padding: 1rem;
    margin-bottom: 10px;
    border-radius: 4px;
    backdrop-filter: blur(8px);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Auth Pages */
.auth-container {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    padding: 0.8rem;
    border-radius: 8px;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--primary);
}

select option {
    background-color: #0b0e14;
    color: var(--text-main);
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
}

/* Map View */
#map-container {
    width: 100%;
    height: 100%;
}

/* Gallery View */
.gallery-container {
    padding: 2rem;
    overflow-y: auto;
    height: 100%;
}

.gallery-grid {
    column-count: 4;
    column-gap: 1.5rem;
}

@media (max-width: 1200px) { .gallery-grid { column-count: 3; } }
@media (max-width: 900px) { .gallery-grid { column-count: 2; } }
@media (max-width: 600px) { .gallery-grid { column-count: 1; } }

.spot-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    break-inside: avoid;
    transition: transform 0.3s;
    cursor: pointer;
}

.spot-card:hover {
    transform: translateY(-5px);
}

.spot-image {
    width: 100%;
    display: block;
}

.spot-info {
    padding: 1rem;
}

.spot-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.spot-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Custom Overlay (Map) */
.custom-overlay-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.2s;
    position: absolute;
}
.custom-overlay-img:hover {
    transform: scale(1.2);
    z-index: 1000;
}
.custom-overlay-img.want-to-go {
    border-color: #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
}

/* Route Mode Button */
.route-mode-btn {
    position: fixed;
    bottom: 165px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 900;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.route-mode-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

/* Proximity Search Button */
.nearby-30km-btn {
    position: fixed;
    bottom: 225px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 900;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.nearby-30km-btn:hover, .nearby-30km-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.nearby-30km-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Route Panel */
.route-panel {
    position: fixed !important;
    bottom: 160px !important; /* Match filter panel height */
    right: 90px !important;
    top: auto !important;
    left: auto !important;
    width: 320px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.2rem;
    z-index: 2000;
    transform: translateX(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.route-panel.open {
    display: flex;
    opacity: 1;
    pointer-events: all;
    transform: translateX(0);
}

.route-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.route-header h4 {
    margin: 0;
    font-weight: 600;
}

#route-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.route-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.route-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    position: relative;
}

.route-item .remove-item {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
}

.route-item img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.route-item .item-info {
    flex: 1;
}

.route-item .item-name {
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
}

.empty-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 0.9rem;
}

.route-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.route-footer button {
    width: 100%;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    cursor: pointer;
    z-index: 100;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 20px;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Custom Map Controls */
.custom-map-control-button {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px 15px;
    margin: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.custom-map-control-button:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Fix Google Autocomplete Dropdown Z-Index */
.pac-container {
    z-index: 3000 !important;
}

/* Filter Toggle Button */
.filter-toggle-btn {
    position: fixed;
    bottom: 105px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: all 0.2s;
}

.filter-toggle-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Filter Panel */
.filter-panel {
    position: fixed !important;
    bottom: 160px !important;
    right: 30px !important;
    top: auto !important;
    left: auto !important;
    width: 320px;
    max-height: calc(100vh - 220px);
    overflow: hidden; /* Body will handle scrolling */
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0;
    z-index: 2000;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.filter-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}
.filter-panel h3 {
    font-size: 1rem;
    margin: 1.2rem 1.2rem 0.8rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.2rem 1.2rem;
}

.filter-footer {
    padding: 1rem 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
}

.filter-panel h3 i {
    color: var(--primary);
}

.filter-panel .form-group {
    margin-bottom: 0.8rem;
}

.filter-panel select {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    padding: 0.6rem;
    border-radius: 8px;
    color: var(--text-main);
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    font-size: 0.85rem;
    outline: none;
}

.filter-panel select:focus {
    border-color: var(--primary);
}

/* Checkbox Group Styles */
.checkbox-group {
    max-height: 200px; /* Increased from 150px */
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.region-group {
    margin-bottom: 0.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.region-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.region-header:hover {
    background: rgba(255,255,255,0.05);
}

.region-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
    cursor: pointer;
    margin: 0 !important;
}

.toggle-icon {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    padding: 4px;
}

.region-group.open .toggle-icon {
    transform: rotate(180deg);
}

.prefecture-list {
    padding-left: 1.8rem;
    display: none;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 0.5rem;
}

.region-group.open .prefecture-list {
    display: flex;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: rgba(255,255,255,0.05);
}

.checkbox-item input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.filter-panel {
    width: 280px !important; /* Slightly wider */
}

/* Button Variants */
.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 600;
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: var(--danger);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* Pulsing User Location Dot */
.user-location-marker {
    width: 12px;
    height: 12px;
    background-color: #1a73e8;
    border: 2px solid #fff;
    border-radius: 50%;
    position: absolute;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    z-index: 1000;
}

.user-location-marker::after {
    content: '';
    width: 100%;
    height: 100%;
    background-color: #1a73e8;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    animation: pulse-dot 1.5s ease-out infinite;
    z-index: -1;
    opacity: 0.6;
}

@keyframes pulse-dot {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(4.5);
        opacity: 0;
    }
}

/* Nearby Spot Cards in Detail View */
.nearby-spot-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
}

.nearby-spot-card:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
    transform: translateX(5px);
}

.nearby-spot-card img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.nearby-info {
    flex: 1;
}

.nearby-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.nearby-dist {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Map Search Bar */
.map-search-bar {
    position: fixed;
    top: 80px; /* Below nav */
    left: 20px;
    width: 320px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    z-index: 400; /* Below filter panels (500) */
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.map-search-bar i {
    color: var(--text-muted);
    margin-right: 12px;
}

.map-search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    width: 100%;
    outline: none;
}

.map-search-clear {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
}

.map-search-clear:hover {
    color: var(--text-main);
}

@media (max-width: 768px) {
    .map-search-bar {
        top: 75px;
        left: 10px;
        right: 10px;
        width: auto;
        padding: 0.6rem 0.8rem;
    }
}

/* Fullscreen Image Viewer */
.fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.fullscreen-viewer.open {
    display: flex;
}

.fullscreen-viewer img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

.close-viewer {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Photo Section */
.photo-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.photo-section img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

/* Spot Detail Page */
.spot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.spot-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.spot-header-left h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spot-header-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.spot-detail-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
}

/* Bottom Navigation (Default Hidden) */
.bottom-nav {
    display: none;
}

/* Micro-interactions: Active spring bounce feedback */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-google,
.bottom-nav-item,
.fab,
.filter-toggle-btn,
.route-mode-btn,
.nearby-30km-btn,
.social-toggle-btn,
.season-chip,
.segmented-btn,
.custom-map-control-button {
    transition: transform 0.12s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-primary:active,
.btn-secondary:active,
.btn-danger:active,
.btn-google:active,
.bottom-nav-item:active,
.fab:active,
.filter-toggle-btn:active,
.route-mode-btn:active,
.nearby-30km-btn:active,
.social-toggle-btn:active,
.season-chip:active,
.segmented-btn:active,
.custom-map-control-button:active {
    transform: scale(0.93) !important;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    /* Navigation */
    .nav-container {
        padding: 0 1rem;
    }
    
    .brand {
        font-size: 1.1rem;
        gap: 6px;
    }

    /* Hide desktop nav links, keep profile and logout only */
    .glass-nav .nav-item:not(#nav-profile-btn):not(.logout) {
        display: none !important;
    }

    .nav-links {
        gap: 0.6rem;
    }

    .nav-item {
        font-size: 0.85rem;
        gap: 4px;
    }

    /* Mobile Bottom Navigation Bar Styles */
    .bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border);
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
        justify-content: space-around;
        align-items: center;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.7rem;
        font-weight: 600;
        gap: 4px;
        flex: 1;
        height: 100%;
        position: relative;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .bottom-nav-item i {
        font-size: 1.2rem;
        transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.25s;
    }

    .bottom-nav-item.active {
        color: var(--text-main);
    }

    .bottom-nav-item.active i {
        color: var(--primary);
        transform: translateY(-4px) scale(1.1);
    }

    .bottom-nav-item.active::after {
        content: "";
        position: absolute;
        bottom: 6px;
        width: 4px;
        height: 4px;
        background: var(--primary);
        border-radius: 50%;
        box-shadow: 0 0 8px var(--primary);
    }

    /* Main layout offsets for mobile bottom nav */
    main {
        height: calc(100vh - var(--nav-height) - 60px);
        margin-bottom: 60px;
    }

    .gallery-container {
        padding-bottom: 80px;
    }

    /* Filter & Route Panels */
    .filter-panel, .route-panel {
        bottom: 75px !important; /* Stand above bottom-nav */
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
        width: auto !important;
        max-height: 75vh;
        overflow: hidden;
        z-index: 3000;
        transform: translateY(100%);
    }

    .filter-panel.open, .route-panel.open {
        transform: translateY(0);
    }

    /* Floating Action Buttons adjusted for bottom-nav offset */
    .filter-toggle-btn { bottom: 145px; right: 20px; width: 44px; height: 44px; }
    .route-mode-btn { bottom: 200px; right: 20px; width: 44px; height: 44px; }
    .nearby-30km-btn { bottom: 255px; right: 20px; width: 44px; height: 44px; }
    .social-toggle-btn { bottom: 310px; right: 20px; width: 44px; height: 44px; z-index: 900; }
    .fab { bottom: 80px; right: 20px; width: 56px; height: 56px; }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .gallery-container {
        padding: 1rem;
    }

    /* Spot Detail */
    .spot-detail-grid {
        grid-template-columns: 1fr;
    }

    .spot-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .spot-header-left {
        width: 100%;
    }

    .spot-header-left h1 {
        font-size: 1.1rem;
    }

    .spot-header-actions {
        width: 100%;
    }

    .spot-header-actions a,
    .spot-header-actions button {
        flex: 1;
        text-align: center;
        font-size: 0.85rem;
        padding: 0.5rem;
    }

    .photo-section {
        margin: 0 -1rem; /* Negative margin to counter gallery-container padding */
    }
    
    .photo-section img {
        border-radius: 0; /* Edge-to-edge look on mobile */
    }
}

/* Auth Divider & Google Button */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    padding: 0 10px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background: white;
    color: #333 !important;
    padding: 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: 1px solid #ddd;
}

.btn-google:hover {
    background: #f8f8f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-google img {
    width: 20px;
    height: 20px;
}
/* PWA Install Prompt */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    z-index: 9999;
    display: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.pwa-content {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.pwa-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    flex-shrink: 0;
}

.pwa-text {
    flex: 1;
}

.pwa-text h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.pwa-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.pwa-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.2rem;
}

.pwa-actions button {
    flex: 1;
    padding: 0.7rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.ios-instructions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-main);
}

.ios-instructions i {
    color: var(--primary);
    margin: 0 2px;
}

.pwa-close {
    position: absolute;
    top: 12px;
    right: 15px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
}

/* Social Toggle Button */
.social-toggle-btn {
    position: fixed;
    bottom: 285px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 900;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.social-toggle-btn:hover, .social-toggle-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    color: #ffffff;
    box-shadow: 0 0 15px var(--primary);
}

/* Public shared spot on Map overlay */
.custom-overlay-img.public-spot {
    border-color: #3b82f6 !important; /* Premium Blue border for other users' spots */
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.8) !important;
}

/* --- Premium Mobile Modal & Bottom Sheet --- */
.bottom-sheet-handle {
    display: none;
}

@keyframes slideUpBottomSheet {
    from {
        transform: translateY(100%);
        opacity: 0.9;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modals layout structures */
.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 1rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.flex-1 {
    flex: 1;
}

.display-none {
    display: none;
}

/* Segmented Controls */
.segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3px;
    gap: 4px;
    margin-top: 0.5rem;
}

.segmented-option {
    flex: 1;
    display: flex;
    margin: 0 !important;
}

.segmented-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.segmented-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
    border: 1px solid transparent;
}

.segmented-option:hover .segmented-btn {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.02);
}

.segmented-option input:checked + .segmented-btn {
    color: var(--text-main);
}

.segmented-option input:checked + .segmented-btn.visited-btn {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.segmented-option input:checked + .segmented-btn.want-btn {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.segmented-option input:checked + .segmented-btn.private-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}

.segmented-option input:checked + .segmented-btn.public-btn {
    background: rgba(79, 70, 229, 0.15);
    border-color: rgba(79, 70, 229, 0.3);
    color: #818cf8;
}

/* Season and Month Chips */
.season-chips-container {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 5px;
}

.month-chips-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.season-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.season-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.season-chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.season-chip:has(input:checked) {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.season-chip.month-chip {
    min-width: 44px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.season-chip:active {
    transform: scale(0.95);
}

/* Custom Image Upload Zone */
.upload-zone {
    position: relative;
    border: 2px dashed var(--border);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 1.8rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.04);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.upload-icon {
    font-size: 2.2rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.upload-zone:hover .upload-icon {
    transform: translateY(-4px);
}

.upload-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.upload-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Dynamic Previews Gallery */
.modal-preview-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    animation: zoomIn 0.25s ease;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .modal {
        align-items: flex-end;
        background: rgba(0, 0, 0, 0.6);
    }
    
    .modal-content {
        max-height: 85vh;
        border-radius: 24px 24px 0 0;
        padding: 1.5rem;
        border-bottom: none;
        border-left: none;
        border-right: none;
        animation: slideUpBottomSheet 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    
    .bottom-sheet-handle {
        display: block;
        width: 36px;
        height: 5px;
        background: rgba(255, 255, 255, 0.15);
        border-radius: 10px;
        margin: -0.5rem auto 1.2rem auto;
    }
    
    .close-modal {
        top: 10px;
        right: 15px;
        font-size: 1.8rem;
        padding: 6px;
        z-index: 10;
    }
    
    .form-grid-3col {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-grid-3col .season-group {
        grid-column: span 2;
    }
    
    .modal-preview-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Notification System & Want-to-go List Styles --- */

/* Notification Dropdown Container */
.notification-dropdown-container {
    position: relative;
    display: inline-block;
}

/* Nav Item Badge */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: bold;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--glass-bg, #1a1a2e);
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Notification Dropdown Menu */
.notification-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 50px;
    width: 340px;
    background: rgba(22, 22, 33, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(15px);
    overflow: hidden;
    transform-origin: top right;
    animation: dropdown-scale 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdown-scale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main, #ffffff);
}

.notification-header a {
    color: var(--primary, #4f46e5);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: filter 0.2s;
}

.notification-header a:hover {
    filter: brightness(1.2);
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

/* Custom Scrollbar for Notification List */
.notification-list::-webkit-scrollbar {
    width: 6px;
}
.notification-list::-webkit-scrollbar-track {
    background: transparent;
}
.notification-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Notification Item */
.notification-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notification-item.unread {
    background: rgba(79, 70, 229, 0.05);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
}

.notification-text {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.notification-time {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Gallery Tab styles */
.gallery-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    border-bottom: 2px solid transparent;
    transition: all 0.25s;
    user-select: none;
}

.gallery-tab:hover {
    color: var(--text-main, #ffffff);
}

.gallery-tab.active {
    color: var(--primary, #4f46e5);
    border-bottom-color: var(--primary, #4f46e5);
}

/* Want List Section */
.want-lists-container {
    display: none; /* Initially hidden, shown when tab is active */
    animation: fade-in 0.3s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.want-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Want List Card */
.want-list-card {
    background: var(--glass-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 160px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.want-list-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary, #4f46e5);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.15);
}

.want-list-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--text-main, #ffffff);
    padding-right: 24px;
}

.want-list-card p {
    font-size: 0.85rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    line-height: 1.5;
    flex: 1;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.want-list-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.8rem;
    margin-top: auto;
}

.want-list-count {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary, #4f46e5);
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
}

.delete-wlist-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: rgba(239, 68, 68, 0.6);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    z-index: 5;
}

.delete-wlist-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Want List Details View */
.wlist-detail-view {
    display: none;
    animation: fade-in 0.3s ease-out;
}

.wlist-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Floating Dialog for Managing Spot Lists */
.spot-wlists-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 420px;
    background: rgba(20, 20, 30, 0.98);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    z-index: 1100;
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    animation: dialog-fade 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dialog-fade {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.dialog-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1090;
    backdrop-filter: blur(4px);
}

.dialog-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main, #ffffff);
}

.dialog-list {
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dialog-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.dialog-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dialog-list-item input {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary, #4f46e5);
}

.dialog-list-item span {
    font-size: 0.9rem;
    color: var(--text-main, #ffffff);
}

.dialog-create-form {
    display: flex;
    gap: 8px;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
}

.dialog-create-form input {
    flex: 1;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    font-size: 0.88rem;
    outline: none;
}

.dialog-create-form input:focus {
    border-color: var(--primary);
}
