/* Selfit Gym Booking System - Frontend Styles */

/* Reset and Base Styles */
.selfit-booking-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    text-align: center;
}

/* Alerts */
.selfit-alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid;
}

.selfit-alert.success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.selfit-alert.error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.selfit-alert.warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* User Status Section */
.user-status-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.user-status-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.user-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.user-status.normal {
    background: #28a745;
    color: white;
}

.user-status.penalty {
    background: #dc3545;
    color: white;
}

.penalty-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    color: #856404;
}

/* Availability Display */
.availability-display {
    background: #e8f5e8;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #c3e6c3;
}

.availability-display h4 {
    margin: 0 0 15px 0;
    color: #2d5a2d;
    font-size: 18px;
    font-weight: 600;
}

.availability-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.availability-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #d4edda;
    min-width: 200px;
}

.availability-label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.availability-value {
    font-weight: 600;
    color: #28a745;
    font-size: 16px;
    background: #d4edda;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Week Navigation */
.week-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.week-link {
    display: inline-block;
    padding: 8px 16px;
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.week-link:hover {
    background: #007bff;
    color: white;
    text-decoration: none;
}

.week-link.active {
    background: #007bff;
    color: white;
    font-weight: 600;
}

.week-nav-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.week-nav-button:hover {
    background: #0056b3;
}

.week-nav-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.current-week {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.current-week-display {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.current-week-display h3 {
    margin: 0;
    color: #495057;
    font-size: 16px;
}

/* Schedule Table - Desktop Grid Layout */
.selfit-schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.selfit-schedule-table thead th {
    background: #20c997;
    color: white;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    border: none;
}

.selfit-schedule-table thead th:first-child {
    background: #17a2b8;
    min-width: 80px;
}

.selfit-schedule-table tbody td {
    padding: 8px;
    border: 1px solid #e9ecef;
    vertical-align: top;
    min-height: 120px;
}

.selfit-schedule-table tbody td:first-child {
    background: #f8f9fa;
    font-weight: 600;
    text-align: center;
    color: #495057;
    min-width: 80px;
}

/* Slot Container */
.slot-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 6px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    min-height: 80px;
    text-align: center;
}

.slot-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.slot-container.class-cross-trn {
    border-color: #6c757d;
    background: #6c757d;
    color: white;
}

.slot-container.class-group-prs {
    border-color: #28a745;
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.slot-container.class-total-body {
    border-color: #35bbbd;
    background: #35bbbd;
    color: white;
}

.slot-container.class-total-body-lv2 {
    border-color: #a6a6a6;
    background: linear-gradient(135deg, #a6a6a6, #8c8c8c);
    color: white;
}

.slot-container.class-hips-abs {
    border-color: #c6c0b7;
    background: linear-gradient(135deg, #c6c0b7, #b8b2a9);
    color: white;
}

.slot-container.class-cross-trn-lvl2 {
    border-color: #448289;
    background: linear-gradient(135deg, #448289, #3a6f75);
    color: white;
}

.slot-time {
    font-size: 11px;
    opacity: 0.9;
    margin-bottom: 3px;
    line-height: 1.2;
}

.slot-availability {
    margin-bottom: 6px;
}

.spots-available {
    font-weight: 600;
    color: white;
    background: transparent;
    padding: 2px 4px;
    border-radius: 3px;
    text-align: center;
    font-size: 10px;
    line-height: 1.2;
}

.slot-class-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 3px;
    line-height: 1.2;
}

.slot-status {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    margin-top: 8px;
}

.slot-status.past {
    background: #6c757d;
    color: white;
}

.slot-status.closed {
    background: #ffc107;
    color: #212529;
}

.slot-status.full {
    background: #dc3545;
    color: white;
}

.slot-status.waitlist-exclusive {
    background: #ffc107;
    color: #856404;
    font-size: 12px;
    line-height: 1.3;
}

.slot-buttons {
    margin-top: 6px;
}

.slot-button {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    line-height: 1.2;
}

.slot-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.selfit-book-class {
    background: #b4b4b4;
    color: #ffffff;
}

.selfit-book-class:hover:not(:disabled) {
    background: #9a9a9a;
    transform: translateY(-1px);
}

.selfit-cancel-booking {
    background: #dc3545;
    color: white;
}

.selfit-cancel-booking:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-1px);
}

.selfit-join-waitlist {
    background: #6c757d;
    color: white;
}

.selfit-join-waitlist:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-1px);
}

.slot-empty {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* Class Legend */
.class-legend {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
}

.class-legend h5 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.cross-trn {
    background: #6c757d;
}

.legend-color.group-prs {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

.legend-color.total-body {
    background: #35bbbd;
}

.legend-color.total-body-lv2 {
    background: #a6a6a6;
}

.legend-color.cross-trn-lvl2 {
    background: #a6a6a6;
}

.legend-color.hips-abs {
    background: #c6c0b7;
}

/* Booking Rules */
.booking-rules {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
    border-left: 4px solid #2196f3;
}

.booking-rules h4 {
    margin: 0 0 15px 0;
    color: #1976d2;
    font-size: 18px;
}

.booking-rules ul {
    margin: 0;
    padding-left: 20px;
}

.booking-rules li {
    margin-bottom: 8px;
    color: #424242;
}

/* My Bookings Page */
.selfit-my-bookings {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.selfit-my-bookings h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.bookings-section,
.waitlist-section,
.past-bookings-section,
.cancelled-bookings-section,
.penalties-section {
    margin-bottom: 40px;
}

.bookings-section h3,
.waitlist-section h3,
.past-bookings-section h3,
.cancelled-bookings-section h3,
.penalties-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.no-bookings {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
}

.bookings-grid,
.waitlist-grid,
.penalties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.booking-card,
.waitlist-card,
.penalty-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.booking-card:hover,
.waitlist-card:hover,
.penalty-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.booking-card.past {
    border-left-color: #6c757d;
    opacity: 0.8;
}

.booking-card.cancelled {
    border-left-color: #dc3545;
    opacity: 0.8;
}

.booking-header,
.waitlist-header,
.penalty-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.booking-header h4,
.waitlist-header h4,
.penalty-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.booking-date,
.waitlist-position,
.penalty-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    background: #e9ecef;
    color: #495057;
}

.penalty-status {
    background: #dc3545;
    color: white;
}

.booking-details,
.waitlist-details,
.penalty-details {
    margin-bottom: 15px;
}

.booking-details p,
.waitlist-details p,
.penalty-details p {
    margin: 5px 0;
    font-size: 14px;
    color: #495057;
}

.notified-status {
    color: #28a745 !important;
    font-weight: 600;
}

.expires-at {
    color: #dc3545 !important;
    font-weight: 600;
}

.booking-actions,
.waitlist-actions {
    text-align: center;
}

.cancel-booking-btn,
.leave-waitlist-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.cancel-booking-btn:hover,
.leave-waitlist-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Mobile List Layout */
@media (max-width: 768px) {
    .selfit-booking-container {
        padding: 10px;
        max-width: 100%;
    }
    
    .user-status-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .user-status-section h4 {
        font-size: 16px;
    }
    
    .availability-display {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .availability-display h4 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .availability-stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .availability-item {
        min-width: auto;
        width: 100%;
        padding: 10px 12px;
    }
    
    .availability-label {
        font-size: 13px;
    }
    
    .availability-value {
        font-size: 14px;
    }
    
    .week-navigation {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
    }
    
    .week-nav-button {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .week-navigation {
        flex-direction: column;
        gap: 8px;
    }
    
    .week-link {
        width: 100%;
        text-align: center;
        padding: 10px;
    }
    
    .current-week {
        font-size: 16px;
        text-align: center;
    }
    
    /* Hide desktop table on mobile */
    .selfit-schedule-table {
        display: none !important;
    }
    
    /* Show mobile list */
    .mobile-schedule-list {
        display: block !important;
    }
    
    .day-section {
        margin-bottom: 20px;
        background: white;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .day-header {
        background: #20c997;
        color: white;
        padding: 12px 15px;
        font-weight: 600;
        font-size: 14px;
        text-align: center;
    }
    
    .class-item {
        padding: 6px 10px;
        min-height: 45px;
        text-align: center;
        border-bottom: 1px solid white;
    }

    /* Class colors for mobile */
    .class-item.cross-trn {
        background: #6c757d;
        border-color: #6c757d;
        color: white;
    }

    .class-item.total-body {
        background: #35bbbd;
        border-color: #35bbbd;
        color: white;
    }

    .class-item.total-body-lv2 {
        background: #a6a6a6;
        border-color: #a6a6a6;
        color: white;
    }

    .class-item.hips-abs {
        background: #c6c0b7;
        border-color: #c6c0b7;
        color: white;
    }

    .class-item.cross-trn-lvl2 {
        background: #a6a6a6;
        border-color: #a6a6a6;
        color: white;
    }

    .class-item.group-prs {
        background: #28a745;
        border-color: #28a745;
        color: white;
    }
    
    .class-actions {
        flex-shrink: 0;
        min-width: 60px;
    }
    
    .class-button {
        padding: 7px 10px;
        font-size: 10px;
        min-width: 70px;
    }
    
    .class-item:last-child {
        border-bottom: none;
    }
    
    .class-info {
        flex: 1;
        min-width: 0;
    }
    
    .class-name {
        font-weight: 600;
        font-size: 13px;
        margin-bottom: 2px;
        color: #333;
        line-height: 1.2;
    }

    /* Text colors for colored backgrounds */
    .class-item.cross-trn .class-name,
    .class-item.total-body .class-name,
    .class-item.total-body-lv2 .class-name,
    .class-item.hips-abs .class-name,
    .class-item.group-prs .class-name {
        color: white;
    }
    
    .class-time {
        font-size: 11px;
        color: #6c757d;
        margin-bottom: 2px;
        line-height: 1.2;
    }

    /* Text colors for colored backgrounds */
    .class-item.cross-trn .class-time,
    .class-item.total-body .class-time,
    .class-item.total-body-lv2 .class-time,
    .class-item.hips-abs .class-time,
    .class-item.group-prs .class-time {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .class-availability {
        font-size: 10px;
        color: #495057;
        font-weight: 500;
        display: flex;
        flex-direction: column;
        gap: 2px;
        line-height: 1.2;
    }

    /* Text colors for colored backgrounds */
    .class-item.cross-trn .class-availability,
    .class-item.total-body .class-availability,
    .class-item.total-body-lv2 .class-availability,
    .class-item.hips-abs .class-availability,
    .class-item.group-prs .class-availability {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .class-availability .spots-available {
        color: white;
        font-weight: 600;
    }
    
    .class-actions {
        flex-shrink: 0;
    }
    
    .class-button {
        padding: 6px 10px;
        border: none;
        border-radius: 6px;
        font-size: 10px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        text-transform: uppercase;
        min-width: 70px;
        text-align: center;
        white-space: nowrap;
        line-height: 1.2;
    }
    
    .class-button.book {
        background: #b4b4b4;
        color: #ffffff;
    }
    
    .class-button.book:hover {
        background: #9a9a9a;
    }
    
    .class-button.cancel {
        background: #dc3545;
        color: white;
    }
    
    .class-button.cancel:hover {
        background: #c82333;
    }
    
    .class-button.waitlist {
        background: #6c757d;
        color: white;
    }
    
    .class-button.waitlist:hover {
        background: #5a6268;
    }
    
    .class-button.unavailable {
        background: #6c757d;
        color: white;
        cursor: not-allowed;
        opacity: 0.7;
    }
    
    .class-button.booked {
        background: #17a2b8;
        color: white;
    }
    
    /* Mobile legend */
    .class-legend {
        padding: 15px;
        margin-top: 20px;
    }
    
    .class-legend h5 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .legend-items {
        gap: 10px;
    }
    
    .legend-item {
        font-size: 12px;
    }
    
    /* Mobile booking rules */
    .booking-rules {
        padding: 15px;
        margin-top: 20px;
    }
    
    .booking-rules h4 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .booking-rules ul {
        padding-left: 15px;
    }
    
    .booking-rules li {
        font-size: 12px;
        margin-bottom: 5px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .selfit-booking-container {
        padding: 5px;
    }
    
    .class-item {
        padding: 6px 10px;
        min-height: 45px;
        text-align: center;
    }

    /* Class colors for small mobile */
    .class-item.cross-trn {
        background: #6c757d;
        border-color: #6c757d;
        color: white;
    }

    .class-item.total-body {
        background: #35bbbd;
        border-color: #35bbbd;
        color: white;
    }

    .class-item.total-body-lv2 {
        background: #a6a6a6;
        border-color: #a6a6a6;
        color: white;
    }

    .class-item.hips-abs {
        background: #c6c0b7;
        border-color: #c6c0b7;
        color: white;
    }

    .class-item.cross-trn-lvl2 {
        background: #a6a6a6;
        border-color: #a6a6a6;
        color: white;
    }

    .class-item.group-prs {
        background: #28a745;
        border-color: #28a745;
        color: white;
    }

    .class-item.cross-trn-lvl2 {
        background: #a6a6a6;
        border-color: #a6a6a6;
        color: white;
    }

    /* Text colors for colored backgrounds - small mobile */
    .class-item.cross-trn .class-name,
    .class-item.total-body .class-name,
    .class-item.total-body-lv2 .class-name,
    .class-item.hips-abs .class-name,
    .class-item.cross-trn-lvl2 .class-name,
    .class-item.group-prs .class-name {
        color: white;
    }

    .class-item.cross-trn .class-time,
    .class-item.total-body .class-time,
    .class-item.total-body-lv2 .class-time,
    .class-item.hips-abs .class-time,
    .class-item.group-prs .class-time {
        color: rgba(255, 255, 255, 0.9);
    }

    .class-item.cross-trn .class-availability,
    .class-item.total-body .class-availability,
    .class-item.total-body-lv2 .class-availability,
    .class-item.hips-abs .class-availability,
    .class-item.group-prs .class-availability {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .class-actions {
        flex-shrink: 0;
        min-width: 60px;
    }
    
    .class-button {
        padding: 7px 10px;
        font-size: 10px;
        min-width: 70px;
    }
    
    .week-nav-button {
        padding: 15px 20px;
        font-size: 16px;
    }
}

/* Desktop - Hide mobile list */
@media (min-width: 769px) {
    .mobile-schedule-list {
        display: none;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Login Required */
.selfit-login-required {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.selfit-login-required p {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 20px;
}

.selfit-login-required a {
    background: #007bff;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
}

.selfit-login-required a:hover {
    background: #0056b3;
}

.no-classes-available {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
    margin: 20px 0;
}

.no-classes-available h3 {
    color: #6c757d;
    margin-bottom: 10px;
    font-size: 18px;
}

.no-classes-available p {
    color: #6c757d;
    margin: 0;
    font-size: 14px;
} 