/* Franchise Booking System - Styles */

.fbs-booking-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* ==================== SYSTÈME D'ÉTAPES ==================== */

/* Masquer toutes les étapes par défaut */
.fbs-step {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

/* Afficher uniquement l'étape active */
.fbs-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fbs-step-title {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #0073aa;
}

/* Boutons de navigation */
.fbs-navigation {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: space-between;
}

.fbs-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fbs-btn-next {
    background: #0073aa;
    color: #fff;
    margin-left: auto;
}

.fbs-btn-next:hover:not(:disabled) {
    background: #005177;
    transform: translateX(3px);
}

.fbs-btn-back {
    background: #f5f5f5;
    color: #333;
}

.fbs-btn-back:hover {
    background: #e0e0e0;
    transform: translateX(-3px);
}

.fbs-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fbs-arrow {
    font-size: 1.2em;
}

/* Indicateur de progression */
.fbs-progress {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.fbs-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    flex: 1;
    max-width: 120px;
}

.fbs-progress-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s;
}

.fbs-progress-step.active .fbs-progress-number {
    background: #0073aa;
    color: #fff;
    transform: scale(1.1);
}

.fbs-progress-step.completed .fbs-progress-number {
    background: #28a745;
    color: #fff;
}

.fbs-progress-label {
    font-size: 0.85em;
    color: #666;
    text-align: center;
}

.fbs-progress-step.active .fbs-progress-label {
    color: #0073aa;
    font-weight: 600;
}

/* ==================== SERVICES LIST ==================== */

.fbs-services-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    max-height: 450px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Scrollbar personnalisée */
.fbs-services-grid::-webkit-scrollbar {
    width: 6px;
}

.fbs-services-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.fbs-services-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.fbs-services-grid::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.fbs-service-card {
    background: #fff;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 15px;
    gap: 15px;
}

.fbs-service-card:hover {
    border-color: #4cd964;
    background: #f9fff9;
}

.fbs-service-card.selected {
    border-color: #4cd964;
    background: #f0fff0;
    box-shadow: 0 2px 8px rgba(76, 217, 100, 0.15);
}

/* Image ronde à gauche */
.fbs-service-image {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fbs-service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Contenu central */
.fbs-service-content {
    flex: 1;
    min-width: 0;
}

.fbs-service-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.fbs-service-card h4 {
    margin: 0;
    color: #333;
    font-size: 1em;
    font-weight: 600;
    line-height: 1.3;
}

/* Badge de durée vert */
.fbs-service-duration {
    display: inline-block;
    background: #4cd964;
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
    white-space: nowrap;
}

.fbs-service-duration:before {
    content: none;
}

.fbs-service-description {
    color: #666;
    font-size: 0.85em;
    margin: 8px 0 0 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fbs-service-see-more {
    color: #4cd964;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    margin-top: 5px;
    display: inline-block;
}

.fbs-service-see-more:hover {
    text-decoration: underline;
}

/* Prix à droite */
.fbs-service-price {
    color: #4cd964;
    font-size: 1.3em;
    font-weight: 600;
    font-style: italic;
    white-space: nowrap;
    min-width: 90px;
    text-align: right;
    align-self: center;
}

.fbs-service-card.selected .fbs-service-price {
    color: #3cb853;
}

/* Checkmark pour la sélection */
.fbs-service-card.selected::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #4cd964;
    border-radius: 12px 0 0 12px;
}

.fbs-service-price-badge {
    display: inline-block;
    background: #28a745;
    color: #fff;
    font-size: 0.5em;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Practitioners Grid */
.fbs-practitioners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.fbs-practitioner-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    text-align: center;
}

.fbs-practitioner-card:hover {
    border-color: #0073aa;
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 115, 170, 0.15);
}

.fbs-practitioner-card.selected {
    border-color: #0073aa;
    background: #f0f8ff;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.2);
}

.fbs-practitioner-card h4 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.fbs-no-practitioners {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 1.1em;
}

.fbs-no-services {
    text-align: center;
    padding: 40px;
    color: #999;
    background: #f9f9f9;
    border-radius: 8px;
}

/* ==================== CONFIRMATION ==================== */

.fbs-confirmation {
    text-align: center;
    padding: 60px 20px;
}

.fbs-success-icon {
    width: 80px;
    height: 80px;
    background: #28a745;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    margin: 0 auto 30px;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.fbs-confirmation h3 {
    color: #28a745;
    font-size: 2em;
    margin-bottom: 15px;
}

.fbs-confirmation p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

/* ==================== LOADER ==================== */

.fbs-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.fbs-loader:before {
    content: '';
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== RÉCAPITULATIF ==================== */

.fbs-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.fbs-summary h4 {
    margin-top: 0;
    color: #333;
}

.fbs-summary-content p {
    margin: 10px 0;
    font-size: 1.05em;
}

.fbs-summary-content strong {
    color: #0073aa;
}

/* ==================== SELECTS ET INPUTS ==================== */

.fbs-select,
.fbs-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s;
    background: #fff;
}

.fbs-select:focus,
.fbs-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.fbs-select:disabled,
.fbs-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Bouton submit */
.fbs-btn-submit {
    width: 100%;
    padding: 15px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.fbs-btn-submit:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.fbs-btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Messages d'erreur */
.fbs-error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* Info cards */
.fbs-franchise-info {
    margin-top: 20px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

.fbs-info-card {
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    padding: 15px 20px;
    border-radius: 4px;
}

.fbs-info-card h4 {
    margin: 0 0 10px 0;
    color: #0073aa;
}

.fbs-info-card p {
    margin: 5px 0;
    color: #666;
}

#fbs-message {
    display: none;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
}

#fbs-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

#fbs-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.fbs-form-step {
    margin-bottom: 30px;
}

.fbs-form-step h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.fbs-form-group {
    margin-bottom: 20px;
}

.fbs-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.fbs-form-group select,
.fbs-form-group input[type="text"],
.fbs-form-group input[type="email"],
.fbs-form-group input[type="tel"],
.fbs-form-group input[type="date"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.fbs-form-group select:focus,
.fbs-form-group input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.fbs-form-group select:disabled,
.fbs-form-group input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.fbs-form-group .error {
    border-color: #dc3545;
}

/* Grille de créneaux horaires */
.fbs-slots-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.fbs-time-slot {
    padding: 15px 12px;
    background-color: #fff;
    border: 2px solid #0073aa;
    border-radius: 8px;
    color: #0073aa;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
    margin-bottom: 10px;
    display: block;
    width: 100%;
}

.fbs-time-slot small {
    display: block;
    font-size: 12px;
    margin-top: 5px;
    font-weight: normal;
    opacity: 0.9;
}

.fbs-time-slot:hover {
    background-color: #0073aa;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,115,170,0.2);
}

.fbs-time-slot.selected {
    background-color: #005177;
    color: #fff;
    border-color: #005177;
}

.fbs-no-slots {
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 4px;
    color: #6c757d;
}

.fbs-error {
    padding: 15px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
}

/* Section informations client */
#fbs-customer-info {
    display: none;
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

#fbs-customer-info h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.fbs-submit-btn {
    width: 100%;
    padding: 15px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.fbs-submit-btn:hover {
    background-color: #005177;
}

.fbs-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .fbs-booking-container {
        padding: 15px;
    }

    .fbs-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .fbs-time-slot {
        padding: 10px;
        font-size: 14px;
    }
}

/* ==================== CALENDRIER ==================== */

.fbs-calendar-wrapper {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

#fbs-calendar-container {
    flex: 2;
    min-width: 0;
}

.fbs-calendar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
}

#fbs-time-slots {
    flex: 1;
    min-width: 0;
}

.fbs-time-slots h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
}

.fbs-slots-container {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

.fbs-slots-container::-webkit-scrollbar {
    width: 6px;
}

.fbs-slots-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.fbs-slots-container::-webkit-scrollbar-thumb {
    background: #0073aa;
    border-radius: 3px;
}

.fbs-slots-container::-webkit-scrollbar-thumb:hover {
    background: #005177;
}

.fbs-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.fbs-calendar-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
}

.fbs-calendar-prev,
.fbs-calendar-next {
    background: #f5f5f5;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    color: #555;
    transition: all 0.2s;
}

.fbs-calendar-prev:hover,
.fbs-calendar-next:hover {
    background: #0073aa;
    color: #fff;
}

.fbs-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.fbs-calendar-weekday {
    text-align: center;
    font-weight: 600;
    color: #666;
    padding: 10px 0;
    font-size: 0.9em;
}

.fbs-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.fbs-calendar-day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.fbs-calendar-day-empty {
    border: none;
    cursor: default;
}

.fbs-calendar-day-number {
    font-size: 1.1em;
    font-weight: 500;
    color: #333;
}

.fbs-calendar-day-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #0073aa;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    font-weight: 600;
}

/* États des jours */
.fbs-calendar-day-past {
    background: #f9f9f9;
    color: #ccc;
    cursor: not-allowed;
    border-color: #f0f0f0;
}

.fbs-calendar-day-past .fbs-calendar-day-number {
    color: #ccc;
}

.fbs-calendar-day-today {
    border-color: #0073aa;
    font-weight: 600;
}

.fbs-calendar-day-available {
    border-color: #28a745;
    background: #f0fdf4;
}

.fbs-calendar-day-available:hover {
    border-color: #28a745;
    background: #dcfce7;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
}

.fbs-calendar-day-full {
    background: #fee;
    border-color: #fcc;
    cursor: not-allowed;
}

.fbs-calendar-day-selected {
    border-color: #005177 !important;
    background: #005177 !important;
    box-shadow: 0 4px 12px rgba(0, 81, 119, 0.3);
}

.fbs-calendar-day-selected .fbs-calendar-day-number {
    color: #fff;
}

.fbs-calendar-day-selected .fbs-calendar-day-badge {
    background: #fff;
    color: #005177;
}

/* Container des créneaux du jour */
#fbs-day-slots {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

#fbs-day-slots h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    /* Container principal */
    .fbs-booking-container {
        padding: 15px;
    }

    /* Titres des étapes */
    .fbs-step-title {
        font-size: 1.4em;
        padding-bottom: 10px;
    }

    /* Navigation */
    .fbs-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .fbs-arrow {
        font-size: 1em;
    }

    /* Progress */
    .fbs-progress {
        gap: 5px;
        padding-top: 20px;
    }

    .fbs-progress-step {
        max-width: 80px;
    }

    .fbs-progress-number {
        width: 35px;
        height: 35px;
        font-size: 0.9em;
    }

    .fbs-progress-label {
        font-size: 0.75em;
    }

    /* Services cards */
    .fbs-services-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .fbs-service-card {
        padding: 15px;
    }

    .fbs-service-card h4 {
        font-size: 1.1em;
    }

    .fbs-service-price {
        font-size: 1.2em;
    }

    /* Calendrier */
    .fbs-calendar {
        padding: 15px;
    }

    .fbs-calendar-title {
        font-size: 1.1em;
    }

    .fbs-calendar-prev,
    .fbs-calendar-next {
        width: 35px;
        height: 35px;
    }

    .fbs-calendar-weekday {
        font-size: 0.8em;
        padding: 5px 0;
    }

    .fbs-calendar-day-number {
        font-size: 1em;
    }

    .fbs-calendar-day-badge {
        width: 18px;
        height: 18px;
        font-size: 0.7em;
    }

    /* Slots */
    .fbs-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }

    .fbs-time-slot {
        padding: 10px;
        font-size: 14px;
    }

    /* Confirmation */
    .fbs-success-icon {
        width: 60px;
        height: 60px;
        font-size: 2em;
    }

    .fbs-confirmation h3 {
        font-size: 1.5em;
    }

    .fbs-confirmation p {
        font-size: 1em;
    }

    /* Summary */
    .fbs-summary {
        padding: 15px;
    }

    .fbs-summary-content p {
        font-size: 1em;
    }
}
