/* Pilates Booking - Frontend CSS v3.2 - Aruna Pilates */
:root {
    --pb-primary: #9C6B98;
    --pb-primary-rgb: 156, 107, 152;
}

/* Calendar Wrapper */
.pb-calendar-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.pb-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    background: linear-gradient(135deg, var(--pb-primary), rgba(var(--pb-primary-rgb), 0.8));
    border-radius: 16px 16px 0 0;
    color: #fff;
}

.pb-header-center { text-align: center; flex: 1; }
.pb-current-period { margin: 0; font-size: 18px; font-weight: 600; }
.pb-studio-name { margin: 5px 0 0 0; font-size: 13px; opacity: 0.9; }

.pb-nav-btn {
    width: 44px; height: 44px;
    border: none; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.pb-nav-btn:hover { background: rgba(255,255,255,0.3); transform: scale(1.05); }
.pb-nav-btn svg { display: block; }

/* View Toggle */
.pb-view-toggle {
    display: flex; justify-content: center;
    padding: 15px; gap: 5px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}
.pb-view-btn {
    padding: 8px 20px; border: none;
    background: transparent; color: #6c757d;
    border-radius: 20px; cursor: pointer;
    font-size: 13px; font-weight: 500;
    transition: all 0.2s;
}
.pb-view-btn.active { background: var(--pb-primary); color: #fff; }
.pb-view-btn:hover:not(.active) { background: #e9ecef; }

/* Week Days Header */
.pb-week-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #fff;
    border-bottom: 2px solid #e9ecef;
}
.pb-week-day {
    padding: 15px 10px;
    text-align: center;
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pb-week-day .day-name {
    display: block;
    margin-bottom: 5px;
}
.pb-week-day .day-num {
    display: inline-block;
    font-size: 16px;
    color: #1a1a2e;
    font-weight: 600;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
}
.pb-week-day.today .day-name {
    color: var(--pb-primary);
    font-weight: 700;
}
.pb-week-day.today .day-num {
    background: var(--pb-primary);
    color: #fff;
}

/* Calendar Grid - Week View */
.pb-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
    min-height: 350px;
}

.pb-day-column {
    background: #fff;
    min-height: 300px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pb-day-column.today { background: #faf8fb; }
.pb-day-column.past { opacity: 0.5; }

/* Calendar Grid - Day View */
.pb-calendar-grid.day-view {
    display: block;
    grid-template-columns: none;
    background: #fff;
}

.pb-day-view-container {
    padding: 25px;
}

.pb-day-view-slots {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Slot Cards */
.pb-slot-card {
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8f9fa, #fff);
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s;
}
.pb-slot-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--pb-primary);
}

.pb-slot-card.full {
    background: #f8f9fa;
    border-color: #dee2e6;
    cursor: default;
}
.pb-slot-card.full:hover { transform: none; box-shadow: none; }

.pb-slot-card.booked {
    background: linear-gradient(135deg, rgba(var(--pb-primary-rgb),0.1), rgba(var(--pb-primary-rgb),0.05));
    border-color: var(--pb-primary);
}

/* Expanded slot card (day view) */
.pb-slot-card.expanded {
    padding: 18px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.pb-slot-card.expanded .pb-slot-time {
    font-size: 20px;
    min-width: 70px;
}

.pb-slot-card.expanded .pb-slot-type {
    flex: 1;
    font-size: 15px;
    margin: 0;
}

.pb-slot-card.expanded .pb-slot-instructor {
    margin: 0;
}

.pb-slot-card.expanded .pb-slot-meta {
    margin: 0;
    padding: 0;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.pb-slot-time {
    font-size: 15px; font-weight: 700;
    color: #1a1a2e;
    display: flex; align-items: center; gap: 6px;
}
.pb-slot-time .pb-instructor-thumb {
    width: 20px; height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.pb-slot-type { font-size: 12px; color: #6c757d; margin-top: 4px; }
.pb-slot-instructor { font-size: 11px; color: #868e96; margin-top: 2px; }

.pb-slot-meta {
    display: flex; justify-content: space-between;
    align-items: center; margin-top: 8px;
    padding-top: 8px; border-top: 1px solid #e9ecef;
}

.pb-slot-spots { font-size: 11px; }
.pb-slot-spots.available { color: #28a745; }
.pb-slot-spots.low { color: #ffc107; }
.pb-slot-spots.full { color: #dc3545; }
.pb-slot-spots.waitlist { color: #6c757d; }

.pb-slot-price { font-size: 12px; font-weight: 600; color: #28a745; }

.pb-booked-badge, .pb-waitlist-badge {
    font-size: 10px; padding: 2px 8px;
    border-radius: 10px; font-weight: 600;
}
.pb-booked-badge { background: var(--pb-primary); color: #fff; }
.pb-waitlist-badge { background: #fff3cd; color: #856404; }

/* Empty State */
.pb-no-slots {
    text-align: center; padding: 30px 10px;
    color: #adb5bd; font-size: 13px;
}

/* Loading */
.pb-loading {
    grid-column: 1 / -1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 60px; color: #6c757d; gap: 10px;
    background: #fff;
}

.pb-spinner {
    width: 36px; height: 36px;
    border: 3px solid #e9ecef;
    border-top-color: var(--pb-primary);
    border-radius: 50%;
    animation: pb-spin 0.8s linear infinite;
}

/* Modal */
.pb-modal {
    display: none; position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99999;
}
.pb-modal.open { display: flex; align-items: center; justify-content: center; }

.pb-modal-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    animation: pb-fadeIn 0.2s ease;
}

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

.pb-modal-close {
    position: absolute; top: 15px; right: 15px;
    width: 32px; height: 32px;
    border: none; background: #f8f9fa;
    border-radius: 50%; cursor: pointer;
    font-size: 20px; color: #6c757d;
    z-index: 10;
}
.pb-modal-close:hover { background: #e9ecef; }

/* Modal Header */
.pb-modal-header { padding: 25px; background: #f8f9fa; }
.pb-modal-slot-info { display: flex; gap: 15px; }
.pb-modal-instructor-photo {
    width: 70px; height: 70px;
    border-radius: 50%; background: #e9ecef;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; overflow: hidden;
    flex-shrink: 0;
}
.pb-modal-instructor-photo img { width: 100%; height: 100%; object-fit: cover; }
.pb-modal-details { flex: 1; }
.pb-modal-class-type { margin: 0 0 5px; font-size: 18px; color: #1a1a2e; }
.pb-modal-datetime { margin: 0; font-size: 14px; color: var(--pb-primary); font-weight: 600; }
.pb-modal-instructor, .pb-modal-price, .pb-modal-spots { margin: 3px 0 0; font-size: 13px; color: #6c757d; }

/* Cancellation Notice */
.pb-cancellation-notice {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 25px;
    background: #fff3cd; color: #856404;
    font-size: 12px;
}

/* Date Picker Mobile */
.pb-date-picker-mobile {
    background: #f8f9fa;
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
}
.pb-date-input-mobile {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    max-width: 200px;
}
.pb-header-center {
    position: relative;
}

/* Forms */
.pb-booking-form { padding: 25px; }
.pb-form-group { margin-bottom: 15px; }
.pb-form-group label { display: block; font-size: 13px; font-weight: 500; color: #495057; margin-bottom: 5px; }
.pb-form-group input, .pb-form-group textarea, .pb-form-group select {
    width: 100%; padding: 12px 15px;
    border: 1px solid #dee2e6; border-radius: 8px;
    font-size: 15px; transition: all 0.2s;
    box-sizing: border-box;
    background: #fff;
}
.pb-form-group input:focus, .pb-form-group textarea:focus, .pb-form-group select:focus {
    border-color: var(--pb-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--pb-primary-rgb), 0.1);
}

/* Form Row - Név és Hány fő egymás mellett */
.pb-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}
.pb-form-row .pb-form-group {
    margin-bottom: 0;
}
.pb-form-group-wide {
    flex: 1;
}
.pb-form-group-small {
    width: 100px;
    flex-shrink: 0;
}
.pb-spots-select {
    text-align: center;
}

/* Waitlist */
.pb-waitlist-notice {
    text-align: center; padding: 20px;
    background: #fff3cd; border-radius: 8px;
    margin-bottom: 20px;
}
.pb-waitlist-notice strong { color: #856404; font-size: 16px; }
.pb-waitlist-notice p { color: #856404; font-size: 13px; margin: 5px 0 0; }

/* Submit Button */
.pb-submit-btn {
    width: 100%; padding: 15px;
    background: linear-gradient(135deg, var(--pb-primary), rgba(var(--pb-primary-rgb), 0.85));
    color: #fff; border: none;
    border-radius: 10px; font-size: 16px;
    font-weight: 600; cursor: pointer;
    transition: all 0.3s;
}
.pb-submit-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(var(--pb-primary-rgb), 0.4); }
.pb-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.pb-submit-btn.pb-waitlist-btn { background: linear-gradient(135deg, #ffc107, #e0a800); }

.pb-spinner-small {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff; border-radius: 50%;
    animation: pb-spin 0.6s linear infinite;
}

/* Messages */
.pb-form-message {
    padding: 12px 15px; border-radius: 8px;
    margin-bottom: 15px; font-size: 13px;
}
.pb-form-message.error { background: #f8d7da; color: #721c24; }
.pb-form-message.success { background: #d4edda; color: #155724; }

/* Success States */
.pb-success-message, .pb-waitlist-success {
    text-align: center; padding: 40px 25px;
}
.pb-success-icon { margin-bottom: 20px; }
.pb-success-message h4, .pb-waitlist-success h4 { margin: 0 0 10px; font-size: 20px; color: #1a1a2e; }
.pb-success-message p, .pb-waitlist-success p { margin: 0; color: #6c757d; font-size: 14px; }
.pb-waitlist-position { margin-top: 15px !important; }
.pb-close-success-btn {
    margin-top: 20px; padding: 12px 30px;
    background: var(--pb-primary); color: #fff;
    border: none; border-radius: 8px;
    font-size: 14px; cursor: pointer;
}

/* Animations */
@keyframes pb-spin { to { transform: rotate(360deg); } }
@keyframes pb-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pb-slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive - Tablet */
@media (max-width: 900px) {
    .pb-calendar-grid:not(.day-view) { grid-template-columns: repeat(4, 1fr); }
    .pb-week-days { grid-template-columns: repeat(4, 1fr); }
    .pb-week-day:nth-child(n+5) { display: none; }
    .pb-day-column:nth-child(n+5) { display: none; }
}

/* Responsive - Mobile */
@media (max-width: 600px) {
    /* Alapok */
    .pb-calendar-wrapper { 
        padding: 0; 
        margin: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Header - kompaktabb */
    .pb-calendar-header { 
        padding: 12px 15px; 
        border-radius: 0;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    .pb-current-period { font-size: 15px; }
    .pb-studio-name { font-size: 11px; margin-top: 2px; }
    .pb-nav-btn { 
        width: 38px; 
        height: 38px;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Heti nézet gomb elrejtése */
    .pb-view-toggle { display: none !important; }
    
    /* Naptár grid - smooth scroll */
    .pb-calendar-grid { 
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        border-radius: 0;
        min-height: auto;
    }
    
    /* Napi nézet - teljes szélesség, jobb padding */
    .pb-day-view-container { 
        padding: 10px 12px 80px 12px; /* extra padding alul a görgetéshez */
    }
    
    .pb-day-view-slots { 
        gap: 8px;
    }
    
    /* Slot kártyák mobilon - nagyobb, egyszerűbb */
    .pb-slot-card.expanded {
        padding: 14px 16px;
        border-radius: 12px;
        display: block; /* nem flex, egyszerűbb layout */
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }
    
    .pb-slot-card.expanded .pb-slot-time {
        font-size: 20px;
        font-weight: 700;
        margin-bottom: 4px;
    }
    
    .pb-slot-card.expanded .pb-slot-type {
        font-size: 14px;
        font-weight: 500;
        color: #333;
        margin-bottom: 2px;
    }
    
    .pb-slot-card.expanded .pb-slot-instructor {
        font-size: 13px;
        color: #666;
    }
    
    .pb-slot-card.expanded .pb-slot-meta {
        margin-top: 10px;
        padding-top: 10px;
        display: flex;
        justify-content: space-between;
    }
    
    .pb-slot-card.expanded .pb-slot-spots {
        font-size: 13px;
        font-weight: 500;
    }
    
    .pb-slot-card.expanded .pb-slot-price {
        font-size: 15px;
        font-weight: 700;
    }
    
    /* Instructor thumbnail mobilon */
    .pb-instructor-thumb {
        display: none; /* elrejtjük mobilon a tisztább UI-ért */
    }
    
    /* Badge-ek */
    .pb-booked-badge, .pb-waitlist-badge {
        font-size: 11px;
        padding: 4px 10px;
        margin-top: 8px;
        display: inline-block;
    }
    
    /* Nincs óra üzenet */
    .pb-no-slots {
        padding: 40px 20px;
        font-size: 15px;
    }
    
    /* Modal - teljes képernyős mobilon */
    .pb-modal-content { 
        width: 100%; 
        max-width: none; 
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        margin-top: auto;
        animation: pb-slideUp 0.3s ease;
    }
    
    .pb-modal-header { 
        padding: 16px;
        border-radius: 16px 16px 0 0;
    }
    
    .pb-modal-slot-info { 
        flex-direction: column; 
        text-align: center;
        gap: 10px;
    }
    
    .pb-modal-instructor-photo { 
        margin: 0 auto;
        width: 50px;
        height: 50px;
    }
    
    .pb-modal-class-type { font-size: 18px; }
    .pb-modal-datetime { font-size: 13px; }
    
    .pb-modal-body {
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .pb-booking-form { 
        padding: 16px;
    }
    
    .pb-form-group { margin-bottom: 12px; }
    
    .pb-form-group input,
    .pb-form-group textarea {
        font-size: 16px; /* megakadályozza az iOS zoom-ot */
        padding: 12px 14px;
    }
    
    .pb-submit-btn {
        padding: 14px;
        font-size: 16px;
        margin-top: 10px;
    }
    
    /* Swipe indikátor */
    .pb-calendar-header::after {
        content: '← húzd →';
        position: absolute;
        bottom: -20px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 10px;
        color: rgba(0,0,0,0.3);
        display: none; /* később bekapcsolható */
    }
}
