/**
 * CSS pour le Tunnel de Réservation Tickera
 * Fichier: tunnel-reservation.css
 */

:root {
    --color-gold: #CA9647;
    --color-gold-a: rgba(202, 150, 71, .2);
    --color-main: #2C224F;
    --color-light: #FFFFFF;
}

.tunnel-reservation-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Indicateurs d'étapes */
.tunnel-steps {
    display: flex;
    justify-content: center;
    gap: 10rem;
    margin-bottom: 40px;
    padding: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 13px;
    color: var(--color-main);

}

.step span {
    font-size: 18px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 50%;
    padding: 10px;
    margin: 0 10px;
    transition: all 0.3s ease;
    position: relative;
    color: var(--color-main);
    border: 1px solid #cd9d54;
}

.step.active span {
    background: #cd9d54;
    color: var(--color-light);
}

/* Layout mobile - calendrier visible seulement à l'étape 1 */
@media (max-width: 1023px) {
    .calendar-section {
        display: none;
    }

    .step-1 .calendar-section {
        display: block;
    }

    .tunnel-steps-content {
        width: 100%;
    }
}

/* Layout desktop - calendrier visible aux étapes 2 et 3 */
@media (min-width: 1024px) {
    .tunnel-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .calendar-section {
        display: block;
        width: 100%;
    }

    .tunnel-steps-content {
        display: flex;
        flex-direction: column;
    }

    .step-1 .tunnel-content {
        grid-template-columns: 1fr;
        justify-items: center;
        width: 600px;
        margin: 0 auto;
    }

    .step-1 .tunnel-steps-content {
        display: none;
    }

    .step-1 .calendar-container {
        width: 100%;
        max-width: 700px;
    }
}

/* Étapes du tunnel */
.tunnel-step {
    display: none;
    min-height: 400px;
}

.tunnel-step.active {
    display: block;
}

.tunnel-step h2 {
    text-align: center;
    color: var(--color-main);
    margin-bottom: 30px;
    font-size: 28px;
}

/* ÉTAPE 1: Calendrier */
.calendar-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--color-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-main);
    padding: 20px;
}

.calendar-month-year {
    font-size: 16px;
    font-weight: 600;
}

.calendar-nav {
    background: none;
    color: #cd9d54;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    transition: background-color 0.2s;
}

.calendar-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.calendar-grid {
    padding: 20px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 15px;
}

.weekday {
    text-align: center;
    text-transform: uppercase;
    font-weight: 600;
    color: #666;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    border: 2px solid transparent;
    font-size: 14px;
    width: 34px;
}

.calendar-day:hover {
    background: #f0f0f0;
}

.calendar-day.other-month {
    color: #ccc;
    cursor: default;
}

.calendar-day.past-date {
    color: #ccc;
    cursor: not-allowed;
}

.calendar-day.has-events {
    cursor: pointer;
    font-weight: 700;
}

.calendar-day.has-events.available {
    background: var(--color-gold-a);
    color: var(--color-gold);
}

.calendar-day.has-events.available:hover {
    background: color-mix(in srgb, var(--color-gold) 80%, black);
    transform: scale(1.05);
}

.calendar-day.has-events.available.selected {
    background: var(--color-gold);
    color: var(--color-light);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(202, 150, 71, 0.4);
}


.calendar-day.has-events.sold-out {
    background: #dc3545;
    color: #dc3545;
    border-color: #f5c6cb;
    cursor: not-allowed;
}

/* Légende du calendrier */
.calendar-legend {
    display: flex;
    gap: 30px;
    max-width: 600px;
    margin: 30px auto;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.legend-color.available {
    background: var(--color-gold-a);
    color: var(--color-gold);
}

.legend-color.sold-out {
    background: #dc3545;
}

.legend-text {
    font-size: 12px;
    font-weight: 500;
    color: #2C224F;
}

/* ÉTAPE 2: Sélection du spectacle */
.events-list {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.event-item {
    display: flex;
    flex-direction: column;
    background: var(--color-gold-a);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 4px solid var(--color-light);
}

.event-item:hover .event-description {
    max-height: 20em;
    transform: translateY(-2px);
}

.event-item:hover .event-description::before {
    opacity: 0;
}

@media (min-width: 600px) {

    .calendar-weekdays {
        gap: 10px;
    }

    .weekday {
        padding: 10px;
    }
}


@media (max-width: 1023px) {
    .event-item.mobile-active .event-description {
        max-height: 40em;
        transform: translateY(-2px);
    }

    .event-item.mobile-active .event-description::before {
        opacity: 0;
    }
}

.event-item.sold_out {
    border-left-color: #dc3545;
    cursor: not-allowed;
    opacity: 0.7;
}

.event-info {
    padding: 40px 25px;
    position: relative;
    flex: 1;
    padding: 25px;
}

.event-title {
    margin: 0 0 10px 0;
    color: var(--color-main);
    font-size: 16px;
    font-weight: 700;
}

.event-date {
    margin: 0 0 15px 0;
    color: var(--color-gold);
    font-size: 16px;
    font-weight: 600;
}

.event-description {
    font-size: 14px;
    color: var(--color-main);
    margin-bottom: 15px;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
    max-height: 4.5em;
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: max-height, transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.event-description::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent 3em, var(--color-gold-a) 4.5em);
    pointer-events: none;
    transition: opacity 0.8s ease;
    z-index: 1;
}

.event-availability {
    position: absolute;
    top: 10px;
    right: 25px;
}

.availability-badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px
}

.availability-badge.available {
    background: var(--color-gold);
    color: var(--color-light);
}

.availability-badge.sold_out {
    background: #f8d7da;
    color: #dc3545;
}

.event-actions {
    display: flex;
    align-items: center;
    padding: 25px;
}

/* ÉTAPE 3: Sélection des billets */
.selected-event-info {
    background: var(--color-gold-a);
    padding: 25px;
    margin-bottom: 30px;
}

.selected-event-title {
    margin: 0 0 10px 0;
    color: var(--color-main);
    font-size: 20px;
    font-weight: 700;
}

.selected-event-date {
    margin: 0 0 15px 0;
    color: var(--color-gold);
    font-size: 16px;
    font-weight: 600;
}

.selected-event-description {
    margin: 0;
    color: var(--color-main);
    font-size: 14px;
    line-height: 1.5;
}

.ticket-types-container {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.ticket-type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-light);
    padding: 25px 25px 35px;
    border: 2px solid var(--color-gold);
    transition: box-shadow 0.2s ease;
    position: relative;
}

.ticket-type-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.ticket-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    line-height: 1;
}

.ticket-info h4 {
    margin: 0 0 8px 0;
    color: var(--color-main);
    font-size: 16px;
}

.ticket-price {
    font-weight: 700;
    color: var(--color-gold);
    margin-bottom: 5px;
    margin-bottom: 5px;
    min-width: 60px;
}

.ticket-availability {
    color: #666;
    font-size: 13px;
    margin: 0;
    position: absolute;
    bottom: 10px;
}

.ticket-quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ticket-quantity-selector label {
    font-weight: 600;
    color: var(--color-main);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--color-light);
}

.quantity-btn {
    background: var(--color-gold);
    color: var(--color-light);
    border: none;
    padding: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 30px;
    border-radius: 50%;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: var(--color-main);
}

.quantity-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ticket-quantity {
    border: 1px solid #ddd;
    font-size: 16px;
    min-width: 40px;
    height: 30px;
    background: var(--color-light);
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

.ticket-quantity::-webkit-outer-spin-button,
.ticket-quantity::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ticket-quantity:focus {
    outline: none;
    border-color: #007cba;
}

.sold-out {
    color: #dc3545;
    font-weight: 600;
    background: #f8d7da;
}

/* Résumé du panier */
.cart-summary {
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid var(--color-gold);
}

.cart-summary h4 {
    margin: 0 0 20px 0;
    color: var(--color-main);
    font-size: 20px;
    text-align: center;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #dee2e6;
}

.cart-item span {
    font-size: 14px;
    color: var(--color-main);
}

.cart-item:last-child {
    border-bottom: none;
}

.item-title {
    flex: 1;
    font-weight: 500;
    width: 70%;
}

.item-quantity {
    color: #666;
    width: 10%;
    text-align: center;
}

.item-price {
    font-weight: 600;
    color: var(--color-gold);
    width: 20%;
    text-align: right;
}

.empty-cart {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 0;
}

.total-price {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #dee2e6;
    font-size: 24px;
    font-weight: 700;
    color: var(--color-main);
}

.price-amount {
    color: var(--color-gold);
}

/* Actions des étapes */
.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

/* Boutons */
.btn {
    padding: 12px 24px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--color-main);

    color: var(--color-light);
}

.btn-primary:hover {
    background: var(--color-gold);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-back {
    background: var(--color-main);
    color: var(--color-light);
}

.btn-back:hover {
    background: var(--color-gold);
}

.btn-select-event {
    background: var(--color-main);
    color: var(--color-light);
}

.btn-select-event:hover {
    background: var(--color-gold);
}

.btn-disabled {
    background: #dc3545;
    color: var(--color-light);
    cursor: not-allowed;
}

.btn-reserver-tunnel {
    background: #007cba;
    color: var(--color-light);
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-reserver-tunnel:hover {
    background: #005a8b;
    color: var(--color-light);
}

/* Messages */
.tunnel-messages {
    position: absolute;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    margin-bottom: 36px;
}

.message {
    padding: 15px 20px;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.message-error {
    background: #f8d7da;
    color: #dc3545;
    border: 1px solid #f5c6cb;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Loading spinner */
.tunnel-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--color-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.tunnel-loading p {
    color: var(--color-main);
    font-size: 18px;
    font-weight: 500;
}

/* Messages d'état */
.no-events,
.no-tickets {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px;
    background: #f8f9fa;
}

.tunnel-step-3 {
    position: relative;
}

.price-currency {
    color: var(--color-gold);
}

/* Image de l'événement sélectionné */
.selected-event-image {
    margin: 20px 0;
    text-align: center;
}

.event-featured-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    object-fit: cover;
    width: 100%;
}


/* Responsive Design */
@media (max-width: 599px) {
    .event-availability {
        display: none;
    }
}

@media (max-width: 767px) {
    .tunnel-reservation-container {
        padding: 15px;
    }

    .tunnel-steps {
        flex-direction: column;
        gap: 10px;
    }

    .step {
        margin: 0;
    }

    .step::after {
        display: none;
    }

    .calendar-container {
        margin: auto;
    }

    .calendar-header {
        padding: 15px;
    }

    .calendar-month-year {
        font-size: 18px;
    }

    .calendar-grid {
        padding: 15px;
    }

    .calendar-legend {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .event-item {
        flex-direction: column;
    }

    .event-actions {
        border-top: 1px solid #dee2e6;
        padding: 20px 25px;
    }

    .ticket-type-item {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .step-actions {
        flex-direction: column;
        gap: 15px;
    }

    .step-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .tunnel-messages {
        position: static;
        margin: 20px 0;
    }
}