/* Marseille Tracker - Styles des modales */

/* Page d'accueil / Popup d'introduction */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.95) 0%, rgba(0, 0, 0, 0.98) 100%);
    backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.welcome-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.welcome-modal {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(148, 163, 184, 0.2);
    position: relative;
    animation: slideInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.1);
    /* Amélioration du scroll */
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.5) rgba(30, 41, 59, 0.5);
}

/* Styles de barre de défilement pour WebKit */
.welcome-modal::-webkit-scrollbar {
    width: 8px;
}

.welcome-modal::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
}

.welcome-modal::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.welcome-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

.welcome-header {
    background: radial-gradient(ellipse at top, rgba(59, 130, 246, 0.4) 0%, rgba(30, 64, 175, 0.6) 40%, rgba(15, 23, 42, 0.95) 100%);
    color: #f1f5f9;
    padding: 30px;
    border-radius: 24px 24px 0 0;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.welcome-header h1 {
    font-size: 36px;
    font-weight: 300;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.welcome-header .subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin: 0;
    color: #cbd5e1;
}

.welcome-content {
    padding: 40px 30px;
}

.welcome-description {
    font-size: 16px;
    line-height: 1.6;
    color: #cbd5e1;
    margin-bottom: 30px;
    text-align: center;
}

.welcome-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    background: radial-gradient(ellipse at top left, rgba(51, 65, 85, 0.6) 0%, rgba(30, 41, 59, 0.8) 100%);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.2), 0 4px 16px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.4);
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 15px;
    display: block;
}

.feature-title {
    font-size: 16px;
    font-weight: 600;
    color: #93c5fd;
    margin-bottom: 8px;
}

.feature-description {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.4;
}

.welcome-cta {
    text-align: center;
    padding-bottom: 40px;
}

.start-button {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 50%, #1e40af 100%);
    color: #f1f5f9;
    border: none;
    border-radius: 50px;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4), 0 4px 16px rgba(0, 0, 0, 0.2);
    position: relative;

    border: 1px solid rgba(59, 130, 246, 0.3);
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35), 0 5px 14px rgba(0, 0, 0, 0.25);
    border-color: rgba(147, 197, 253, 0.35);
}

.start-button:active {
    transform: translateY(-1px);
}

.start-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.18) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.start-button:hover::before {
    width: 220px;
    height: 220px;
}

.start-button span {
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Modales génériques */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.generic-modal {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    transform: translateY(50px);
    transition: transform 0.3s ease;
}

/* Responsive pour écrans de faible hauteur */
@media (max-height: 600px) {
    .welcome-modal {
        max-height: 95vh;
        margin: 2.5vh auto;
    }

    .welcome-content {
        max-height: none;
        overflow-y: auto;
    }

    .welcome-features {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }

    .feature-card {
        padding: 15px;
    }

    .welcome-description {
        margin-bottom: 20px;
    }
}

/* Page récapitulative finale */
.summary-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.95) 0%, rgba(0, 0, 0, 0.98) 100%);
    backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.summary-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.summary-modal {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(148, 163, 184, 0.2);
    position: relative;
    animation: slideInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.1);
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.5) rgba(30, 41, 59, 0.5);
}

.summary-modal::-webkit-scrollbar {
    width: 8px;
}

.summary-modal::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
}

.summary-modal::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
}

.summary-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

.summary-header {
    text-align: center;
    padding: 40px 40px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.summary-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 12px 0;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-header .subtitle {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin: 0;
    font-weight: 400;
}

.summary-highlight-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.summary-chip {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #e2e8f0;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.summary-content {
    padding: 30px 40px 40px;
}

.summary-intro {
    margin-bottom: 40px;
}

.summary-intro p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #e2e8f0;
    margin-bottom: 20px;
}

.summary-intro strong {
    color: #3b82f6;
    font-weight: 600;
}

.summary-domains h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0 0 30px 0;
    text-align: center;
}

.domains-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.domain-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.domain-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.4);
}

.domain-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    display: block;
}

.domain-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0 0 12px 0;
}

.domain-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #cbd5e1;
    margin: 0;
}

.summary-conclusion {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
}

.summary-conclusion p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #e2e8f0;
    margin: 0;
    font-style: italic;
}

.summary-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.explore-details-button {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #f8fafc;
    border: none;
    padding: 16px 30px;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 14px 32px rgba(34, 197, 94, 0.45), 0 8px 18px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.explore-details-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(34, 197, 94, 0.55), 0 10px 20px rgba(0, 0, 0, 0.28);
}

.explore-details-button span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.restart-button {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: none;
    padding: 12px 22px;
    font-weight: 600;
}

.restart-button:hover {
    background: rgba(148, 163, 184, 0.1);
    transform: translateY(-1px);
    box-shadow: none;
}

.close-summary-button:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.restart-button span,
.close-summary-button span {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive pour la page récapitulative */
@media (max-width: 768px) {
    .summary-modal {
        max-width: 95%;
        margin: 10px;
        max-height: 95vh;
    }

    .summary-header {
        padding: 30px 20px 15px;
    }

    .summary-header h1 {
        font-size: 2rem;
    }

    .summary-content {
        padding: 20px;
    }

    .domains-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .domain-card {
        padding: 20px;
    }

    .summary-cta {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 15px;
    }

    .restart-button,
    .close-summary-button,
    .explore-details-button {
        width: 100%;
        max-width: 280px;
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* Styles pour le panneau d'instructions */
.guided-instructions {
    opacity: 1;
    transition: opacity 0.5s ease-in-out, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: translateY(0);
}

.guided-instructions.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    display: block !important;
    /* On surcharge le display: none pour permettre la transition */
    position: absolute;
    /* Pour éviter que ça prenne de la place quand caché/transition */
    z-index: -1;
}

.guided-instruction-intro {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 24px;
    line-height: 1.5;
}

.guided-instruction-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.instruction-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
}

.step-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-content strong {
    display: block;
    color: white;
    margin-bottom: 4px;
    font-size: 1.05rem;
}

.step-content p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.4;
}