:root {
    --primary-cyan: #00AEEF;
    --primary-cyan-dark: #0098d4;
    --dark-bg: #1a1a1a;
    --dark-gray: #2d2d2d;
    --light-gray: #f8f9fa;
    --text-white: #ffffff;
    --text-dark: #333333;
    --personal-training: #22c55e;
    --small-group: #fbbf24;
    --group-class: #ef4444;
    --success: #06d6a0;
    --warning: #f77f00;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-gray);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Il contenuto principale si espande per spingere il footer in fondo */
.calendar-section,
.login-page,
.preno-page,
.dashboard-section {
    flex: 1;
}

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

/* Navbar */
.navbar {
    background-color: var(--dark-bg);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    height: 48px;
    width: auto;
    display: block;
    border-radius: 6px;
    color-scheme: light;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-cyan);
    background-color: rgba(0, 174, 239, 0.1);
}

.admin-link {
    border: 1px solid var(--primary-cyan);
}

/* ===== Hamburger + Sidebar nav ===== */
.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.nav-right .nav-desktop-links {
    margin-right: 0.5rem;
}

.nav-hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.nav-hamburger:hover {
    background: rgba(255,255,255,0.12);
}

.nav-hamburger svg {
    width: 26px;
    height: 26px;
    color: white;
    display: block;
}

/* Sidebar overlay */
.nav-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.nav-sidebar-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* Sidebar panel */
.nav-sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 270px;
    height: 100vh;
    height: 100dvh;
    background: var(--dark-bg);
    z-index: 1600;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 40px rgba(0,0,0,0.5);
    border-left: 1px solid rgba(255,255,255,0.06);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-sidebar.open {
    right: 0;
}

.nav-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-sidebar-logo {
    height: 42px;
    width: auto;
    border-radius: 6px;
    color-scheme: light;
}

.nav-sidebar-close {
    background: rgba(255,255,255,0.08);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.nav-sidebar-close:hover {
    background: rgba(255,255,255,0.18);
}

.nav-sidebar-close svg {
    width: 16px;
    height: 16px;
    color: white;
    display: block;
}

.nav-sidebar-links {
    list-style: none;
    padding: 0.75rem 0;
    flex: 1;
}

.nav-sidebar-links li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1.5rem;
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

.nav-sidebar-links li a:hover {
    color: var(--primary-cyan);
    background: rgba(0,174,239,0.1);
    border-left-color: var(--primary-cyan);
}

.nav-sidebar-links li + li {
    border-top: 1px solid rgba(255,255,255,0.05);
}

body.nav-open {
    overflow: hidden;
}

/* ===== Desktop nav links (visibili solo su desktop) ===== */
.nav-desktop-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.nav-desktop-links li a {
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}

.nav-desktop-links li a:hover,
.nav-desktop-links li a.active {
    color: var(--primary-cyan);
    background: rgba(0,174,239,0.1);
}

/* Su desktop: nascondi hamburger e sidebar */
@media (min-width: 769px) {
    .nav-hamburger {
        display: none;
    }

    .nav-sidebar,
    .nav-sidebar-overlay {
        display: none !important;
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #111 50%, #1a2a2a 100%);
    color: var(--text-white);
    padding: 4rem 0 3.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0,174,239,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-name {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 0.3rem;
    line-height: 1.1;
}

.hero-role {
    font-size: 1rem;
    color: var(--primary-cyan);
    letter-spacing: 5px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 1.75rem;
}

.hero-description {
    font-size: 1rem;
    opacity: 0.8;
    max-width: 520px;
    margin: 0 auto 2rem;
    line-height: 1.75;
}

.whatsapp-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 58px;
    height: 58px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
    transition: all 0.3s;
    z-index: 1000;
}

.whatsapp-fab svg {
    width: 30px;
    height: 30px;
}

.whatsapp-fab:hover {
    background-color: #1ebe5a;
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.55);
}

.hero-info {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.hero-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 0.55rem 1.2rem;
    border-radius: 50px;
    font-size: 0.8rem;
    backdrop-filter: blur(4px);
}

.hero-info-item svg {
    width: 16px;
    height: 16px;
    color: var(--primary-cyan);
    flex-shrink: 0;
}

.hero-info-link {
    text-decoration: none;
    color: inherit;
    transition: background 0.2s, border-color 0.2s;
}

.hero-info-link:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.25);
}

/* Calendar Section */
.calendar-section {
    padding: 3rem 0;
}

.calendar-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--dark-bg);
}

/* Legend */
.legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.color-box {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    border: 2px solid #ddd;
}

.color-box.personal-training {
    background-color: var(--personal-training);
}

.color-box.small-group {
    background-color: var(--small-group);
}

.color-box.group-class {
    background-color: var(--group-class);
}

.legend-note {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* Calendar Controls */
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.calendar-controls h3 {
    color: var(--dark-bg);
    flex: 1;
    text-align: center;
}

.btn-control {
    background-color: var(--primary-cyan);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-control:hover {
    background-color: var(--primary-cyan-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 174, 239, 0.3);
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 2px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-header {
    background-color: var(--dark-bg);
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: bold;
}

.calendar-time {
    background-color: var(--dark-gray);
    color: white;
    padding: 1rem 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-slot {
    background-color: white;
    padding: 0.75rem;
    min-height: 80px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.calendar-slot:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
}

.calendar-slot.has-booking {
    color: #111;
    font-weight: 500;
}

.calendar-slot.has-booking.personal-training {
    background: linear-gradient(135deg, var(--personal-training) 0%, #16a34a 100%);
}

.calendar-slot.has-booking.small-group {
    background: linear-gradient(135deg, var(--small-group) 0%, #d97706 100%);
}

.calendar-slot.has-booking.group-class {
    background: linear-gradient(135deg, var(--group-class) 0%, #dc2626 100%);
}

.calendar-slot.selected {
    border: 3px solid var(--primary-cyan);
    box-shadow: 0 0 20px rgba(0, 174, 239, 0.4);
}

.slot-type {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.slot-spots {
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.spots-dark   { color: #111; }
.spots-green  { color: #16a34a; }
.spots-orange { color: #ea7b0a; }
.spots-red    { color: #dc2626; }

.slot-full {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Split slot: due tipi nella stessa cella del calendario */
.calendar-slot.split-slot {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
    background: none;
}
.split-slot-half {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.2rem;
    text-align: center;
    min-width: 0;
    font-weight: 500;
    color: #111;
}
.split-slot-half.personal-training {
    background: linear-gradient(135deg, var(--personal-training) 0%, #16a34a 100%);
}
.split-slot-half.small-group {
    background: linear-gradient(135deg, var(--small-group) 0%, #d97706 100%);
}
.split-slot-half.group-class {
    background: linear-gradient(135deg, var(--group-class) 0%, #dc2626 100%);
}
.split-slot-half .slot-type  { font-size: 0.72rem; }
.split-slot-half .slot-spots { font-size: 0.65rem; }

/* Booking Section */
.booking-section {
    background-color: white;
    padding: 3rem 0;
}

.booking-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--dark-bg);
}

.selected-slot-info {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-cyan);
}

.selected-slot-info h3 {
    color: var(--primary-cyan);
    margin-bottom: 0.5rem;
}

.remaining-slots {
    font-weight: bold;
    color: var(--success);
    margin-top: 0.5rem;
}

/* Booking Form */
.booking-form {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--light-gray);
    padding: 2rem;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-bg);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

.btn-primary {
    background-color: var(--primary-cyan);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-primary:hover {
    background-color: var(--primary-cyan-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 174, 239, 0.3);
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Confirmation Message */
.confirmation-message {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--success);
    color: white;
    border-radius: 8px;
    text-align: center;
}

.confirmation-message h3 {
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background-color: var(--dark-bg);
    color: var(--text-white);
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

/* Mobile View - Vertical Calendar */
.mobile-calendar {
    display: none;
}

/* Mobile week navigation */
.mobile-week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mobile-week-btn {
    background: var(--primary-cyan);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    transition: background 0.2s;
    flex-shrink: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: inherit;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.mobile-week-btn:hover:not(:disabled) {
    background: var(--primary-cyan-dark);
}

.mobile-week-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mobile-week-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    text-align: center;
    flex: 1;
}

.mobile-day-selector {
    display: flex;
    gap: 0.3rem;
    padding: 0.75rem 0;
    margin-bottom: 1.5rem;
}

.mobile-day-card {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.6rem 0.2rem;
    background-color: white;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #ddd;
}

.mobile-day-card.active {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-cyan-dark));

    color: white;
    border-color: var(--primary-cyan);
    transform: scale(1.05);
}

.mobile-day-name {
    font-size: 0.7rem;
    font-weight: bold;
    margin-bottom: 0.2rem;
}

.mobile-day-date {
    font-size: 1rem;
    font-weight: bold;
}

.mobile-day-month {
    font-size: 0.65rem;
    opacity: 0.8;
}

.mobile-slots-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-slot-card {
    background-color: white;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    border-left: 5px solid #ddd;
}

.mobile-slot-card.personal-training {
    border-left-color: var(--personal-training);
    background: linear-gradient(to right, rgba(34, 197, 94, 0.1), white);
}

.mobile-slot-card.small-group {
    border-left-color: var(--small-group);
    background: linear-gradient(to right, rgba(251, 191, 36, 0.1), white);
}

.mobile-slot-card.group-class {
    border-left-color: var(--group-class);
    background: linear-gradient(to right, rgba(239, 68, 68, 0.1), white);
}

.mobile-slot-card.slot-full {
    opacity: 0.5;
    cursor: not-allowed;
}

.mobile-slot-card.selected {
    border: 2px solid var(--primary-cyan);
    box-shadow: 0 4px 16px rgba(0, 174, 239, 0.3);
    transform: scale(1.02);
}

.mobile-slot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.mobile-slot-time {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--dark-bg);
}

.mobile-slot-available {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    white-space: nowrap;
}

.mobile-slot-available.spots-dark   { color: #111;    background: rgba(0, 0, 0, 0.06); }
.mobile-slot-available.spots-green  { color: #16a34a; background: rgba(22, 163, 74, 0.1); }
.mobile-slot-available.spots-orange { color: #ea7b0a; background: rgba(234, 123, 10, 0.1); }
.mobile-slot-available.spots-red    { color: #dc2626; background: rgba(220, 38, 38, 0.1); }

.mobile-slot-type {
    font-size: 0.95rem;
    font-weight: 600;
}

.spots-indicator {
    display: inline-flex;
    gap: 0.25rem;
}

.spot-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ddd;
}

.spot-dot.filled {
    background-color: var(--primary-cyan);
}

.spot-dot.available {
    background-color: var(--success);
}

/* Desktop scale-down */
@media (min-width: 769px) {
    html {
        font-size: 12px;
    }

    .container {
        max-width: 900px;
    }

    .calendar-grid {
        grid-template-columns: 58px repeat(7, 1fr);
    }

    .calendar-slot {
        min-height: 58px;
        padding: 0.4rem;
    }

    .calendar-time {
        padding: 0.4rem 0.25rem;
        font-size: 0.75rem;
    }

    .nav-logo {
        height: 44px;
    }

    .hero {
        padding: 2.5rem 0 2rem;
    }

    .calendar-section {
        padding: 1.5rem 0;
    }

    .booking-section {
        padding: 1.5rem 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    /* Hide desktop calendar */
    .calendar-grid {
        display: none;
    }

    .calendar-controls {
        display: none;
    }

    /* Show mobile calendar */
    .mobile-calendar {
        display: block;
    }

    /* Mobile navbar */
    .nav-desktop-links {
        display: none;
    }

    .navbar .container {
        padding: 0 10px;
    }

    .nav-logo {
        height: 52px;
    }

    .nav-menu {
        gap: 0.5rem;
    }

    .nav-menu a {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }

    /* Mobile hero */
    .hero {
        padding: 1.2rem 0 1rem;
    }

    .hero-name {
        font-size: 1.7rem;
        letter-spacing: 1px;
    }

    .hero-role {
        font-size: 0.78rem;
        letter-spacing: 2px;
        margin-bottom: 0.75rem;
    }

    .hero-description {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .hero-info {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .hero-info-item {
        font-size: 0.72rem;
        padding: 0.4rem 0.7rem;
        gap: 0.3rem;
    }

    .hero-info-item svg {
        width: 12px;
        height: 12px;
    }

    /* Mobile calendar section */
    .calendar-section {
        padding: 0.75rem 0;
    }

    .calendar-section h2 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    /* Mobile legend */
    .legend {
        flex-direction: column;
        gap: 0.4rem;
        align-items: stretch;
        background-color: white;
        padding: 0.6rem;
        border-radius: 10px;
    }

    .legend-item {
        font-size: 0.82rem;
        padding: 0.3rem 0.5rem;
    }

    .color-box {
        width: 20px;
        height: 20px;
    }

    /* Mobile booking section */
    .booking-section {
        padding: 0.75rem 0;
    }

    .booking-section h2 {
        font-size: 1.2rem;
    }

    .selected-slot-info {
        padding: 0.7rem;
        margin-bottom: 0.75rem;
    }

    .selected-slot-info h3 {
        font-size: 1rem;
    }

    .booking-form {
        padding: 1rem;
        border-radius: 10px;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.75rem;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
    }

    .btn-primary {
        padding: 0.9rem;
        font-size: 1rem;
        border-radius: 8px;
        font-weight: bold;
    }

    .btn-control {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    /* Mobile confirmation */
    .confirmation-message {
        padding: 1rem;
        font-size: 0.9rem;
    }

    /* Mobile footer */
    .footer {
        padding: 0.75rem 0;
        font-size: 0.8rem;
    }

    /* Container padding on mobile */
    .container {
        padding: 0 12px;
    }
}

/* Extra small devices */
@media (max-width: 380px) {
    .nav-logo {
        height: 44px;
    }

    .nav-menu a {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .hero-name {
        font-size: 1.6rem;
    }

    .hero-role {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }

    .mobile-day-card {
        padding: 0.45rem 0.1rem;
        border-radius: 8px;
    }

    .mobile-day-name {
        font-size: 0.6rem;
    }

    .mobile-day-date {
        font-size: 0.9rem;
    }

    .mobile-day-month {
        font-size: 0.55rem;
    }

    .mobile-slot-time {
        font-size: 1.1rem;
    }

    .mobile-slot-type {
        font-size: 0.9rem;
    }

    .mobile-week-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
}

/* ===== Booking Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #ddd;
}

.modal-slot-info {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #eee;
}

.modal-slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.modal-slot-day-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.modal-slot-day-row h3 {
    margin-bottom: 0;
}

.modal-slot-day-row .modal-slot-time {
    margin-bottom: 0;
    white-space: nowrap;
}

.modal-slot-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.modal-slot-badge.personal-training { background-color: #22c55e; }
.modal-slot-badge.small-group       { background-color: #fbbf24; }
.modal-slot-badge.group-class       { background-color: #ef4444; }

.modal-slot-info h3 {
    font-size: 1.25rem;
    color: var(--dark-bg);
    margin-bottom: 0.25rem;
}

.modal-slot-time {
    font-size: 1rem;
    color: #555;
    margin-bottom: 0.35rem;
}

.modal-spots {
    font-size: 0.9rem;
    font-weight: 700;
}

.modal-spots.spots-dark   { color: #111; }
.modal-spots.spots-green  { color: #16a34a; }
.modal-spots.spots-orange { color: #ea7b0a; }
.modal-spots.spots-red    { color: #dc2626; }

.modal-box .booking-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-box .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.modal-box .form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.modal-box .form-group input,
.modal-box .form-group textarea {
    padding: 0.45rem 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px; /* Prevents zoom on iOS */
    transition: border-color 0.2s;
    outline: none;
    font-family: inherit;
    resize: vertical;
}

.modal-box .form-group textarea {
    min-height: 60px;
}

.modal-box .form-group input:focus,
.modal-box .form-group textarea:focus {
    border-color: var(--primary-cyan);
}

.modal-box .btn-primary {
    margin-top: 0.25rem;
    padding: 0.75rem;
    font-size: 1rem;
}

.modal-box .login-prompt {
    padding: 1.5rem 0.5rem;
    text-align: center;
}

.modal-box .login-prompt-text {
    font-size: 1rem;
    color: #555;
    margin-bottom: 1.25rem;
}

.modal-box .confirmation-message {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-cyan-dark));
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    text-align: center;
}

.modal-box .confirmation-message h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.modal-box .confirmation-message p {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    opacity: 0.95;
}

.credit-used-notice {
    display: inline-block;
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 8px;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem !important;
    font-weight: 600;
    color: #d4f7e0 !important;
    opacity: 1 !important;
    margin: 0.4rem 0 0.25rem !important;
}

.cal-buttons {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.cal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    flex: 1;
    justify-content: center;
}

.cal-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.cal-btn-google {
    background: #fff;
    color: #444;
    border: 1.5px solid rgba(255,255,255,0.5);
}

.cal-btn-apple {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.5);
}

@media (max-width: 600px) {
    .cal-buttons { margin-top: 0.6rem; gap: 0.4rem; }
    .cal-btn { padding: 0.35rem 0.6rem; font-size: 0.75rem; }
    .cal-btn svg { width: 13px; height: 13px; }
}

.confirm-rules {
    margin-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-align: left;
}

.confirm-rule-item {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
}

.confirm-rule-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.confirm-rule-item > div > strong {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.1rem;
}

.confirm-rule-item p {
    margin: 0;
    font-size: 0.72rem;
    opacity: 0.85;
    line-height: 1.35;
}

@media (max-width: 600px) {
    .confirm-rules { gap: 0.5rem; margin-top: 0.75rem; padding-top: 0.6rem; }
    .confirm-rule-item > div > strong { font-size: 0.75rem; }
    .confirm-rule-item p { font-size: 0.68rem; }
    .confirm-rule-icon { font-size: 1rem; }
}

@media (max-width: 600px) {
    /* Bottom sheet layout */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
        justify-content: center;
        bottom: auto;
        height: 100dvh; /* dvh shrinks when iOS keyboard appears */
    }

    .modal-box {
        padding: 1rem 1rem 1.25rem;
        border-radius: 16px 16px 0 0;
        max-height: 80dvh; /* dvh = visual viewport, excludes keyboard */
        width: 100%;
        max-width: 100%;
        animation: slideUpSheet 0.3s ease;
    }

    @keyframes slideUpSheet {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    /* Drag handle visual */
    .modal-box::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: #ccc;
        border-radius: 2px;
        margin: 0 auto 0.3rem;
    }

    /* X button hidden on mobile: tap outside to close */
    .modal-close {
        display: none;
    }

    .modal-slot-info {
        margin-top: 0.4rem;
        margin-bottom: 0.6rem;
        padding-bottom: 0.6rem;
    }

    .modal-slot-badge {
        font-size: 0.68rem;
        padding: 0.15rem 0.5rem;
        margin-bottom: 0.3rem;
    }

    .modal-slot-info h3 {
        font-size: 0.95rem;
    }

    .modal-slot-time {
        font-size: 0.82rem;
    }

    .modal-spots {
        font-size: 0.78rem;
    }

    .modal-box .booking-form {
        gap: 0.3rem;
    }

    .modal-box .form-group {
        margin-bottom: 0;
    }

    .modal-box .form-group label {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
    }

    .modal-box .form-group input,
    .modal-box .form-group textarea {
        padding: 0.4rem 0.6rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .modal-box .form-group textarea {
        min-height: 20px;
    }

    .modal-box .btn-primary {
        padding: 0.65rem;
        font-size: 0.9rem;
        margin-top: 0.4rem;
    }

    .modal-box .confirmation-message {
        padding: 0.85rem;
        margin-top: 0.5rem;
    }

    .modal-box .confirmation-message h3 {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }

    .modal-box .confirmation-message p {
        font-size: 0.82rem;
    }
}

/* ── Sidebar logout button ─────────────────────────────────────── */
.nav-sidebar-logout {
    display: flex;
    align-items: center;
    padding: 0.95rem 1.5rem;
    color: #ff7070;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
}

.nav-sidebar-logout:hover {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    border-left-color: #ff4444;
}

.nav-sidebar-credit {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: right;
    padding: 0.6rem 1rem;
    letter-spacing: 0.02em;
}

/* On mobile: hide navbar Esci (it lives in the sidebar instead) */
@media (max-width: 768px) {
    .nav-logout-btn {
        display: none;
    }
}

/* ─── LOADING STATE ──────────────────────────────────────────────────────────── */

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

/* ─── TOAST NOTIFICATIONS ────────────────────────────────────────────────────── */

.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: none;
    width: 100%;
    max-width: 420px;
    padding: 0 16px;
    box-sizing: border-box;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    pointer-events: auto;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { background: #06d6a0; }
.toast-error   { background: #ef4444; }
.toast-info    { background: #00AEEF; }

.toast-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}
