/* ============================================
   CSS pour recherche_sejour.html - Page recherche séjour
   IMPORTANT : Les variables CSS sont dans variables.css
   Ce fichier doit être chargé APRÈS variables.css
   ============================================ */

/* Reset du main */
main {
    padding: 0 !important;
    margin: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: none !important;
}

/* Hero Section */
.hero-sejour {
    position: relative;
    padding: 2.5rem 2rem 2rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.hero-sejour::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,165.3C384,171,480,149,576,128C672,107,768,85,864,90.7C960,96,1056,128,1152,133.3C1248,139,1344,117,1392,106.7L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    z-index: 0;
}

.hero-sejour-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    color: white;
}

.hero-sejour-title {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-sejour-subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    margin-bottom: 1rem;
}

/* Features dans le Hero */
.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding: 0 1rem;
}

.hero-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: white;
    transition: transform 0.3s ease;
}

.hero-feature-item:hover {
    transform: translateY(-5px);
}

.hero-feature-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-feature-text {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.95;
    text-align: center;
    max-width: 120px;
    line-height: 1.3;
}

/* Container principal */
.sejour-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 1rem;
    background: #f5f5f5;
    min-height: calc(100vh - 350px);
}

/* Wrapper pour les étapes initiales (plus étroit) */
#initial-prompt,
#steps-container {
    padding: 0 1rem;
}

/* Results container sort du conteneur pour prendre toute la largeur */
#results-container {
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    max-width: 100vw;
    padding: 3rem 2rem;
    background: #f5f5f5;
}

/* Wrapper interne pour limiter la largeur du contenu */
#results-container .step-results {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Initial Prompt Card */
.initial-card {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.initial-card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 2rem;
}

.initial-card .features-list {
    text-align: left;
    margin: 2rem auto;
    max-width: 600px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.feature-item:hover {
    border-color: #667eea;
    transform: translateX(10px);
}

.feature-item i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.feature-item span {
    color: #555;
    font-size: 1.1rem;
}

/* Steps Container */
.steps-wrapper {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.steps-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.steps-title i {
    color: #667eea;
}

/* Buttons */
.btn-sejour-primary {
    background: white !important;
    border: 2px solid #667eea !important;
    color: #667eea !important;
    padding: 1rem 2.5rem !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2) !important;
    transition: all 0.3s !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.btn-sejour-primary:hover {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
}

.btn-sejour-success {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border: none !important;
    color: white !important;
    padding: 1rem 2.5rem !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
    transition: all 0.3s !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.btn-sejour-success:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5) !important;
}

.btn-sejour-danger {
    background: white !important;
    border: 2px solid #6c757d !important;
    color: #6c757d !important;
    padding: 1rem 2.5rem !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    transition: all 0.3s !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.btn-sejour-danger:hover {
    background: #6c757d !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3) !important;
}

/* Actions Container */
.actions-container {
    text-align: center;
    margin-top: 2rem;
}

.actions-container .d-flex {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Results Container */
.results-wrapper {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.results-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.results-title i {
    color: #667eea;
}

.result-step-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.result-step-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.15);
}

.result-step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.result-step-header i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.result-step-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.result-step-body pre {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
    font-size: 0.9rem;
    color: #555;
}

body.recherche-sejour {
    text-align: left;
}

main.recherche-sejour {
    width: 90%;
    max-width: 1400px;
    margin: var(--spacing-lg) auto;
}

body {
    background-color: var(--bg-body-alt);
}

.recherche-sejour .cards-container {
    width: 100%;
    max-width: 100%;
}

.step-wrapper {
    border: var(--border-width) solid var(--border-color-dark);
    border-radius: var(--radius-card); /* Harmonized with Bootstrap's default .rounded */
    margin-bottom: 1.5rem;
    background-color: var(--bg-card);
    box-shadow: var(--shadow-research);
    width: 100%; /* Ensure it takes full width of its parent */
}

.step-header {
    background-color: var(--bg-form-header);
    padding: 0.75rem 1.25rem;
    border-bottom: var(--border-width) solid var(--border-color-dark);
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    flex-grow: 1;
}

.toggle-step-icon {
    transition: transform var(--transition-slow);
}

/* When the collapse target is shown, the icon is normal */
[aria-expanded="true"] .toggle-step-icon {
    transform: rotate(0deg);
}

/* When the collapse target is hidden, rotate the icon */
[aria-expanded="false"] .toggle-step-icon {
    transform: rotate(-90deg);
}

.step-header-actions .delete-step-btn {
    cursor: pointer;
    color: var(--text-light);
    transition: color var(--transition-base);
}

.step-header-actions .delete-step-btn:hover {
    color: var(--color-danger);
}

.step-header h2 {
    margin-bottom: 0;
    font-size: 1.5rem;
}

.step-content {
    padding: 1.5rem;
}

.recherche-sejour .fieldset-regions,
.recherche-sejour .form-check,
.recherche-sejour fieldset h5 {
    text-align: left;
}

/* Fieldset styling */
.recherche-sejour fieldset {
    border: var(--border-width) solid var(--border-color-form) !important;
    border-radius: var(--radius-button);
    padding: 1rem;
    margin-bottom: 1rem;
}

.recherche-sejour legend {
    float: none;
    width: auto;
    padding: 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 500;
}

/* Department list */
.department-list {
    padding-left: 2rem;
    max-height: 200px;
    overflow-y: auto;
    border-left: 2px solid #eee;
    margin-top: 0.5rem;
}

.region-item .form-check {
    display: inline-block;
}

.toggle-departments {
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    padding: 0 8px;
    display: inline-block;
    transition: transform var(--transition-base);
    user-select: none; /* Prevent text selection */
}

.toggle-departments.collapsed {
    transform: rotate(0deg);
}

.toggle-departments:not(.collapsed) {
    transform: rotate(90deg);
}

/* Equipment list */
.equipment-list {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

/* Activity accordion */
.accordion-button:not(.collapsed) {
    color: var(--color-accordion-expanded);
    background-color: var(--color-accordion-bg);
}

/* Results Container */
#results-container {
    border: var(--border-width) solid var(--border-color-dark);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    background-color: var(--bg-card);
    box-shadow: var(--shadow-research);
}

#results-container .card {
    border-color: var(--border-color-card);
}

#results-container .card-header {
    background-color: var(--bg-body-alt);
    font-weight: bold;
}

#results-container .card-body pre {
    background-color: var(--bg-form-header);
    padding: 1rem;
    border-radius: var(--radius-card);
    white-space: pre-wrap;       /* Since CSS 2.1 */
    white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
    white-space: -pre-wrap;      /* Opera 4-6 */
    white-space: -o-pre-wrap;    /* Opera 7 */
    word-wrap: break-word;       /* Internet Explorer 5.5+ */
}

/* Modal départements - Limitation de la hauteur */
#modal-departements .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

/* Modal départements - Réduction de l'écart entre les lignes */
#modal-departements .form-check {
    margin-bottom: 0;
    padding: 0.15rem 0;
    display: flex;
    align-items: flex-start;
    min-width: 0;
}

/* Fond de couleur léger pour les départements */
#modal-departements .row .form-check {
    background-color: #f8f9ff;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    transition: background-color 0.2s ease;
}

#modal-departements .row .form-check:hover {
    background-color: #e8ecff;
}

#modal-departements .form-check-input {
    flex-shrink: 0;
    margin-top: 0.2rem;
}

#modal-departements .form-check-label {
    padding-left: 0.4rem;
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: break-word;
    flex: 1;
    min-width: 0;
}

/* Case à cocher pour sélectionner toute la région */
#modal-departements .region-select-all {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

#modal-departements .region-select-all:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Alignement des cases à cocher des départements avec la région */
#modal-departements .row {
    padding-left: 0.5rem;
}

#modal-departements .row .form-check {
    padding-left: 0;
}

#modal-departements .row .form-check-input {
    margin-left: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-sejour {
        padding: 2rem 1rem 1.5rem 1rem;
    }

    .hero-sejour-title {
        font-size: 2rem;
    }

    .hero-sejour-subtitle {
        font-size: 1.1rem;
    }

    .hero-features {
        gap: 1rem;
    }

    .hero-feature-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .hero-feature-text {
        font-size: 0.8rem;
        max-width: 100px;
    }

    .sejour-container {
        padding: 2rem 1rem;
    }

    .initial-card {
        padding: 2rem 1.5rem;
    }

    .feature-item {
        padding: 0.75rem;
    }

    .actions-container .d-flex {
        flex-direction: column;
    }

    .btn-sejour-primary,
    .btn-sejour-success,
    .btn-sejour-danger {
        width: 100%;
        justify-content: center;
    }

    /* Ajustement des résultats sur mobile */
    #results-container .step-results {
        padding: 0 1rem;
    }
}

/* ============================================
   ZONE 1 : SÉLECTION DIRECTE
   ============================================ */

.direct-selection-zone {
    border-bottom: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #fff5e6 0%, #fff9f0 100%);
    padding: 0.75rem 1rem;
}

.direct-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.direct-selection-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #667eea;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.direct-selection-count {
    background: #667eea;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 10px;
}

/* Grille des items directs - ultra compacte */
.direct-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.3rem;
}

/* Item direct - version ultra compacte identique à Zone 2 */
.direct-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.4rem;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0;
}

.direct-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.direct-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #e8ecff 0%, #f0f4ff 100%);
}

.direct-item-checkbox {
    flex-shrink: 0;
    width: 0.85rem;
    height: 0.85rem;
    cursor: pointer;
    margin: 0;
}

.direct-item-label {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
    user-select: none;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.direct-item.selected .direct-item-label {
    color: #667eea;
    font-weight: 600;
}

/* Responsive pour Zone 1 */
@media (max-width: 768px) {
    .direct-items-grid {
        grid-template-columns: 1fr;
    }
}
