/**
 * Styles CSS pour le frontend Schedule Pay
 * 
 * @package SchedulePay
 * @since 1.0.0
 */

:root {
    --sp-primary-color: #0073aa;
    --sp-secondary-color: #005177;
    --sp-accent-color: #00a32a;
    --sp-error-color: #d63638;
    --sp-warning-color: #dba617;
    --sp-success-color: #00a32a;
    
    --sp-text-color: #1d2327;
    --sp-text-muted: #646970;
    --sp-border-color: #c3c4c7;
    --sp-background-color: #ffffff;
    --sp-background-light: #f6f7f7;
    --sp-background-dark: #f0f0f1;
    
    --sp-border-radius: 8px;
    --sp-border-radius-small: 4px;
    --sp-border-radius-large: 12px;
    
    --sp-spacing-xs: 4px;
    --sp-spacing-sm: 8px;
    --sp-spacing-md: 16px;
    --sp-spacing-lg: 24px;
    --sp-spacing-xl: 32px;
    
    --sp-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --sp-shadow-large: 0 4px 12px rgba(0, 0, 0, 0.15);
    
    --sp-transition: all 0.3s ease;
}

/* ===== GRILLE DES CARTES ===== */
.schedule-pay-cards {
    display: grid;
    gap: var(--sp-spacing-lg);
    margin: var(--sp-spacing-lg) 0;
}

.schedule-pay-cards[data-columns="1"] {
    grid-template-columns: 1fr;
}

.schedule-pay-cards[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.schedule-pay-cards[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.schedule-pay-cards[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .schedule-pay-cards {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .schedule-pay-cards[data-columns="3"],
    .schedule-pay-cards[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== CARTE D'ACTIVITÉ ===== */
.schedule-pay-card {
    background: var(--sp-background-color);
    border: 1px solid var(--sp-border-color);
    border-radius: var(--sp-border-radius-large);
    overflow: hidden;
    box-shadow: var(--sp-shadow);
    transition: var(--sp-transition);
    position: relative;
}

.schedule-pay-card:hover {
    box-shadow: var(--sp-shadow-large);
    transform: translateY(-2px);
}

.schedule-pay-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.schedule-pay-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--sp-transition);
}

.schedule-pay-card:hover .schedule-pay-card-image img {
    transform: scale(1.05);
}

.schedule-pay-card-content {
    padding: var(--sp-spacing-lg);
}

.schedule-pay-card-header {
    margin-bottom: var(--sp-spacing-md);
}

.schedule-pay-card-title {
    margin: 0 0 var(--sp-spacing-sm) 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--sp-text-color);
    line-height: 1.4;
}

.schedule-pay-card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-spacing-xs);
}

.schedule-pay-category-badge {
    background: var(--sp-background-light);
    color: var(--sp-text-muted);
    padding: var(--sp-spacing-xs) var(--sp-spacing-sm);
    border-radius: var(--sp-border-radius-small);
    font-size: 0.875rem;
    font-weight: 500;
}

.schedule-pay-card-excerpt {
    color: var(--sp-text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: var(--sp-spacing-md);
}

.schedule-pay-card-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sp-primary-color);
    margin-bottom: var(--sp-spacing-md);
}

.schedule-pay-card-footer {
    display: flex;
    gap: var(--sp-spacing-sm);
    align-items: center;
}

.schedule-pay-book-button {
    background: var(--sp-primary-color);
    color: white;
    border: none;
    padding: var(--sp-spacing-sm) var(--sp-spacing-lg);
    border-radius: var(--sp-border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--sp-transition);
    flex: 1;
}

.schedule-pay-book-button:hover {
    background: var(--sp-secondary-color);
}

.schedule-pay-view-button {
    color: var(--sp-text-muted);
    text-decoration: none;
    padding: var(--sp-spacing-sm) var(--sp-spacing-md);
    border-radius: var(--sp-border-radius);
    border: 1px solid var(--sp-border-color);
    transition: var(--sp-transition);
    font-size: 0.875rem;
}

.schedule-pay-view-button:hover {
    background: var(--sp-background-light);
    color: var(--sp-text-color);
}

/* ===== MODAL DE RÉSERVATION ===== */
.schedule-pay-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-spacing-md);
}

.schedule-pay-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.schedule-pay-modal-content {
    background: var(--sp-background-color);
    border-radius: var(--sp-border-radius-large);
    box-shadow: var(--sp-shadow-large);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.schedule-pay-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-spacing-lg);
    border-bottom: 1px solid var(--sp-border-color);
}

.schedule-pay-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--sp-text-color);
}

.schedule-pay-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--sp-text-muted);
    padding: var(--sp-spacing-xs);
    line-height: 1;
    transition: var(--sp-transition);
}

.schedule-pay-modal-close:hover {
    color: var(--sp-text-color);
}

.schedule-pay-modal-body {
    padding: var(--sp-spacing-lg);
    max-height: 60vh;
    overflow-y: auto;
}

/* ===== CHARGEMENT ===== */
.schedule-pay-loading {
    text-align: center;
    padding: var(--sp-spacing-xl);
}

.schedule-pay-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--sp-border-color);
    border-top: 4px solid var(--sp-primary-color);
    border-radius: 50%;
    animation: sp-spin 1s linear infinite;
    margin: 0 auto var(--sp-spacing-md);
}

@keyframes sp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== CRÉNEAUX ===== */
.schedule-pay-slots-container {
    display: grid;
    gap: var(--sp-spacing-sm);
}

.schedule-pay-slot {
    background: var(--sp-background-color);
    border: 2px solid var(--sp-border-color);
    border-radius: var(--sp-border-radius);
    padding: var(--sp-spacing-md);
    cursor: pointer;
    transition: var(--sp-transition);
    text-align: left;
}

.schedule-pay-slot:hover {
    border-color: var(--sp-primary-color);
    background: var(--sp-background-light);
}

.schedule-pay-slot.selected {
    border-color: var(--sp-primary-color);
    background: rgba(0, 115, 170, 0.1);
}

.schedule-pay-slot.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--sp-background-dark);
}

.schedule-pay-slot-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schedule-pay-slot-datetime {
    font-weight: 600;
    color: var(--sp-text-color);
}

.schedule-pay-slot-capacity {
    font-size: 0.875rem;
    color: var(--sp-text-muted);
}

.schedule-pay-slot-availability {
    font-size: 0.875rem;
    font-weight: 500;
}

.schedule-pay-slot-availability.available {
    color: var(--sp-success-color);
}

.schedule-pay-slot-availability.full {
    color: var(--sp-error-color);
}

/* ===== FORMULAIRE DE RÉSERVATION ===== */
.schedule-pay-booking-form {
    margin-top: var(--sp-spacing-lg);
}

.schedule-pay-booking-form h4 {
    margin: 0 0 var(--sp-spacing-md) 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--sp-text-color);
}

.schedule-pay-form-group {
    margin-bottom: var(--sp-spacing-md);
}

.schedule-pay-form-group label {
    display: block;
    margin-bottom: var(--sp-spacing-xs);
    font-weight: 600;
    color: var(--sp-text-color);
}

.schedule-pay-form-group input,
.schedule-pay-form-group select {
    width: 100%;
    padding: var(--sp-spacing-sm);
    border: 1px solid var(--sp-border-color);
    border-radius: var(--sp-border-radius);
    font-size: 1rem;
    transition: var(--sp-transition);
}

.schedule-pay-form-group input:focus,
.schedule-pay-form-group select:focus {
    outline: none;
    border-color: var(--sp-primary-color);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.schedule-pay-form-actions {
    display: flex;
    gap: var(--sp-spacing-sm);
    justify-content: flex-end;
    margin-top: var(--sp-spacing-lg);
}

/* ===== BOUTONS ===== */
.schedule-pay-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-spacing-sm) var(--sp-spacing-lg);
    border-radius: var(--sp-border-radius);
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--sp-transition);
    font-size: 0.875rem;
}

.schedule-pay-button-primary {
    background: var(--sp-primary-color);
    color: white;
}

.schedule-pay-button-primary:hover {
    background: var(--sp-secondary-color);
}

.schedule-pay-button-secondary {
    background: var(--sp-background-color);
    color: var(--sp-text-color);
    border: 1px solid var(--sp-border-color);
}

.schedule-pay-button-secondary:hover {
    background: var(--sp-background-light);
}

/* ===== MESSAGES ===== */
.schedule-pay-error {
    background: rgba(214, 54, 56, 0.1);
    border: 1px solid rgba(214, 54, 56, 0.2);
    color: var(--sp-error-color);
    padding: var(--sp-spacing-md);
    border-radius: var(--sp-border-radius);
    margin: var(--sp-spacing-md) 0;
}

.schedule-pay-success {
    background: rgba(0, 163, 42, 0.1);
    border: 1px solid rgba(0, 163, 42, 0.2);
    color: var(--sp-success-color);
    padding: var(--sp-spacing-md);
    border-radius: var(--sp-border-radius);
    margin: var(--sp-spacing-md) 0;
}

.schedule-pay-warning {
    background: rgba(219, 166, 23, 0.1);
    border: 1px solid rgba(219, 166, 23, 0.2);
    color: var(--sp-warning-color);
    padding: var(--sp-spacing-md);
    border-radius: var(--sp-border-radius);
    margin: var(--sp-spacing-md) 0;
}

/* ===== PAGE DE CONFIRMATION ===== */
.schedule-pay-confirmation {
    max-width: 600px;
    margin: var(--sp-spacing-xl) auto;
    padding: var(--sp-spacing-lg);
}

.schedule-pay-confirmation-header {
    text-align: center;
    margin-bottom: var(--sp-spacing-xl);
}

.schedule-pay-confirmation-header h2 {
    margin: 0 0 var(--sp-spacing-md) 0;
    color: var(--sp-success-color);
}

.schedule-pay-success-icon {
    font-size: 4rem;
    color: var(--sp-success-color);
    margin-bottom: var(--sp-spacing-md);
}

.schedule-pay-confirmation-details {
    background: var(--sp-background-color);
    border: 1px solid var(--sp-border-color);
    border-radius: var(--sp-border-radius-large);
    padding: var(--sp-spacing-lg);
    margin-bottom: var(--sp-spacing-lg);
}

.schedule-pay-confirmation-details h3 {
    margin: 0 0 var(--sp-spacing-md) 0;
    color: var(--sp-text-color);
}

.schedule-pay-confirmation-info {
    margin-bottom: var(--sp-spacing-lg);
}

.schedule-pay-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-spacing-sm) 0;
    border-bottom: 1px solid var(--sp-border-color);
}

.schedule-pay-info-item:last-child {
    border-bottom: none;
}

.schedule-pay-info-item strong {
    color: var(--sp-text-color);
}

.schedule-pay-info-item span {
    color: var(--sp-text-muted);
}

.schedule-pay-confirmation-message {
    text-align: center;
    color: var(--sp-text-muted);
    margin-bottom: var(--sp-spacing-lg);
}

.schedule-pay-confirmation-actions {
    display: flex;
    gap: var(--sp-spacing-sm);
    justify-content: center;
}

/* ===== PAGE D'ANNULATION ===== */
.schedule-pay-cancellation {
    max-width: 600px;
    margin: var(--sp-spacing-xl) auto;
    padding: var(--sp-spacing-lg);
}

.schedule-pay-cancellation-header {
    text-align: center;
    margin-bottom: var(--sp-spacing-xl);
}

.schedule-pay-cancellation-header h2 {
    margin: 0 0 var(--sp-spacing-md) 0;
    color: var(--sp-error-color);
}

.schedule-pay-cancel-icon {
    font-size: 4rem;
    color: var(--sp-error-color);
    margin-bottom: var(--sp-spacing-md);
}

.schedule-pay-cancellation-message {
    background: var(--sp-background-color);
    border: 1px solid var(--sp-border-color);
    border-radius: var(--sp-border-radius-large);
    padding: var(--sp-spacing-lg);
    margin-bottom: var(--sp-spacing-lg);
    text-align: center;
    color: var(--sp-text-muted);
}

.schedule-pay-cancellation-actions {
    display: flex;
    gap: var(--sp-spacing-sm);
    justify-content: center;
}

/* ===== MESSAGES D'ERREUR ===== */
.schedule-pay-no-activities {
    text-align: center;
    padding: var(--sp-spacing-xl);
    color: var(--sp-text-muted);
    background: var(--sp-background-light);
    border-radius: var(--sp-border-radius);
    margin: var(--sp-spacing-lg) 0;
}

/* ===== CARTES HORIZONTALES ===== */
.schedule-pay-cards-horizontal {
    display: flex;
    flex-direction: column;
    gap: var(--sp-spacing-lg);
}

.schedule-pay-card-horizontal {
    display: flex;
    background: var(--sp-background-color);
    border: 1px solid var(--sp-border-color);
    border-radius: var(--sp-border-radius-large);
    overflow: hidden;
    box-shadow: var(--sp-shadow);
    transition: var(--sp-transition);
    height: 260px;
    position: relative;
}

.schedule-pay-card-horizontal:hover {
    box-shadow: var(--sp-shadow-large);
    transform: translateY(-2px);
}

.schedule-pay-card-horizontal .schedule-pay-card-image {
    flex-shrink: 0;
    width: 360px;
    height: 260px;
    position: relative;
    overflow: hidden;
}

.schedule-pay-card-horizontal .schedule-pay-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--sp-transition);
}

.schedule-pay-card-horizontal:hover .schedule-pay-card-image img {
    transform: scale(1.05);
}

.schedule-pay-card-horizontal .schedule-pay-card-content {
    flex: 1;
    padding: var(--sp-spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.schedule-pay-card-horizontal .schedule-pay-card-header {
    margin-bottom: var(--sp-spacing-sm);
}

.schedule-pay-card-horizontal .schedule-pay-card-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sp-text-color);
    line-height: 1.3;
}

.schedule-pay-card-horizontal .schedule-pay-card-description {
    color: var(--sp-text-muted);
    font-size: 0.938rem;
    line-height: 1.5;
    margin-bottom: var(--sp-spacing-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.schedule-pay-card-horizontal .schedule-pay-card-date {
    display: flex;
    align-items: center;
    gap: var(--sp-spacing-xs);
    font-size: 0.938rem;
    color: var(--sp-text-color);
    margin-bottom: var(--sp-spacing-md);
}

.schedule-pay-card-horizontal .schedule-pay-date-icon {
    font-size: 1.125rem;
}

.schedule-pay-card-horizontal .schedule-pay-date-text {
    font-weight: 600;
}

.schedule-pay-card-horizontal .schedule-pay-slots-count {
    color: var(--sp-text-muted);
    font-size: 0.875rem;
    font-weight: 400;
}

.schedule-pay-card-horizontal .schedule-pay-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-spacing-md);
    margin-top: auto;
}

.schedule-pay-card-horizontal .schedule-pay-card-price {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sp-primary-color);
}

.schedule-pay-add-to-cart-form {
    display: inline-block;
    margin: 0;
}

.schedule-pay-add-to-cart-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-spacing-xs);
    background: var(--sp-primary-color);
    color: white;
    text-decoration: none;
    border: none;
    padding: var(--sp-spacing-md) var(--sp-spacing-xl);
    border-radius: var(--sp-border-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--sp-transition);
    white-space: nowrap;
}

.schedule-pay-add-to-cart-button:hover {
    background: var(--sp-secondary-color);
    color: white;
    text-decoration: none;
}

/* Responsive pour les cartes horizontales */
@media (max-width: 992px) {
    .schedule-pay-card-horizontal {
        height: auto;
        min-height: 260px;
    }
    
    .schedule-pay-card-horizontal .schedule-pay-card-image {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .schedule-pay-card-horizontal {
        flex-direction: column;
        height: auto;
    }
    
    .schedule-pay-card-horizontal .schedule-pay-card-image {
        width: 100%;
        height: 200px;
    }
    
    .schedule-pay-card-horizontal .schedule-pay-card-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .schedule-pay-add-to-cart-form {
        display: block;
        width: 100%;
    }
    
    .schedule-pay-add-to-cart-button {
        width: 100%;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .schedule-pay-modal {
        padding: var(--sp-spacing-sm);
    }
    
    .schedule-pay-modal-content {
        max-height: 95vh;
    }
    
    .schedule-pay-modal-header,
    .schedule-pay-modal-body {
        padding: var(--sp-spacing-md);
    }
    
    .schedule-pay-card-content {
        padding: var(--sp-spacing-md);
    }
    
    .schedule-pay-card-footer {
        flex-direction: column;
    }
    
    .schedule-pay-book-button,
    .schedule-pay-view-button {
        width: 100%;
        text-align: center;
    }
    
    .schedule-pay-form-actions {
        flex-direction: column;
    }
    
    .schedule-pay-confirmation-actions,
    .schedule-pay-cancellation-actions {
        flex-direction: column;
    }
    
    .schedule-pay-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--sp-spacing-xs);
    }
}

/* ===== ACCESSIBILITÉ ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.schedule-pay-button:focus,
.schedule-pay-slot:focus {
    outline: 2px solid var(--sp-primary-color);
    outline-offset: 2px;
}

/* ===== IMPRESSION ===== */
@media print {
    .schedule-pay-modal,
    .schedule-pay-book-button,
    .schedule-pay-form-actions {
        display: none !important;
    }
    
    .schedule-pay-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}
