/* Global Styles */
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 85px 0 40px 0; /* Padding for global fixed navbar */
    background: linear-gradient(180deg, rgba(10, 24, 16, 0.94) 0%, rgba(5, 8, 6, 0.98) 100%), 
                url('images/campsite-background-v1.jpeg') no-repeat center center/cover fixed;
    min-height: 100vh;
    color: #fff;
    box-sizing: border-box;
}

/* Glassmorphism Container */
.container {
    margin: 0 auto; /* Horizontally center container */
    background: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    width: 90%;
    backdrop-filter: blur(5px);
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

/* Specific widths */
.container.narrow {
    max-width: 450px;
}

.container.wide {
    max-width: 800px;
}

.container.medium {
    max-width: 600px;
}

/* Typography */
h1 {
    font-size: 24px;
    margin-bottom: 25px;
    color: #fff;
    text-align: center;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
}

.header-row h1 {
    margin: 0;
    font-size: 2.2em;
    border: none;
    text-align: left;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ddd;
}

/* Inputs */
input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-sizing: border-box;
    transition: border-color 0.3s, background 0.3s;
}

input:focus {
    border-color: #28a745;
    outline: none;
    background: rgba(255, 255, 255, 0.2);
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    box-sizing: border-box;
    text-decoration: none;
}

.btn:hover {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ccc;
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    font-weight: normal;
    text-decoration: none;
    display: inline-block;
    /* Ensure it behaves like a button if it's an anchor */
    text-align: center;
}

.btn-outline:hover {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-block {
    display: block;
    width: 100%;
    margin-top: 15px;
}

/* Dashboard Cards */
.cards-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    width: 200px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.4);
    border-color: #28a745;
    background: rgba(255, 255, 255, 0.2);
}

.card-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #28a745;
}

.card-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.card-desc {
    font-size: 0.9em;
    color: #ddd;
    text-align: center;
}

/* Watch List Grid */
.watch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.watch-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.watch-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.admin-card {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
}

.admin-card:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
}

.watch-card h3 {
    margin: 0 0 10px 0;
    color: #28a745;
    font-size: 18px;
}

.watch-detail {
    font-size: 14px;
    color: #ddd;
    margin-bottom: 5px;
}

.watch-detail strong {
    color: #fff;
}

.watch-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.btn-card-action {
    flex: 1 1 120px;
    min-height: 38px;
    margin-top: 0;
    padding: 8px 10px;
    font-size: 13px;
}

/* Utilities */
.response {
    margin-top: 20px;
    font-size: 14px;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
}

.response.success {
    background-color: rgba(40, 167, 69, 0.2);
    color: #fff;
    border: 1px solid #28a745;
}

.response.error {
    background-color: rgba(220, 53, 69, 0.2);
    color: #fff;
    border: 1px solid #dc3545;
}

.loading {
    text-align: center;
    color: #ccc;
    font-style: italic;
    padding: 20px;
}

.error-msg {
    color: #ff6b6b;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #ff6b6b;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

/* Map Search Styles */
#map {
    height: 300px;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 6px;
    z-index: 1;
    /* Ensure it stays below the container overlay if needed, but Leaflet needs interaction */
}

.search-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.input-hint {
    font-size: 0.8em;
    color: #888;
    margin-top: -8px;
    margin-bottom: 12px;
}

.search-group input {
    margin-bottom: 0;
    /* Override default input margin */
}

.search-group button {
    width: auto;
    white-space: nowrap;
}

/* Readonly input style */
input[readonly] {
    background: rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
    color: #aaa;
}

/* Delete Button */
.btn-delete {
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
    border: 1px solid #ff5252;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: inline-block;
}

.btn-delete:hover {
    background: rgba(255, 82, 82, 0.4);
    transform: translateY(-1px);
}

/* Select Button */
.btn-select {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid #28a745;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: inline-block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.btn-select:hover {
    background: rgba(40, 167, 69, 0.4);
    transform: translateY(-1px);
}


/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(20, 20, 20, 0.95);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-content h3 {
    margin-top: 0;
    color: #fff;
}

.modal-content p {
    color: #ccc;
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* User Badge Container */
.user-badge {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
}

/* Avatar Button with Google Chrome Style */
.user-avatar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.pro-chip {
    background: #333;
    color: #e0e0e0;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 45px;
    height: 45px;
    /* Transparent center, gradient border */
    background: padding-box rgba(0, 0, 0, 0.6),
        border-box conic-gradient(#EA4335 0deg 90deg,
            #FBBC04 90deg 180deg,
            #34A853 180deg 270deg,
            #4285F4 270deg 360deg);
    border: 3px solid transparent;
    border-radius: 50%;

    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.user-avatar svg {
    fill: #e8e8e8;
    width: 24px;
    height: 24px;
}

/* Dropdown Menu */
.user-menu {
    position: absolute;
    top: 55px;
    right: 0;
    background: rgba(18, 18, 18, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 260px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
}

.user-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Profile Menu Header */
.profile-menu-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
}

.avatar-large {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.avatar-large svg {
    width: 28px;
    height: 28px;
    fill: #b3b3b3;
}

.profile-email {
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 6px;
}

.profile-plan-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 12px;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Profile Menu Body */
.profile-menu-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #b3b3b3;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.profile-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.profile-menu-item .icon {
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
}

/* Profile Menu Footer */
.profile-menu-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 10px;
    display: flex;
    justify-content: center;
}

.btn-signout {
    width: 100%;
    background: rgba(235, 94, 85, 0.1);
    color: #ff7675;
    border: 1px solid rgba(235, 94, 85, 0.2);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-signout:hover {
    background: rgba(235, 94, 85, 0.2);
    color: #ff5252;
    border-color: rgba(235, 94, 85, 0.4);
}

.impersonate-btn {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
    border-color: rgba(243, 156, 18, 0.2);
}

.impersonate-btn:hover {
    background: rgba(243, 156, 18, 0.2);
    color: #e67e22;
    border-color: rgba(243, 156, 18, 0.4);
}

/* --- Pricing Page Styles --- */
.pricing-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.pricing-card {
    background: #222;
    border: 1px solid #444;
    border-radius: 12px;
    padding: 30px;
    width: 300px;
    text-align: center;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.pricing-card.popular {
    border: 1px solid #27ae60;
    background: linear-gradient(145deg, rgba(39, 174, 96, 0.05) 0%, #222 100%);
    transform: scale(1.05);
    /* Slightly bigger */
    z-index: 10;
}

.pricing-card.popular:hover {
    transform: scale(1.05) translateY(-5px);
}

.pricing-card.premium {
    border: 1px solid #8e44ad;
    background: linear-gradient(145deg, rgba(142, 68, 173, 0.05) 0%, #222 100%);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #27ae60;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.pricing-card .card-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #fff;
}

.pricing-card .price {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: #fff;
}

.pricing-card .price span {
    font-size: 1rem;
    color: #888;
    font-weight: normal;
}

.pricing-card .features {
    text-align: left;
    margin-bottom: 30px;
    flex-grow: 1;
}

.pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pricing-card li {
    margin-bottom: 12px;
    color: #ddd;
    font-size: 0.95rem;
}

.pricing-card li.disabled {
    color: #666;
    text-decoration: line-through;
}

.pricing-card .check {
    color: #27ae60;
    margin-right: 8px;
    font-weight: bold;
}

.pricing-card .cross {
    color: #666;
    margin-right: 8px;
}

.btn-primary-gradient {
    background: linear-gradient(to right, #8e44ad, #9b59b6);
    color: white;
    border: none;
}

.btn-primary-gradient:hover {
    filter: brightness(1.1);
}

/* User Badge Hover fix */
.user-badge:hover+.user-menu,
.user-menu:hover {
    display: block;
}

.user-badge:hover .user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Premium Card */
.premium-card {
    border: 1px solid rgba(255, 215, 0, 0.3);
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.05) 0%, rgba(0, 0, 0, 0) 100%);
    cursor: pointer;
}

.premium-card:hover {
    border-color: rgba(255, 215, 0, 0.8);
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.1);
}

.premium-card .card-icon {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 500;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #27ae60;
    border: 1px solid #2ecc71;
}

.toast.error {
    background: #c0392b;
    border: 1px solid #e74c3c;
}

.user-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-email {
    padding: 10px;
    font-size: 0.85em;
    color: #ccc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 5px;
    word-break: break-all;
    text-align: center;
}

.user-menu-btn {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: center;
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.user-menu-btn:hover {
    background: rgba(255, 82, 82, 0.15);
}

/* Global Header / Navbar */
.app-header {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

.app-nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    gap: 16px;
    box-sizing: border-box;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25em;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    min-width: 0;
    white-space: nowrap;
}

.app-logo svg {
    fill: #2ecc71;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.app-nav a {
    color: #b3b3b3;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: color 0.3s;
}

.app-nav a:hover, .app-nav a.active {
    color: #2ecc71;
}

.nav-icon-link {
    width: 34px;
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.nav-heart-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn-nav-action {
    border: 1px solid #2ecc71;
    padding: 6px 12px;
    border-radius: 4px;
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.05);
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-nav-action:hover {
    background: #2ecc71;
    color: #000;
}

@media (max-width: 900px) {
    body {
        padding-top: 146px;
        padding-bottom: 24px;
    }

    .container {
        width: calc(100% - 24px);
        padding: 24px 16px;
        border-radius: 10px;
    }

    .container.wide,
    .container.medium,
    .container.narrow {
        max-width: calc(100% - 24px);
    }

    .header-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .header-row h1 {
        font-size: 1.7em;
    }

    .app-nav-container {
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 10px 16px;
        row-gap: 8px;
    }

    .app-logo {
        flex: 0 1 auto;
        justify-content: flex-start;
        font-size: 1.08em;
    }

    .app-logo svg {
        width: 22px;
        height: 22px;
    }

    #userBadge {
        flex: 0 1 auto;
        margin-left: auto;
        order: 2;
    }

    .app-nav {
        flex: 1 1 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
        order: 3;
        margin-top: 6px;
    }

    .app-nav a,
    .btn-nav-action {
        min-height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 7px 10px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.06);
        font-size: 0.8rem;
        line-height: 1.1;
        white-space: nowrap;
    }

    .app-nav .nav-icon-link {
        width: 36px;
        min-width: 36px;
        padding: 7px;
    }

    .btn-nav-action {
        border-color: rgba(46, 204, 113, 0.7);
    }

    .user-avatar {
        width: 38px;
        height: 38px;
    }

    .pro-chip {
        padding: 5px 9px;
        font-size: 0.72rem;
    }

    .user-menu {
        position: fixed;
        top: 138px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
    }
}

@media (max-width: 420px) {
    .app-nav-container {
        padding-inline: 10px;
    }

    .app-nav {
        gap: 5px;
    }

    .app-nav a,
    .btn-nav-action {
        padding-inline: 8px;
        font-size: 0.76rem;
    }
}
