/* General Body Styles */
    :root {
        --primary-color: #3498db;
        --secondary-color: #2c3e50;
        --background-color: #ecf0f1;
        --surface-color: #ffffff;
        --text-color: #34495e;
        --light-gray: #bdc3c7;
        --success-color: #2ecc71;
        --error-color: #e74c3c;
    }

    body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        margin: 0;
        padding: 0 0 80px 0; /* Add padding to the bottom to avoid content being hidden by the nav */
        background-color: var(--background-color);
        color: var(--text-color);
    }

    .container {
        padding: 20px;
        max-width: 1200px;
        margin: 0 auto;
    }

    /* --- Navigation --- */
    .navbar {
        background-color: var(--surface-color);
        box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        display: flex;
        justify-content: space-around;
        z-index: 1000;
    }

    .navbar a {
        color: var(--secondary-color);
        text-decoration: none;
        padding: 15px 10px;
        text-align: center;
        flex-grow: 1;
        transition: background-color 0.3s, color 0.3s;
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 12px;
    }

    .navbar a i {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .navbar a.active, .navbar a:hover {
        color: var(--primary-color);
        background-color: #f8f9fa;
    }

    /* Desktop Navigation */
    @media (min-width: 768px) {
        body {
            padding: 80px 0 0 0; /* Adjust body padding for top nav */
        }
        .navbar {
            top: 0;
            bottom: auto;
            justify-content: flex-start;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        .navbar a {
            flex-direction: row;
            font-size: 16px;
            padding: 20px;
            flex-grow: 0;
        }
        .navbar a i {
            font-size: 22px;
            margin-bottom: 0;
            margin-right: 8px;
        }
        .navbar .logout-link {
            margin-left: auto;
        }
    }


    /* --- Fullscreen Map --- */
    body.view-map {
        padding: 0;
        overflow: hidden;
    }

    body.view-map .main-content {
        height: 100vh;
        padding: 0;
    }

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

    /* --- Forms (Login, Register, Add Spot, Profile) --- */
    .form-container {
        max-width: 450px;
        margin: 40px auto;
        padding: 30px;
        background: var(--surface-color);
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .form-container h1 {
        text-align: center;
        color: var(--secondary-color);
        margin-bottom: 25px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
    }

    .form-group input, textarea {
        width: 100%;
        padding: 12px;
        border: 1px solid var(--light-gray);
        border-radius: 5px;
        box-sizing: border-box;
        transition: border-color 0.3s;
        font-family: inherit;
    }

    .form-group input:focus, textarea:focus {
        outline: none;
        border-color: var(--primary-color);
    }

    .btn {
        width: 100%;
        padding: 12px;
        border: none;
        border-radius: 5px;
        background-color: var(--primary-color);
        color: white;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
        transition: background-color 0.3s;
    }

    .btn:hover {
        background-color: #2980b9;
    }

    .form-link {
        text-align: center;
        margin-top: 20px;
    }

    .form-link a {
        color: var(--primary-color);
        text-decoration: none;
    }

    .error-message, .success-message {
        padding: 15px;
        margin-bottom: 20px;
        border-radius: 5px;
        text-align: center;
    }

    .error-message {
        background-color: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }

    .success-message {
        background-color: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }


    /* --- Forum View --- */
    .forum-container {
        max-width: 900px;
    }

    .forum-post {
        background: var(--surface-color);
        border-radius: 8px;
        padding: 20px;
        margin-bottom: 20px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        display: flex;
    }

    .post-author-info {
        flex-shrink: 0;
        margin-right: 20px;
        text-align: center;
    }

    .post-author-info img {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background-color: var(--light-gray);
    }

    .post-author-info .username {
        font-weight: bold;
        margin-top: 8px;
        font-size: 14px;
    }

    .post-content {
        flex-grow: 1;
    }

    .post-content p {
        margin: 0 0 15px 0;
        line-height: 1.6;
    }

    .post-meta {
        font-size: 12px;
        color: #7f8c8d;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .post-meta .spot-link a {
        background-color: var(--primary-color);
        color: white;
        padding: 5px 10px;
        border-radius: 5px;
        text-decoration: none;
        font-weight: bold;
    }

    /* --- Profile View --- */
    .profile-header {
        display: flex;
        align-items: center;
        margin-bottom: 30px;
    }
    .profile-header img {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        margin-right: 20px;
    }
    .profile-header h1 {
        margin: 0;
    }

    /* --- Map UI Fixes & Additions --- */
    .leaflet-control-zoom {
        z-index: 999 !important;
    }

    @media (max-width: 767px) {
        .leaflet-control-attribution {
            margin-bottom: 65px !important;
        }
    }

    .leaflet-control-locate a {
        font-size: 1.4em;
        line-height: 30px;
        text-align: center;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232c3e50"><path d="M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"/></svg>');
        background-repeat: no-repeat;
        background-position: center;
    }

    .user-location-marker .pulsating-circle {
        width: 20px;
        height: 20px;
        background: var(--primary-color);
        border-radius: 50%;
        border: 3px solid #fff;
        box-shadow: 0 0 5px rgba(0,0,0,0.5);
        animation: pulsate 2s ease-out infinite;
    }

    @keyframes pulsate {
        0% {
            transform: scale(0.1);
            opacity: 0.0;
        }
        50% {
            opacity: 1;
        }
        100% {
            transform: scale(1.2);
            opacity: 0.0;
        }
    }

    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        display: none; /* Changed from flex to none */
        align-items: center;
        justify-content: center;
        z-index: 1050;
        padding: 20px;
        box-sizing: border-box;
    }

    .modal-content-wrapper {
        background: var(--surface-color);
        border-radius: 8px;
        max-width: 500px;
        width: 100%;
        box-shadow: 0 5px 20px rgba(0,0,0,0.2);
        position: relative;
        overflow: hidden;
    }

    .close-modal {
        position: absolute;
        top: 10px;
        right: 15px;
        font-size: 30px;
        font-weight: bold;
        color: #fff;
        text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        cursor: pointer;
        z-index: 1;
    }

    #spot-detail-image {
        width: 100%;
        height: auto;
        max-height: 300px;
        object-fit: cover;
        display: block;
    }

    .spot-detail-info {
        padding: 20px;
    }

    .spot-detail-info p {
        margin: 0 0 20px 0;
    }

/* --- Landing Page --- */
.landing-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    background: var(--secondary-color);
    color: white;
    padding: 20px;
    box-sizing: border-box;
}

.landing-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.landing-content .lead {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.landing-content hr {
    border-color: var(--primary-color);
    width: 100px;
    margin: 2rem auto;
}

.landing-content .btn-lg {
    padding: 15px 30px;
    font-size: 1.2rem;
    margin-top: 2rem;
    width: auto;
}

/* --- Register Page Password Requirements --- */
#password-requirements {
    margin: 15px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid var(--light-gray);
}

#password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

#password-requirements li {
    color: var(--error-color);
    transition: color 0.3s;
}

#password-requirements li::before {
    content: '\2717'; /* Red X */
    margin-right: 8px;
}

#password-requirements li.valid {
    color: var(--success-color);
    text-decoration: line-through;
}

#password-requirements li.valid::before {
    content: '\2713'; /* Green check */
}