/* New Haven Hangouts - Modern Soft UI */
@import url('https://fonts.googleapis.com/css2?family=Azeret+Mono:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* --- Default Theme (Soft Warm) --- */
    --bg-primary: #f5f1ed;
    --bg-secondary: #ede8e3;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-dark: #2d2d2d;

    /* Accents */
    --accent-primary: #ff9a6c;
    /* Warm Orange/Pink */
    --accent-secondary: #ff6b9d;
    --accent-gradient: linear-gradient(135deg, #ff9a6c 0%, #ff6b9d 50%, #ffa07a 100%);
    --accent-warm: linear-gradient(135deg, #ffb088 0%, #ff8c6b 100%);
    --accent-soft: linear-gradient(135deg, #f5e6d3 0%, #e8d5c4 100%);

    /* Text */
    --text-primary: #3d3d3d;
    --text-secondary: #8a8a8a;
    --text-light: #b5b5b5;
    --text-white: #ffffff;
    --text-dark: #1a1a1a;

    /* Shadows & Glass */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-strong: 0 12px 48px rgba(0, 0, 0, 0.15);

    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-blur: blur(12px);

    /* Misc */
    --border-medium: rgba(0, 0, 0, 0.2);
    --primary-color: var(--accent-secondary);

    /* Liquid Glass */
    --bg-glass-liquid: rgba(255, 255, 255, 0.35);
    --glass-blur-liquid: blur(20px);
}

/* --- Glacier Theme --- */
[data-theme="glacier"] {
    /* Palette: 
       Granite Ridge: #8E98A1
       Lake Mist: #D4CBC7
       Warm Clouds: #EFDCC3
       Glacial Fog: #F5EBE3
       Twilight Lupine: #BA908B
       Spring Meadows: #80864F
    */

    --bg-primary: #F5EBE3;
    /* Glacial Fog */
    --bg-secondary: #D4CBC7;
    /* Lake Mist */
    --bg-card: rgba(245, 235, 227, 0.85);
    /* Slightly opaque Glacial Fog */
    --bg-dark: #5c636b;
    /* Darker Granite */

    /* Accents */
    --accent-primary: #80864F;
    /* Spring Meadows */
    --accent-secondary: #BA908B;
    /* Twilight Lupine */

    /* Gradients adjusted for Glacier feel */
    --accent-gradient: linear-gradient(135deg, #8E98A1 0%, #707880 100%);
    /* Granite Ridge */
    --accent-warm: linear-gradient(135deg, #BA908B 0%, #9e7a75 100%);
    /* Twilight Lupine */
    --accent-soft: linear-gradient(135deg, #EFDCC3 0%, #e0cbb0 100%);
    /* Warm Clouds */

    --text-primary: #2C3E50;
    /* Dark Blue-Grey */
    --text-secondary: #5D6D7E;
    --text-light: #8E98A1;
    /* Granite Ridge */
    --text-dark: #1B2631;

    /* Glass override for cooler tones */
    --glass-bg: rgba(212, 203, 199, 0.3);
    /* Lake Mist tint */
    --glass-border: rgba(255, 255, 255, 0.4);

    --primary-color: var(--accent-primary);

    /* Liquid Glass Override */
    --bg-glass-liquid: rgba(212, 203, 199, 0.4);
}

body {
    font-family: 'Azeret Mono', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f5f1ed 0%, #ede8e3 100%);
}

/* Header - Glassmorphism Style */
.header {
    position: sticky;
    top: 0;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 1.25rem 1.5rem;
    padding-top: calc(1.25rem + env(safe-area-inset-top));
    box-shadow: var(--shadow-soft);
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-friends {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.625rem 1.125rem;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    box-shadow: var(--shadow-soft);
    letter-spacing: -0.2px;
}

.btn-friends:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.user-info {
    background: var(--glass-bg);
    padding: 0.625rem 1.25rem;
    border-radius: 30px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

.btn-logout {
    background: var(--bg-dark);
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.btn-logout:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

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

/* Controls Overlay */
.controls-overlay {
    position: fixed;
    bottom: calc(2rem + env(safe-area-inset-bottom));
    right: 1.5rem;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

/* Buttons - Soft Modern Style */
.btn {
    border: none;
    border-radius: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: var(--shadow-soft);
    letter-spacing: -0.3px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    border-radius: 24px;
}

.btn-checkin {
    background: rgba(255, 176, 136, 0.65);
    /* Fallback */
    background: linear-gradient(135deg, rgba(255, 176, 136, 0.65) 0%, rgba(255, 140, 107, 0.65) 100%);
    backdrop-filter: var(--glass-blur-liquid);
    -webkit-backdrop-filter: var(--glass-blur-liquid);
    color: white;
    padding: 1.125rem 2rem;
    font-size: 1.0625rem;
    white-space: nowrap;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(255, 140, 107, 0.2);
}

.btn-refresh {
    background: var(--bg-glass-liquid);
    backdrop-filter: var(--glass-blur-liquid);
    -webkit-backdrop-filter: var(--glass-blur-liquid);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    font-size: 0.9375rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.btn-coming {
    background: var(--accent-warm);
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    width: 100%;
    margin-top: 0.625rem;
    border-radius: 20px;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* Login Modal - Glassmorphism */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(237, 232, 227, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 32px;
    box-shadow: var(--shadow-strong);
    max-width: 420px;
    width: 90%;
    text-align: center;
}

.modal-content h2 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

.modal-content input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1.5px solid rgba(141, 141, 141, 0.15);
    border-radius: 20px;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
}

.modal-content input::placeholder {
    color: var(--text-light);
}

.modal-content input:focus {
    outline: none;
    border-color: var(--accent-warm);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(255, 154, 108, 0.1);
}

/* Password Toggle Styling */
.password-input-container {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    /* Ensure it's visible */
    transition: all 0.2s;
    z-index: 5;
    width: 40px;
    height: 40px;
}

.password-toggle:hover {
    color: var(--accent-primary);
    transform: translateY(-50%) scale(1.1);
}

.eye-icon {
    width: 24px;
    height: 24px;
    pointer-events: none;
}

.password-input-container input {
    padding-right: 50px !important;
    margin-bottom: 0 !important;
}

/* Remember Me Styling */
.remember-me {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    cursor: pointer;
    background: rgba(255, 154, 108, 0.05);
    border-radius: 12px;
}

.remember-me input {
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* Disclosure Modal Specifics */
.disclosure-content {
    max-width: 480px;
    padding: 2.5rem;
    text-align: left;
}

.disclosure-content h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.disclosure-body {
    margin-bottom: 2rem;
}

.disclosure-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: rgba(255, 154, 108, 0.05);
    border-radius: 16px;
}

.disclosure-icon {
    font-size: 1.5rem;
}

.disclosure-text {
    font-size: 0.9375rem;
    line-height: 1.4;
}

.disclosure-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.disclosure-actions .btn {
    width: 100%;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem;
    font-weight: 500;
}




/* Check-in Form - Soft Glassmorphism */
.checkin-form {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 32px 32px 0 0;
    box-shadow: var(--shadow-strong);
    z-index: 1000;
    max-height: 80vh;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(141, 141, 141, 0.1);
}

.form-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.form-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

.form-body input,
.form-body textarea,
.form-body select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1.5px solid rgba(141, 141, 141, 0.15);
    border-radius: 20px;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
}

.form-body input::placeholder,
.form-body textarea::placeholder {
    color: var(--text-light);
}

.form-body input:focus,
.form-body textarea:focus,
.form-body select:focus {
    outline: none;
    border-color: #ff9a6c;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(255, 154, 108, 0.1);
}

.form-body select {
    color: var(--text-primary) !important;
    opacity: 1;
    -webkit-text-fill-color: var(--text-primary);
}

.form-body textarea {
    resize: vertical;
    min-height: 90px;
}

.form-body label {
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0.5rem;
    font-size: 0.875rem;
    letter-spacing: -0.2px;
}

/* Custom Popup Styles */
.custom-popup .leaflet-popup-content-wrapper {
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.custom-popup .leaflet-popup-content {
    margin: 0;
}

.checkin-popup {
    padding: 0.5rem;
}

.checkin-popup h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.checkin-popup .location {
    color: var(--text-dark);
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
}

.checkin-popup .message {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
    font-style: italic;
}

.checkin-popup .time {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-title {
        font-size: 1.25rem;
    }

    .user-info {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }

    /* Mobile Header Fixes */
    .header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
        overflow-x: auto;
        padding-bottom: 2px;
        /* For scrollbar if needed */
    }

    .btn-friends {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .controls-overlay {
        bottom: calc(1rem + env(safe-area-inset-bottom));
        right: 0.75rem;
    }

    .btn-checkin {
        font-size: 0.9375rem;
        padding: 0.875rem 1.25rem;
    }

    .checkin-form {
        max-height: 85vh;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.125rem;
    }

    .modal-content {
        padding: 2rem 1.5rem;
    }

    .modal-content h2 {
        font-size: 1.75rem;
    }
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}

/* View Toggle - Glassmorphism */
.view-toggle {
    position: absolute;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    background: var(--bg-glass-liquid);
    backdrop-filter: var(--glass-blur-liquid);
    -webkit-backdrop-filter: var(--glass-blur-liquid);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 0.375rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 0.375rem;
}

.toggle-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    letter-spacing: -0.2px;
}

.toggle-btn.active {
    background: var(--accent-warm);
    color: white;
    box-shadow: var(--shadow-soft);
}

.toggle-btn:hover:not(.active) {
    background: rgba(255, 154, 108, 0.1);
    color: var(--text-primary);
}

/* View Containers */
.view-container {
    width: 100%;
    height: 100%;
}

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

/* List View */
.list-content {
    padding: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    height: 100%;
    overflow-y: auto;
}

.list-content h2 {
    font-size: 1.875rem;
    margin-bottom: 2rem;
    margin-top: 3.5rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.5px;
}

.no-checkins {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
    font-size: 1.125rem;
}

/* Check-in Cards - Soft Glassmorphism */
.checkin-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkin-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-3px);
}

.checkin-card.own-checkin {
    border-left: 4px solid #ff9a6c;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 224, 208, 0.3) 100%);
}

.checkin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.875rem;
}

.checkin-user {
    font-weight: 600;
    font-size: 1.1875rem;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.checkin-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.375rem;
}

.checkin-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.checkin-duration {
    font-size: 0.75rem;
    color: #ff8c6b;
    font-weight: 700;
    background: rgba(255, 154, 108, 0.15);
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
}

.checkin-location {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.625rem;
}

.checkin-message {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.875rem;
}

.btn-coming-small {
    background: var(--accent-warm);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-soft);
}

.btn-coming-small:hover {
    background: linear-gradient(135deg, #ff8c6b 0%, #ff7a58 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.your-checkin-badge {
    display: inline-block;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Search Container */
.search-container {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: var(--shadow-md);
}

.search-result-item {
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

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

.result-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.result-address {
    font-size: 0.875rem;
    color: var(--text-light);
}

.no-results,
.searching {
    padding: 1rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

.searching {
    color: var(--accent-primary);
    font-weight: 500;
}


/* OR Divider */
.or-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 0.5rem 0;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.or-divider span {
    padding: 0 1rem;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.875rem;
}

.btn-secondary {
    background: white;
    border: 2px solid #e5e7eb;
    color: var(--text-dark);
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-secondary:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-1px);
}

/* Delete Button Styles */
.btn-delete {
    background: #ef4444;
    color: white;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    width: 100%;
    margin-top: 0.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-delete-small {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-delete-small:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Attendees List Styles */
.attendees-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--success-color);
}

.attendees-icon {
    font-size: 1rem;
}

.attendees-text {
    font-size: 0.875rem;
    color: var(--text-dark);
    font-weight: 500;
}

.checkin-popup .attendees {
    font-size: 0.875rem;
    color: var(--text-dark);
    margin-bottom: 0.375rem;
}

/* Responsive Updates */
@media (max-width: 768px) {
    .list-content {
        padding: 1rem;
    }

    .list-content h2 {
        font-size: 1.5rem;
        margin-top: 4rem;
    }

    .view-toggle {
        top: calc(4rem + env(safe-area-inset-top));
    }

    .toggle-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
}

/* Authentication Tabs - Soft Modern */
.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: rgba(141, 141, 141, 0.05);
    border-radius: 20px;
    padding: 0.375rem;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    letter-spacing: -0.2px;
}

.auth-tab.active {
    background: var(--bg-dark);
    color: white;
    box-shadow: var(--shadow-soft);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

.auth-message {
    margin-top: 1.25rem;
    min-height: 1.5rem;
    text-align: center;
}

.auth-message .error {
    color: #ef4444;
    font-size: 0.9375rem;
    font-weight: 600;
}

.auth-message .success {
    color: #ff8c6b;
    font-size: 0.9375rem;
    font-weight: 600;
}

/* Header Right Section */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-friends {
    background: var(--bg-dark);
    color: white;
    padding: 0.625rem 1.125rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    letter-spacing: -0.2px;
}

.btn-friends:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
}

/* Friends Page - Soft Glassmorphism */
.friends-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    overflow-y: auto;
    height: calc(100vh - 80px);
}

.friends-section {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
}

.friends-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.75rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3125rem 0.75rem;
    border-radius: 24px;
    min-width: 26px;
    box-shadow: var(--shadow-soft);
}

/* Add Friend Form */
.add-friend-form {
    display: flex;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}

.add-friend-form input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 1.5px solid rgba(141, 141, 141, 0.15);
    border-radius: 20px;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
}

.add-friend-form input::placeholder {
    color: var(--text-light);
}

.add-friend-form input:focus {
    outline: none;
    border-color: #ff9a6c;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(255, 154, 108, 0.1);
}

.message-container {
    min-height: 1.75rem;
}

.message {
    padding: 0.875rem 1.25rem;
    border-radius: 16px;
    font-size: 0.9375rem;
    font-weight: 500;
}

.message.success {
    background: rgba(255, 154, 108, 0.12);
    color: #ff8c6b;
    border: 1px solid rgba(255, 154, 108, 0.25);
}

.message.error {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Friend Cards */
.friends-list,
.friend-requests-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 2rem 1rem;
    font-size: 0.9375rem;
}

.friend-card,
.friend-request-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.friend-card:hover,
.friend-request-card:hover {
    background: white;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.friend-request-card {
    justify-content: space-between;
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.friend-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.friend-details {
    flex: 1;
}

.friend-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.125rem;
}

.friend-email {
    font-size: 0.875rem;
    color: var(--text-light);
}

.friend-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-success {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Back Link */
.header-left {
    min-width: 150px;
}

.back-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive - Friends Page */
@media (max-width: 768px) {
    .friends-page {
        padding: 1rem 0.75rem;
    }

    .friends-section {
        padding: 1.25rem;
    }

    .friends-section h2 {
        font-size: 1.25rem;
    }

    .add-friend-form {
        flex-direction: column;
    }

    .friend-request-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .friend-actions {
        width: 100%;
    }

    .btn-success,
    .btn-danger {
        flex: 1;
    }

    .header-right {
        gap: 0.5rem;
    }

    .btn-friends {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Friend Selection Styles */
.friend-selection-section {
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.4);
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(141, 141, 141, 0.1);
}

.visibility-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0.5rem 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.radio-label input[type="radio"] {
    flex-shrink: 0;
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.friend-list-container {
    margin-top: 0.75rem;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid rgba(141, 141, 141, 0.1);
    border-radius: 12px;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.3);
}

.select-all-container {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(141, 141, 141, 0.1);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: flex-start;
}

/* Custom Round Checkbox */
.friend-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.5rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease;
    justify-content: flex-start;
    touch-action: manipulation;
    user-select: none;
    /* Prevent text selection on whole row */
}

.friend-checkbox-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.friend-name-text {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.friend-check {
    /* Remove default styling */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Create custom circle */
    width: 20px;
    height: 20px;
    min-width: 20px;
    /* Prevent shrinking */
    max-width: 20px;
    /* Prevent growing */
    border-radius: 50%;
    border: 2px solid var(--text-secondary);
    background-color: white;
    /* Ensure opaque background */
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-right: 0;
    /* Removing double gap, handled by parent flex gap */
    flex: 0 0 20px;
    /* Strict flex sizing */
    display: inline-block;
    /* Ensure block model */
}

/* Checked state */
.friend-check:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Checkmark using pseudo-element */
.friend-check:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.friend-name {
    font-size: 0.9375rem;
    color: var(--text-primary);
    flex: 1;
    text-align: left;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem;
}

/* --- FAB Navigation --- */
.fab-container {
    position: fixed;
    bottom: calc(2rem + env(safe-area-inset-bottom));
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 1rem;
}

.fab-main {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    box-shadow: var(--shadow-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2002;
    color: white;
}

.fab-main:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-strong);
}

.fab-main.active {
    background: var(--text-primary);
    transform: rotate(90deg);
}

.fab-icon {
    font-size: 1.5rem;
    font-weight: bold;
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: var(--bg-glass-liquid);
    backdrop-filter: var(--glass-blur-liquid);
    -webkit-backdrop-filter: var(--glass-blur-liquid);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 1rem;
    width: 220px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transform-origin: bottom right;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fab-menu.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

.menu-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.menu-item {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.93rem;
    text-align: left;
}

.menu-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.item-logout {
    color: #ff6b6b;
}

.item-logout:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* Hide original header */
.header {
    display: none !important;
}

/* Adjust overlay controls to not overlap with FAB */
.controls-overlay {
    bottom: calc(2rem + env(safe-area-inset-bottom));
    left: 1.5rem;
    /* Move to left side or adjust position */
    right: auto;
    align-items: flex-start;
}

/* Small correction for mobile checks-ins button */
@media (max-width: 768px) {
    .controls-overlay {
        bottom: calc(6rem + env(safe-area-inset-bottom));
        /* Move up above bottom nav area if needed */
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: max-content;
        align-items: center;
    }
}

/* --- Notification System --- */
.notification-btn {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1500;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-glass-liquid);
    backdrop-filter: var(--glass-blur-liquid);
    -webkit-backdrop-filter: var(--glass-blur-liquid);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.notification-btn:hover {
    transform: translateY(-2px) scale(1.05);
    background: rgba(255, 255, 255, 0.8);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #FF4D4D;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge-hidden {
    display: none;
}

/* Notifications Modal */
.notifications-modal-content {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    border-radius: 28px;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-strong);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.1);
}

.notifications-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.notifications-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 0.75rem;
}

.notification-item {
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.notification-item.unread {
    background: rgba(255, 154, 108, 0.1);
    /* Warm accent tint */
    border: 1px solid rgba(255, 154, 108, 0.3);
}

.notification-item.unread::after {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 8px;
    height: 8px;
    background: #ff4d4d;
    border-radius: 50%;
}

.notification-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    padding-right: 1rem;
}

.notification-body {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-light);
    display: block;
    text-align: right;
}

.empty-notifications {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.actions-footer {
    padding: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
}

/* Popular Location Marker */
.popular-location-icon {
    background: linear-gradient(135deg, #FF6B9D 0%, #FF9A6C 100%);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

.popular-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-bottom: 4px;
    font-weight: 700;
}