/**
 * NaifarLab - Frontend Styles
 * Path: assets/css/frontend.css
 */

:root {
    --primary: #2E2A39;
    --primary-light: #2E2A39BF;
    --secondary: #D7D3D2;
    --accent: #3B82F6;
    --success: #10B981;
    --danger: #EF4444;
    --white: #FFFFFF;
    --text: #1F2937;
    --text-light: #6B7280;
    --border: #E5E7EB;
    --bg: #F9FAFB;
}

* {
    box-sizing: border-box;
}

.naifarlab-booking-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.naifarlab-booking-header {
    text-align: center;
    margin-bottom: 3rem;
    text-transform: none;
}

.naifarlab-booking-header h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}
.naifarlab-booking-header h2 {
    text-transform: none !important;
}

.naifarlab-booking-header .subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    margin: 0;
}

/* Calendrier */
.naifarlab-calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(46, 42, 57, 0.08);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
}

.naifarlab-calendar-controls h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 600;
}

.btn-nav {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: bold;
}

.btn-nav:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px #2E2A39;
}

.naifarlab-filter-services {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(46, 42, 57, 0.08);
}

.naifarlab-filter-services label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary);
}

.naifarlab-filter-services select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.naifarlab-filter-services select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.naifarlab-calendar {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(46, 42, 57, 0.1);
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.calendar-day-name {
    text-align: center;
    font-weight: 600;
    color: var(--primary);
    padding: 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--white);
    position: relative;
    overflow: hidden;
}

.calendar-day:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.calendar-day.other-month {
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-day.has-slots {
    background: linear-gradient(135deg, #F0F9FF 0%, #DBEAFE 100%);
    border-color: var(--accent);
}

.calendar-day.today {
    border-color: var(--success);
    border-width: 3px;
}

.calendar-day-number {
    font-weight: 600;
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.calendar-day-slots {
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 0.25rem;
}

.slot-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

/* Modal */
.naifarlab-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(46, 42, 57, 0.75);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.naifarlab-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.naifarlab-modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(46, 42, 57, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.naifarlab-modal-close {
    float: right;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.naifarlab-modal-close:hover {
    color: var(--danger);
}

.naifarlab-modal-content h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary);
    font-size: 1.75rem;
}

#selected-date {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* Services avec checkboxes */
.services-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.service-checkbox-item {
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.service-checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.service-checkbox-content {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.service-checkbox-item:hover .service-checkbox-content {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    transform: translateX(3px);
}

.service-checkbox-item.selected .service-checkbox-content {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border-color: var(--accent);
    border-width: 3px;
}

.service-checkbox-badge {
    width: 12px;
    height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
}

.service-checkbox-info {
    flex: 1;
}

.service-checkbox-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.service-checkbox-meta {
    display: flex;
    gap: 15px;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.service-category {
    color: var(--text-light);
    font-style: italic;
}

.service-time-range {
    color: var(--accent);
    font-weight: 600;
}

.service-checkbox-check {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: transparent;
    transition: all 0.3s ease;
    background: var(--white);
    flex-shrink: 0;
}

.service-checkbox-item.selected .service-checkbox-check {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
    transform: scale(1.1);
}

.btn-show-times {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, #2563EB 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-show-times:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-show-times:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.selected-services-summary {
    background: #F0F9FF;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent);
}

.selected-services-summary strong {
    color: var(--primary);
}

.selected-service-tag {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    margin: 5px 5px 0 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.service-choice-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--white);
    border: 2px solid var(--border);
    border-left: 4px solid;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.service-choice-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(46, 42, 57, 0.15);
}

.service-choice-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    flex-shrink: 0;
}

.service-choice-info {
    flex: 1;
}

.service-choice-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.service-choice-category {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 5px;
    font-style: italic;
}

.service-choice-count {
    font-size: 0.875rem;
    color: var(--text-light);
}

.service-choice-arrow {
    font-size: 1.5rem;
    font-weight: 700;
    transition: transform 0.3s ease;
}

.service-choice-card:hover .service-choice-arrow {
    transform: translateX(5px);
}

/* Grille de créneaux horaires */
.btn-back-to-services {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 8px 0;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-back-to-services:hover {
    gap: 12px;
    color: #2563EB;
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.time-slot-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-slot-item:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.time-slot-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.time-slot-time {
    font-size: 1.25rem;
    font-weight: 700;
}

.time-slot-item:hover .time-slot-icon {
    animation: pulse 0.6s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Ancien style slots - à supprimer mais garde pour transition */
.slot-item {
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: var(--white);
}

.slot-item:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.slot-item:hover .slot-service {
    color: var(--white);
}

.slot-time {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.slot-service {
    font-size: 0.875rem;
    color: var(--text-light);
    transition: color 0.3s ease;
}

/* Légende */
.naifarlab-legend {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(46, 42, 57, 0.08);
}

.naifarlab-legend h4 {
    margin: 0 0 1rem 0;
    color: var(--primary);
    font-size: 1.125rem;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* Formulaire */
.btn-back {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.btn-back:hover {
    gap: 0.75rem;
}

.naifarlab-booking-summary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(46, 42, 57, 0.2);
}

.naifarlab-booking-summary h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    text-transform : none;
    color: #D7D3D2;
}

.summary-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item strong {
    display: inline-block;
    width: 120px;
}

#booking-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(46, 42, 57, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: 600;
}

.required {
    color: var(--danger);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.btn-submit,
.btn-primary {
    width: 100%;
    padding: 1rem 2rem;
    background: #2E2A39;
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-submit:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-submit:active,
.btn-primary:active {
    transform: translateY(0);
}

/* Confirmation améliorée */
.naifarlab-step-confirmation {
    max-width: 700px;
    margin: 0 auto;
}

.confirmation-success-banner {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-radius: 16px;
    margin-bottom: 30px;
}

.confirmation-icon-wrapper {
    margin-bottom: 25px;
}

.confirmation-icon-animated {
    animation: checkmarkPop 0.6s ease;
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.confirmation-title {
    font-size: 2rem;
    color: #065F46;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.confirmation-subtitle {
    font-size: 1.125rem;
    color: #059669;
    margin: 0;
}

.confirmation-content {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(46, 42, 57, 0.1);
}

.confirmation-info-box {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: #FEF3C7;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid #F59E0B;
}

.info-box-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.info-box-content h3 {
    margin: 0 0 10px 0;
    color: #92400E;
    font-size: 1.25rem;
}

.info-box-content p {
    margin: 0;
    color: #78350F;
    line-height: 1.6;
}

.confirmation-steps {
    margin-bottom: 30px;
}

.confirmation-steps h3 {
    margin: 0 0 20px 0;
    color: var(--primary);
    font-size: 1.25rem;
}

.step-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.step-item:last-child {
    border-bottom: none;
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent) 0%, #2563EB 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    color: var(--text);
    line-height: 1.6;
}

.step-text strong {
    color: var(--primary);
}

.confirmation-important {
    background: #EFF6FF;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid var(--accent);
}

.confirmation-important h3 {
    margin: 0 0 15px 0;
    color: #1E40AF;
    font-size: 1.125rem;
}

.confirmation-important ul {
    margin: 0;
    padding-left: 20px;
    color: #1E40AF;
    line-height: 1.8;
}

.confirmation-important li {
    margin-bottom: 8px;
}

.confirmation-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-large {
    flex: 1;
    min-width: 200px;
    font-size: 1.125rem;
    padding: 18px 30px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 200px;
    padding: 18px 30px;
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

@media (max-width: 768px) {
    .confirmation-actions {
        flex-direction: column;
    }
    
    .btn-large,
    .btn-secondary {
        width: 100%;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .naifarlab-booking-header h2 {
        font-size: 2rem;
    }

    .calendar-day-name {
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .calendar-day {
        padding: 0.25rem;
    }

    .calendar-day-number {
        font-size: 0.875rem;
    }

    #available-slots {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .naifarlab-modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    .summary-item strong {
        display: block;
        margin-bottom: 0.25rem;
    }
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}