/* 
   ===== DARK EXPLORER JOURNAL - SYSTEM STYLES =====
   This file contains all the "looks" for our website.
   We use CSS variables (like --primary-color) to make it easy to change colors later.
*/

/* Universal Box Sizing Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --background: #0b0a09;
    /* Very dark brown/black */
    --card-bg: #13110e;
    /* Slightly lighter dark brown for cards */
    --primary: #d4a853;
    /* Gold/Amber for highlights */
    --secondary: #7a9e7e;
    /* Sage Green for badges */
    --text: #e8e0d0;
    /* Warm white for readability */
    --text-muted: #8a7f6e;
    /* Muted text for descriptions */
    --error: #e74c3c;
    /* Red for errors */

    /* Spacing */
    --gap: 20px;
    --border-radius: 8px;
}

/* Base Body Styles */
body {
    background-color: var(--background);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Global Utilities */
.hidden {
    display: none !important;
}

h1,
h2,
h3,
h4,
.brand {
    font-family: 'Playfair Display', serif;
    color: var(--primary);
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== NAVBAR & SIDEBAR ===== */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: var(--background);
    border-bottom: 1px solid rgba(212, 168, 83, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--primary) !important;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.brand img {
    height: 55px; /* Larger logo for better visibility */
    width: auto;
    object-fit: contain;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.brand:hover img {
    transform: scale(1.15); /* Zoom in on hover */
}

.hamburger {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--primary);
    transition: 0.3s;
    border-radius: 2px;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background: var(--card-bg);
    z-index: 2000;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 40px 30px;
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(212, 168, 83, 0.1);
    padding-bottom: 20px;
}

.sidebar-links {
    list-style: none;
    padding: 0;
}

.sidebar-links li {
    margin-bottom: 25px;
}

.sidebar-links a {
    font-size: 1.1rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.3s;
}

.sidebar-links a i {
    color: var(--primary);
    width: 20px;
}

.sidebar-links a:hover {
    color: var(--primary);
    transform: translateX(8px);
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1999;
    display: none;
    opacity: 0;
    transition: 0.3s;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.btn-auth {
    border: 1px solid var(--primary);
    padding: 6px 15px;
    border-radius: var(--border-radius);
    transition: 0.3s;
    font-size: 0.9rem;
}

/* ===== HERO SECTION ===== */
.hero {
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 10%;
    /* Subtle gradient background */
    background: linear-gradient(rgba(11, 10, 9, 0.7), rgba(11, 10, 9, 0.7)), url('https://images.unsplash.com/photo-1441974231531-c6227db76b6e?auto=format&fit=crop&q=80&w=2000');
    background-size: cover;
    background-position: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
}

/* ===== SEARCH & FILTER ===== */
.search-container {
    margin-top: 30px;
    width: 100%;
    max-width: 500px;
    display: flex;
    gap: 10px;
}

input,
select,
textarea {
    background: var(--card-bg);
    border: 1px solid var(--text-muted);
    color: var(--text);
    padding: 12px 15px;
    border-radius: var(--border-radius);
    width: 100%;
}

button {
    background: var(--primary);
    color: var(--background);
    border: none;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

button:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* ===== GRID & CARDS ===== */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--gap);
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: 0.3s ease;
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.card-img {
    height: 200px;
    width: 100%;
    object-fit: cover;
}

.card-content {
    padding: 20px;
}

.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-category {
    background: var(--secondary);
    color: white;
}

.badge-budget {
    background: rgba(212, 168, 83, 0.2);
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* ===== UTILITIES ===== */
.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

/* ===== FORMS ===== */
.auth-form {
    max-width: 400px;
    margin: 80px auto;
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--border-radius);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

/* ===== MAP STYLES ===== */
.map-container {
    height: 300px;
    width: 100%;
    margin: 15px 0;
    border-radius: var(--border-radius);
    border: 1px solid rgba(212, 168, 83, 0.2);
    overflow: hidden;
}

#map-search {
    margin-bottom: 10px;
}

.map-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -10px;
    margin-bottom: 15px;
}

.location-marker {
    background: var(--primary);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
}

/* For Explore Split View */
.explore-container {
    display: flex;
    height: calc(100vh - 80px);
    /* Subtract nav height */
    overflow: hidden;
}

.explore-sidebar {
    width: 40%;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    border-right: 1px solid rgba(212, 168, 83, 0.1);
}

.explore-map-container {
    width: 60%;
    height: 100%;
}

@media (max-width: 768px) {
    .explore-container {
        flex-direction: column;
        height: auto;
    }

    .explore-sidebar,
    .explore-map-container {
        width: 100%;
        height: 500px;
    }
}

/* Filter Buttons */
.filter-btn {
    background: var(--card-bg);
    color: var(--text-muted);
    border: 1px solid rgba(212, 168, 83, 0.2);
    padding: 6px 15px;
    font-size: 0.85rem;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--background);
    border-color: var(--primary);
}

/* Legend Styles */
.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.legend-item .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    border: 2px solid #fff;
}

.legend-item strong {
    display: block;
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 2px;
}

.legend-item small {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Review Styles */
.review-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-left: 3px solid var(--primary);
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.review-user {
    font-weight: bold;
    color: var(--text);
}

.review-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.review-stars {
    color: var(--primary);
    font-size: 0.9rem;
}

.review-comment {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Interactive Star Rating */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 10px;
    font-size: 1.5rem;
}

.star-rating input {
    display: none;
}

.star-rating label {
    color: #444;
    cursor: pointer;
    transition: 0.2s;
}

.star-rating label:hover,
.star-rating label:hover~label,
.star-rating input:checked~label {
    color: var(--primary);
}

/* Review Styles */
.review-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-left: 3px solid var(--primary);
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.review-user {
    font-weight: bold;
    color: var(--text);
}

.review-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.review-stars {
    color: var(--primary);
    font-size: 0.9rem;
}

.review-comment {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Star Rating remains as defined above */

/* ===== MOBILE RESPONSIVE TWEAKS ===== */
@media (max-width: 768px) {
    /* Navbar layout */
    nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 5px 15px;
        height: 70px;
    }

    /* Group hamburger and brand on the left using margin-right: auto on the brand */
    .brand {
        margin-right: auto;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .nav-links {
        display: flex; /* Show nav links but filter them */
        gap: 10px;
        margin-left: 10px;
    }

    /* Hide individual links that are in the sidebar already */
    .nav-links > li:not(#nav-auth-links):not(#nav-user-info) {
        display: none;
    }

    /* Style the auth buttons for mobile compactness */
    .nav-links a {
        font-size: 0.85rem;
        padding: 5px 10px;
    }

    .btn-auth {
        padding: 5px 12px;
    }
    
    .hamburger {
        display: flex;
        margin-right: 5px;
    }

    .brand {
        font-size: 1.1rem;
    }

    .brand img {
        height: 40px; 
    }
    
    /* Hero Section */
    .hero {
        padding: 40px 5%;
        min-height: 45vh;
        height: auto;
    }
    
    .hero h1 {
        font-size: 2.1rem;
        line-height: 1.1;
    }
    

    
    .hero p {
        font-size: 0.95rem;
        margin-top: 10px;
    }
    
    .search-container {
        flex-direction: column;
        width: 90%;
        margin: 30px auto 0;
    }
    
    /* Forms */
    .auth-form {
        margin: 30px 20px;
        padding: 30px 20px;
        width: auto;
        max-width: 100%;
    }

    .form-group {
        margin-bottom: 25px;
    }
    
    /* Ensure grid is full width on mobile */
    .grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    /* Reduce Explore split view heights */
    .explore-sidebar,
    .explore-map-container {
        height: 400px;
    }
    
    /* Reduce map container height slightly */
    .map-container {
        height: 250px;
    }
    
    /* Legend grid stack */
    .legend-grid {
        grid-template-columns: 1fr;
    }
    
    /* Wrap Category Buttons */
    .mt-20 {
        flex-wrap: wrap;
    }

    /* Wrap Input fields in Add Spot */
    input, select, textarea {
        box-sizing: border-box; 
        max-width: 100%;
    }

    /* Ensure flex form rows wrap or stack natively */
    form > div {
        flex-wrap: wrap !important;
    }

    /* Stop user name overflowing the nav */
    #user-name {
        text-align: center;
        width: 100%;
    }
}

/* ===== LOADING OVERLAY ===== */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 10, 9, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(212, 168, 83, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    color: var(--primary);
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

/* ===== CUSTOM TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--card-bg);
    color: var(--text);
    padding: 15px 25px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    max-width: 450px;
    transform: translateX(120%);
    transition: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
}

.toast.active {
    transform: translateX(0);
}

.toast.error {
    border-left-color: #ff4757;
}

.toast.info {
    border-left-color: #70a1ff;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-message {
    font-size: 0.95rem;
    flex: 1;
}

.toast-close {
    cursor: pointer;
    opacity: 0.5;
    transition: 0.3s;
}

.toast-close:hover {
    opacity: 1;
}

@media (max-width: 480px) {
    .toast-container {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
    }
    .toast {
        min-width: auto;
    }
}