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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #7c3aed;
    --danger-color: #dc2626;
    --success-color: #16a34a;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    padding: 30px 0;
    color: white;
}

.logo {
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.logo-png {
    width: 140px;
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* User Bar */
.user-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 15px;
    gap: 10px;
}

#user-logged-out,
#user-logged-in {
    display: flex;
    align-items: center;
    gap: 10px;
}

#user-logged-in span {
    color: white;
    font-weight: 500;
}

.modal-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.modal-switch a:hover {
    text-decoration: underline;
}

.btn-join {
    background: var(--success-color);
}

.btn-join:hover {
    background: #15803d;
}

/* Main Content */
main {
    flex: 1;
    background: var(--bg-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.host-main {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
}

/* Sessions Grid */
.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.session-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.session-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.session-date {
    display: flex;
    flex-direction: column;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* Session Type Badge */
.session-type-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.session-type-badge.shredclub {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.session-type-badge.rookie {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.session-type-badge.advanced {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.day-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.month-day {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.session-time {
    font-size: 1.5rem;
    font-weight: 700;
}

.session-duration {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.spots-left {
    font-weight: 600;
    color: var(--success-color);
}

.spots-left.low {
    color: #f59e0b;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-book {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-book:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.btn-full-disabled {
    background: var(--text-secondary);
    color: white;
    width: 100%;
    cursor: not-allowed;
    opacity: 0.7;
}

.session-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.session-card {
    position: relative;
}

.spots-left.full {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Month Filter */
.month-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.month-btn {
    padding: 8px 16px;
    font-size: 0.875rem;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.month-btn:hover {
    background: var(--border-color);
}

.month-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Time Checkboxes */
.time-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.time-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.time-checkbox:hover {
    border-color: var(--primary-color);
}

.time-checkbox input[type="checkbox"] {
    accent-color: var(--primary-color);
}

.time-checkbox input[type="checkbox"]:checked + span {
    color: var(--primary-color);
    font-weight: 500;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-text {
    background: #8b5cf6;
    color: white;
}

.btn-text:hover {
    background: #7c3aed;
}

.btn-edit {
    background: #64748b;
    color: white;
}

.btn-edit:hover {
    background: #475569;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.field-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    position: relative;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.modal-content.success {
    text-align: center;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}

#session-details,
#add-session-details {
    background: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
}

/* Host Sessions */
.host-sessions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.host-session-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.host-session-card.past {
    opacity: 0.6;
}

.host-session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.host-session-header h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.host-session-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.session-actions {
    display: flex;
    gap: 10px;
}

.bookings-container h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.bookings-list {
    list-style: none;
}

.bookings-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 5px 10px;
    font-size: 1rem;
    border-radius: 4px;
}

.btn-remove:hover {
    background: #fef2f2;
}

.no-bookings {
    color: var(--text-secondary);
    font-style: italic;
}

/* Waitlist Container */
.waitlist-container {
    background: #fffbeb;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
}

.waitlist-container h4 {
    color: #f59e0b;
    margin-bottom: 10px;
}

.waitlist-container .bookings-list li {
    background: #fef3c7;
}

/* Messages */
.message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.message.hidden {
    display: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
}

.host-link {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    font-size: 0.9rem;
}

.host-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Login Screen */
.login-card {
    max-width: 400px;
    margin: 0 auto;
}

.login-card h2 {
    text-align: center;
}

.setup-intro {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.btn-full {
    width: 100%;
}

.error-message {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-bottom: 15px;
    padding: 10px;
    background: #fef2f2;
    border-radius: 6px;
    text-align: center;
}

.success-message {
    color: var(--success-color);
    font-size: 0.9rem;
    margin-bottom: 15px;
    padding: 10px;
    background: #f0fdf4;
    border-radius: 6px;
    text-align: center;
}

/* Logout Bar */
.logout-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    gap: 10px;
}

.logout-bar span {
    font-weight: 500;
    color: var(--text-primary);
}

.logout-actions {
    display: flex;
    gap: 10px;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Section header with filter */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2 {
    margin-bottom: 0;
}

/* Filter toggle */
.filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.filter-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Favorite button */
.btn-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #cbd5e1;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.btn-favorite:hover {
    color: #f87171;
    transform: scale(1.1);
}

.btn-favorite.favorited {
    color: #ef4444;
}

.session-card {
    position: relative;
}

/* Participants list on session cards */
.session-participants {
    padding: 10px 15px;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.session-participants span {
    display: block;
}

.session-participants em {
    color: var(--primary-color);
    font-style: normal;
    font-size: 0.8rem;
}

/* Booking actions row */
.booking-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px 15px;
}

/* Analytics Dashboard */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

.analytics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.analytics-column h4 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.analytics-column ul,
#frequent-flyers ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.analytics-column li,
#frequent-flyers li {
    padding: 8px 12px;
    background: var(--bg-color);
    margin-bottom: 5px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.analytics-column li span:last-child,
#frequent-flyers li span:last-child {
    font-weight: 600;
    color: var(--primary-color);
}

/* Waitlist Button */
.btn-waitlist {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    width: 100%;
}

.btn-waitlist:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Booking Tabs */
.booking-tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab-btn:hover:not(.active) {
    background: var(--border-color);
}

/* Past Booking Card */
.past-booking {
    opacity: 0.7;
}

.completed-badge {
    display: inline-block;
    background: var(--success-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Calendar Buttons Container */
.calendar-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.calendar-buttons .btn {
    flex: 1;
    min-width: 120px;
}

/* Apple Calendar Button */
.btn-apple {
    background: #1d1d1f !important;
    color: white !important;
    border-color: #1d1d1f !important;
}

.btn-apple:hover {
    background: #333 !important;
    border-color: #333 !important;
}

/* Waitlist Info on Session Card */
.waitlist-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }

    .logo {
        width: 100px;
        height: 100px;
    }

    main {
        padding: 20px;
    }

    .card {
        padding: 20px;
    }

    .session-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .calendar-buttons {
        flex-direction: column;
    }

    .calendar-buttons .btn {
        width: 100%;
    }

    .booking-tabs {
        width: 100%;
    }

    .tab-btn {
        flex: 1;
    }
}
