/* OnceHub Bookings Viewer Styles */

/* Main Container */
.oncehub-bookings-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.oncehub-header {
    text-align: center;
    margin-bottom: 2rem;
}

.oncehub-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.oncehub-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

/* Refresh Button */
.oncehub-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f8fafc;
    border: 1px solid #9b9b9b;
    border-radius: 0.5rem;
    color: #080808;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.oncehub-refresh-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.oncehub-refresh-btn svg {
    width: 1rem;
    height: 1rem;
}

/* Navigation Toggle */
.oncehub-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.oncehub-toggle-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

.oncehub-toggle-switch {
    position: relative;
    width: 60px;
    height: 32px;
    background: #196fe3;
    border-radius: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0; /* Prevent shrinking */
}

.oncehub-toggle-switch.active {
    background: #2c2c2c;
}

.oncehub-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.oncehub-toggle-switch.active .oncehub-toggle-slider {
    transform: translateX(28px);
}

.oncehub-toggle-input {
    display: none;
}

.oncehub-toggle-label {
    font-weight: 500;
    font-size: 0.975rem;
    color: #2c2c2c;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap; /* Prevent text wrapping */
}

.oncehub-toggle-label.active {
    color: #1e293b;
    font-weight: 600;
}

/* Loading */
.oncehub-loading {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.oncehub-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #0ea5e9;
    border-radius: 50%;
    animation: oncehub-spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes oncehub-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.oncehub-message {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.oncehub-message p {
    margin: 0;
}

.oncehub-alert-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.oncehub-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.oncehub-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.oncehub-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
}

/* Booking Cards */
.oncehub-booking {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.oncehub-booking:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Booking Header */
.oncehub-booking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.oncehub-booking-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.4;
    flex: 1;
}

.oncehub-booking-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

/* Status Colors */
.status-scheduled {
    background: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-canceled,
.status-cancelled {
    background: #fee2e2;
    color: #dc2626;
}

.status-no-show {
    background: #fef3c7;
    color: #d97706;
}

/* Booking Details */
.oncehub-booking-details {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.oncehub-booking-field {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.oncehub-booking-field svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #64748b;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.oncehub-field-content {
    flex: 1;
}

.oncehub-field-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.25rem 0;
}

.oncehub-field-value {
    font-size: 0.875rem;
    color: #1e293b;
    margin: 0;
    font-weight: 500;
}

/* Action Buttons */
.oncehub-booking-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.oncehub-action-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 100px;
}

.oncehub-cancel-link {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.oncehub-cancel-link:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #b91c1c;
}

.oncehub-reschedule-link {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.oncehub-reschedule-link:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

/* Mobile Responsive Styles */
@media (max-width: 480px) {
    .oncehub-bookings-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .oncehub-toggle-wrapper {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    
    .oncehub-toggle-label {
        font-size: 0.75rem;
        text-align: center;
    }
    
    .oncehub-toggle-switch {
        width: 50px;
        height: 26px;
        border-radius: 13px;
        order: 1; /* Place toggle in middle */
    }
    
    .oncehub-toggle-slider {
        width: 22px;
        height: 22px;
    }
    
    .oncehub-toggle-switch.active .oncehub-toggle-slider {
        transform: translateX(24px);
    }
    
    #upcoming-label {
        order: 0; /* Place upcoming label at top */
    }
    
    #past-label {
        order: 2; /* Place past label at bottom */
    }
    
    .oncehub-booking-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .oncehub-booking-title {
        font-size: 1rem;
    }
    
    .oncehub-booking-actions {
        flex-direction: column;
    }
    
    .oncehub-action-btn {
        flex: none;
        min-width: auto;
    }
}

@media (max-width: 380px) {
    .oncehub-toggle-wrapper {
        gap: 0.5rem;
    }
    
    .oncehub-toggle-label {
        font-size: 0.7rem;
    }
    
    .oncehub-toggle-switch {
        width: 45px;
        height: 24px;
        border-radius: 12px;
    }
    
    .oncehub-toggle-slider {
        width: 20px;
        height: 20px;
    }
    
    .oncehub-toggle-switch.active .oncehub-toggle-slider {
        transform: translateX(21px);
    }
    
    .oncehub-title {
        font-size: 1.5rem;
    }
    
    .oncehub-bookings-container {
        padding: 1rem;
    }
}

/* Additional utility classes */
.oncehub-hidden {
    display: none !important;
}

.oncehub-text-center {
    text-align: center;
}