/**
 * Booking Calendar - Frontend CSS
 * Version 3.0.0 - Enhanced with Service Selection
 */

/* Variables globales */
:root {
    --primary-color: #3f7da2;
    --primary-light: #5a8db8;
    --success-color: #48bb78;
    --danger-color: #fc8181;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

/* Reset */
.weeben-booking-wrapper * {
    box-sizing: border-box;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* Wrapper principal */
.weeben-booking-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

/* ==========================================
   SECTION 1 : SÉLECTION DU SERVICE
   ========================================== */

#service-selection-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    color: #1e293b;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.service-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
service-price
.service-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 12px 32px rgba(63, 125, 162, 0.2);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card.selected {
    border-color: var(--primary-color);
    border-width: 3px;
    background: linear-gradient(135deg, rgba(63, 125, 162, 0.1), rgba(90, 141, 184, 0.05));
}

.service-card.selected::before {
    transform: scaleX(1);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.service-name {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #1e293b;
}

.service-description {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 20px 0;
    min-height: 60px;
}

.service-details, .service-price {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 8px;
}

.service-duration,
.service-price {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #475569;
}

.service-duration svg,
.service-price svg {
    color: var(--primary-color);
}

.service-select-btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.service-select-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(63, 125, 162, 0.4);
}

/* ==========================================
   SECTION 2 : SÉLECTION DE DATE
   ========================================== */

.selected-service-badge {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 20px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: slideUp 0.4s ease;
}

.btn-back {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    color: #475569;
}

.btn-back:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateX(-2px);
}

/* Navigation semaine */
.week-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    animation: slideUp 0.4s ease;
}

.week-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(138, 138, 138, 0.2);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.week-nav-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

#week-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

/* Calendrier semaine */
.week-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease;
}

.day-unavailable {
    background: rgba(130, 130, 130, 0.1) !important;
}

.day-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.day-card:hover:not(.day-past):not(.day-blocked):not(.day-unavailable) {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.day-card.day-selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.day-card.day-past {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.day-card.day-blocked {
    background: rgba(252, 129, 129, 0.1);
    border-color: rgba(252, 129, 129, 0.3);
    cursor: not-allowed;
    pointer-events: none;
}

.day-name {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 8px;
}

.day-number {
    font-size: 28px;
    font-weight: 700;
    margin: 8px 0;
}

.day-month {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 8px;
}

.day-bookings {
    font-size: 11px;
    padding: 4px 8px;
    background: rgba(138, 138, 138, 0.2);
    border-radius: 4px;
    margin-top: 8px;
}

.day-selected .day-bookings {
    background: rgba(255, 255, 255, 0.2);
}

/* Section créneaux */
#slots-section {
    margin: 30px 0;
    animation: slideUp 0.4s ease;
}

.slots-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.slots-header h3 {
    margin: 0;
    font-size: 20px;
}

#selected-date-display {
    padding: 8px 16px;
    background: var(--primary-color);
    border-radius: 8px;
    color: #ffffff;
    font-weight: 600;
}

.slots-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.slots-period {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
}

.slots-period h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
}

.slots-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.time-slot {
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    color: var(--text);
}

.time-slot:hover:not(.unavailable) {
    border-color: var(--primary-color);
    background: rgba(63, 125, 162, 0.1);
}

.time-slot.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.time-slot.unavailable {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Bouton prochaine disponibilité */
.btn-next-available {
    padding: 16px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-next-available:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn-next-available svg {
    animation: slideRight 1s ease-in-out infinite;
}

/* ==========================================
   SECTION 3 : FORMULAIRE
   ========================================== */

.booking-form-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 30px;
    margin-top: 30px;
    animation: slideUp 0.4s ease;
}

.booking-form-card h3 {
    margin: 0 0 20px 0;
    font-size: 22px;
}

#booking-summary {
    padding: 15px;
    background: rgba(117, 117, 117, 0.1);
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    font-size: 15px;
    transition: border-color 0.2s;
}

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

.btn-submit,
.btn-new {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit:hover,
.btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(63, 125, 162, 0.4);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Message de succès */
#booking-success {
    animation: fadeIn 0.5s ease;
}

.success-card {
    text-align: center;
    padding: 60px 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.success-icon {
    margin-bottom: 20px;
}

.success-icon svg {
    color: var(--success-color);
}

.success-card h3 {
    color: var(--success-color);
    margin-bottom: 10px;
    font-size: 28px;
}

.success-card p {
    color: #64748b;
    font-size: 16px;
    margin-bottom: 20px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .weeben-booking-wrapper {
        padding: 10px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-details, .service-price{
        flex-direction: column;
        gap: 10px;
    }

    .week-calendar {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .day-card {
        padding: 12px;
    }
    
    .day-number {
        font-size: 20px;
    }
    
    .slots-grid {
        grid-template-columns: 1fr;
    }
    
    .slots-container {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .booking-form-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .week-navigation {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    #week-title {
        font-size: 18px;
    }
    
    .day-card {
        padding: 10px;
    }
    
    .day-number {
        font-size: 18px;
    }
    
    .service-card {
        padding: 20px;
    }
    
    .service-name {
        font-size: 20px;
    }
}
/* ============================================
   GRILLE HORAIRE AVEC POSITION ABSOLUE
   Version 3.0 - Style Google Calendar
   ============================================ */

/* Conteneur principal */
.calendar-timeline-container {
    position: relative;
    background: white;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
}

/* Grille horaire de fond */
.timeline-grid {
    position: relative;
    z-index: 1;
}

/* Chaque ligne horaire (15 minutes) */
.timeline-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

/* Lignes des heures pleines plus visibles */
.timeline-row.hour-mark {
    border-bottom: 2px solid #cbd5e0;
    background: #fafbfc;
}

/* Lignes fermées */
.timeline-row.closed {
    background: #f8f9fa;
}

/* Colonne horaire */
.timeline-time {
    padding: 8px;
    font-weight: 700;
    font-size: 14px;
    color: #475569;
    background: #f8fafc;
    border-right: 2px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}

/* Horaires des quarts d'heure */
.timeline-time-small {
    padding: 8px;
    font-size: 11px;
    color: #94a3b8;
    background: #fcfcfc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}

/* Colonne contenu */
.timeline-content {
    position: relative;
    padding: 4px 8px;
}

/* Label "Fermé" */
.timeline-closed-label {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
    opacity: 0.6;
}

/* ============================================
   RENDEZ-VOUS EN POSITION ABSOLUE
   ============================================ */

/* Conteneur overlay pour les rendez-vous */
.timeline-bookings-overlay {
    position: absolute;
    top: 0;
    left: 80px; /* Largeur de la colonne horaire */
    right: 0;
    bottom: 0;
    z-index: 10;
    pointer-events: none; /* Permet de cliquer à travers */
}

/* Bloc de rendez-vous */
.timeline-booking-absolute {
    position: absolute;
    left: 8px;
    right: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 4px solid rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: auto; /* Réactive les clics sur les rendez-vous */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    backdrop-filter: blur(10px);
}

/* Effet hover */
.timeline-booking-absolute:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    z-index: 20;
}

/* Overlay sombre au hover */
.timeline-booking-absolute::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s;
    pointer-events: none;
}

.timeline-booking-absolute:hover::before {
    background: rgba(0, 0, 0, 0.1);
}

/* Contenu du rendez-vous */
.timeline-booking-absolute > * {
    position: relative;
    z-index: 1;
}

.booking-abs-time {
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 4px;
    opacity: 0.95;
}

.booking-abs-client {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.booking-abs-service {
    font-size: 11px;
    opacity: 0.85;
    font-style: italic;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.booking-abs-status {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    margin-top: auto;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .timeline-row {
        grid-template-columns: 60px 1fr;
    }
    
    .timeline-bookings-overlay {
        left: 60px;
    }
    
    .timeline-time {
        font-size: 12px;
        padding: 6px;
    }
    
    .booking-abs-client {
        font-size: 13px;
    }
    
    .booking-abs-service {
        font-size: 10px;
    }
}

/* ============================================
   ANIMATION SCROLL SMOOTH
   ============================================ */

.day-details-section {
    scroll-behavior: smooth;
}

/* ============================================
   INDICATEUR D'HEURE ACTUELLE (bonus)
   ============================================ */

.current-time-indicator {
    position: absolute;
    left: 80px;
    right: 8px;
    height: 2px;
    background: #fc8181;
    z-index: 15;
    pointer-events: none;
}

.current-time-indicator::before {
    content: '';
    position: absolute;
    left: -6px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fc8181;
}