/* Styles pour la page de choix de contexte (index.html) */
.platform-choice-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem 2rem 1rem;
}
.platform-choice-intro {
    text-align: center;
    margin-bottom: 1rem;
}
.platform-choice-tabs {
    display: flex;
    justify-content: space-between;
    gap: 0.15rem;
    margin-bottom: 1rem;
    margin-top: 0;
    flex-wrap: wrap;
    width: 100%;
    position: relative;
    top: 0;
}
.platform-choice-tab {
    appearance: none;
    border: 2px solid #d0d0d0;
    background: #f5f5f5;
    color: #333;
    border-radius: 8px 8px 0 0;
    padding: 0.6rem 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    position: relative;
    flex: 1;
    min-width: 0;
}
.platform-choice-tab:hover {
    background: #e8e8e8;
    border-color: #b0b0b0;
}
.platform-choice-tab[aria-selected="true"] {
    background: #fff;
    color: #007bff;
    border-color: #007bff;
    border-bottom-color: #fff;
    font-weight: 700;
}
.platform-choice-tab[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Sous-onglets pour "Je covoiture" */
.participate-sub-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.participate-sub-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: #666;
    padding: 0.6rem 1rem;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.18s ease;
    border-bottom: 3px solid transparent;
    position: relative;
    bottom: -2px;
    margin-bottom: 0;
}

.participate-sub-tab:hover {
    color: #333;
    background: #f0f0f0;
    border-radius: 4px 4px 0 0;
}

.participate-sub-tab[aria-selected="true"] {
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: 600;
}

.participate-content {
    display: block;
}

.participate-content[hidden] {
    display: none;
}
.platform-choice-panel[hidden] {
    display: none !important;
}

/* Tab navigation links */
.tab-link {
    color: #d32f2f;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 700;
}

.tab-link:hover {
    color: #b71c1c;
}

.platform-choice-intro h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.platform-choice-intro h2 {
    font-size: 1.5rem;
    margin: 0.5rem 0;
}
.platform-choice-intro p {
    color: #555;
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
}

.platform-choice-intro .intro-primary {
    text-align: center;
}

.platform-choice-intro .choice-footnote {
    margin-top: 0.6rem;
    font-size: 0.84rem;
    color: #6b7280;
    max-width: 760px;
}
.platform-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.created-platforms-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: #e5f2ee;
    font-size: 0.82rem;
}
.created-platforms-note,
.created-platforms-empty {
    color: #59645f;
    font-size: 0.9rem;
}
.created-platforms-feedback {
    min-height: 1.4em;
    color: #176455;
    font-size: 0.9rem;
}
.created-platform-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0.5rem 0 1rem;
}
.created-platform-tool-group {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}
.created-platform-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid #bdcec9;
    border-radius: 5px;
    background: #fff;
    color: #174a42;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.created-platform-tool:hover {
    background: #edf5f2;
    border-color: #176455;
}
.created-platform-tool:disabled {
    border-color: #d5ddda;
    background: #f1f4f3;
    color: #7b8582;
    cursor: not-allowed;
    opacity: 0.62;
}
.created-platform-tool:disabled:hover {
    border-color: #d5ddda;
    background: #f1f4f3;
}
.created-platform-tool:focus-visible {
    outline: 2px solid #176455;
    outline-offset: 2px;
}
.created-publication-modal .created-publication-modal-content {
    display: flex;
    flex-direction: column;
    width: min(92vw, 680px);
    max-width: 680px;
    max-height: 88dvh;
}
.created-publication-modal .created-publication-modal-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.created-publication-modal .modal-header h2 {
    margin: 0;
    color: #18332f;
    font-size: 1.2rem;
}
.created-publication-warning {
    max-width: 760px;
    color: #6b4b22;
    font-size: 0.9rem;
    line-height: 1.45;
}
#created-publication-form label,
.created-publication-result label {
    display: block;
    margin: 0.9rem 0 0.35rem;
    color: #334541;
    font-size: 0.9rem;
    font-weight: 650;
}
#created-publication-title,
#created-publication-description,
#created-publication-url,
#created-publication-iframe {
    box-sizing: border-box;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #bdcec9;
    border-radius: 5px;
    background: #fff;
    color: #18332f;
    font: inherit;
}
#created-publication-description,
#created-publication-iframe {
    resize: vertical;
}
.created-publication-copy-row {
    display: flex;
    gap: 0.5rem;
}
.created-publication-copy-row input {
    min-width: 0;
    flex: 1;
}
.created-publication-result-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.85rem;
}
.created-publication-revoke {
    border: 0;
    background: transparent;
    color: #8b3c36;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}
.created-publication-revoke:focus-visible,
#created-publication-form :focus-visible,
.created-publication-result :focus-visible {
    outline: 2px solid #176455;
    outline-offset: 2px;
}
.created-platforms-feedback--error {
    color: #a32d28;
}
.created-platform-info {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #536b65;
    cursor: pointer;
    font-size: 1rem;
}
.created-platform-info:hover {
    background: #edf5f2;
    color: #174a42;
}
.created-platform-info:focus-visible {
    outline: 2px solid #176455;
    outline-offset: 1px;
}
#created-platform-info-modal .created-platform-info-content {
    width: min(92vw, 480px);
    max-width: 480px;
}
#created-platform-info-body p {
    line-height: 1.5;
}
#created-platform-info-body p + p {
    margin-top: 0.9rem;
}
.created-platforms-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: grid;
    gap: 0.6rem;
}
.created-platform-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border: 1px solid #d9e2df;
    border-radius: 6px;
    background: #fff;
}
.created-platform-details,
.created-platform-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.created-platform-main {
    flex: 1;
    min-width: 0;
}
.created-platform-details {
    flex-wrap: wrap;
}
.created-platform-details span {
    color: #59645f;
    font-size: 0.85rem;
}
.created-platform-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
    margin-top: 0.45rem;
}
.created-platform-stats > span {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
}
.created-platform-stat-label {
    color: #59645f;
    font-size: 0.82rem;
}
.created-platform-stats strong {
    color: #263a35;
    font-variant-numeric: tabular-nums;
}
.created-platform-actions a {
    color: #176455;
    font-weight: 600;
    white-space: nowrap;
}
.created-platform-share {
    border: 0;
    background: transparent;
    color: #176455;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    padding: 0;
    white-space: nowrap;
}
.created-platform-share:hover,
.created-platform-actions a:hover {
    text-decoration: underline;
}
.created-platform-share:focus-visible,
.created-platform-forget:focus-visible {
    outline: 2px solid #176455;
    outline-offset: 2px;
}
.created-platform-forget {
    border: 0;
    background: transparent;
    color: #8b3c36;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.35rem;
}
.created-platforms-loading {
    color: #59645f;
    padding: 0.5rem 0;
}
.platform-choice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.1rem 1.25rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.platform-choice-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #007bff;
}
.platform-choice-card .pc-icon {
    font-size: 2.2rem;
    margin-bottom: 0.4rem;
    line-height: 1;
    color: #007bff;
}
.platform-choice-card.school .pc-icon  { color: #2e7d32; }
.platform-choice-card.event  .pc-icon  { color: #c62828; }
.platform-choice-card.pro    .pc-icon  { color: #1565c0; }
.platform-choice-card h2 {
    font-size: 1.25rem;
    margin: 0 0 0.35rem 0;
}
.platform-choice-card p {
    color: #666;
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    line-height: 1.35;
}
.platform-choice-card .pc-cta {
    margin-top: auto;
    background: #007bff;
    color: #fff;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}
.platform-choice-card.school .pc-cta { background: #2e7d32; }
.platform-choice-card.event  .pc-cta { background: #c62828; }
.platform-choice-card.pro    .pc-cta { background: #1565c0; }

/* Variante bouton autonome (hors card) */
button.pc-cta {
    border: none;
    background: #007bff;
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}
button.pc-cta:hover { filter: brightness(1.08); }

.platform-choice-info {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f0f7ff;
    border-left: 4px solid #0b57d0;
    border-radius: 6px;
    color: #1f2937;
    font-size: 0.95rem;
}

.platform-choice-info .info-primary {
    margin: 0 0 0.5rem 0;
    font-weight: 500;
    color: #0b57d0;
}

.platform-choice-info p {
    margin: 0;
    line-height: 1.5;
}

.platform-choice-footer {
    text-align: center;
    margin-top: 2.5rem;
    color: #777;
    font-size: 0.9rem;
}
.platform-choice-footer a { color: #007bff; }

.available-platforms-actions {
    margin: 0.45rem 0 0.2rem;
}

.choice-use-my-location-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.choice-use-my-location-link:hover {
    color: #0f172a;
    text-decoration: underline;
}

.choice-use-my-location-link[aria-busy="true"] {
    opacity: 0.6;
    pointer-events: none;
}
.choice-available-map {
    width: 100%;
    min-height: 400px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    background: #f8fafc;
}
.status-dot {
    font-size: 1.5rem;
    line-height: 1;
}
.status-dot--private { color: #c0392b; }
.status-dot--public  { color: #2980b9; }

.popup-participants {
    font-size: 0.85em;
    color: #555;
}

.choice-platform-popup-entry + .choice-platform-popup-entry {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #d1d5db;
}

#choice-platforms-modal {
    z-index: 11000;
}

#choice-platforms-modal .choice-platforms-modal-content {
    display: flex;
    flex-direction: column;
    width: 92vw;
    max-width: 640px;
    min-width: 0;
    max-height: 82dvh;
}

#choice-platforms-modal .choice-platforms-modal-body {
    flex: 1;
    min-height: 0;
    max-height: none;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#choice-platforms-modal .choice-platform-popup-entry + .choice-platform-popup-entry {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

@media (max-width: 767px) {
    #choice-platforms-modal .choice-platforms-modal-content {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        max-height: 100dvh;
        height: 100dvh;
        border-radius: 0;
    }

    #choice-platforms-modal .choice-platforms-modal-body {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

.choice-available-status {
    margin: 0.8rem 0 0.5rem;
    color: #4b5563;
}

.choice-destination-search-block {
    margin: -0.4rem 0 1rem;
}

.choice-destination-search-block h4 {
    margin: 0 0 0.45rem;
    color: #374151;
    font-size: 0.95rem;
}

.choice-search-container {
    position: relative;
    z-index: 1200;
}

.choice-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    z-index: 2;
}

#choice-destination-search {
    padding-left: 2.2rem;
}

.choice-destination-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    z-index: 1300;
    max-height: 220px;
    overflow-y: auto;
}

.choice-available-map {
    position: relative;
    z-index: 1;
}

.choice-destination-suggestion {
    border: 0;
    width: 100%;
    text-align: left;
    background: #fff;
    padding: 0.55rem 0.7rem;
    cursor: pointer;
    border-bottom: 1px solid #edf2f7;
    color: #1f2937;
    font-size: 0.9rem;
}

.choice-destination-suggestion:last-child {
    border-bottom: 0;
}

.choice-destination-suggestion:hover {
    background: #f3f8ff;
}

@media (max-width: 640px) {
    .platform-choice-panel[data-choice-tab-panel="organize"] .platform-choice-intro h2 {
        font-size: 1.2rem;
    }
    .platform-choice-tab {
        font-size: 0.88rem;
        padding: 0.3rem 0.35rem;
    }
    .platform-choice-tabs {
        gap: 0.1rem;
    }
    .platform-choice-grid {
        gap: 0.8rem;
    }
    .platform-choice-card {
        padding: 0.5rem 0.5rem 0.65rem;
    }
    .platform-choice-card .pc-icon {
        font-size: 1.6rem;
    }
    .choice-available-map {
        min-height: 320px;
    }
}

@media (max-width: 640px) and (orientation: portrait) {
    .platform-choice-info {
        margin-top: 0.75rem;
    }
}

@media (max-width: 900px) and (max-height: 600px) and (orientation: landscape) {
    .platform-choice-card {
        padding: 0.5rem 0.5rem 0.65rem;
    }
    .platform-choice-card .pc-icon {
        font-size: 1.6rem;
    }
}

/* ------------------------------------------------------------
 * Modale "Comment ça marche" simplifiée
 * Réutilise .modal / .modal-content / .modal-header... de style.css
 * ------------------------------------------------------------ */
#help-modal .modal-content {
    max-width: 640px;
    width: 95%;
}
#help-modal .help-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    counter-reset: helpstep;
}
#help-modal .help-steps li {
    counter-increment: helpstep;
    position: relative;
    padding: 0.6rem 0 0.6rem 2.6rem;
    line-height: 1.45;
}
#help-modal .help-steps li::before {
    content: counter(helpstep);
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: #007bff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}
#help-modal .help-platforms {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin: 0 0 1rem 0;
}
#help-modal .help-platforms div {
    text-align: center;
    padding: 0.6rem 0.4rem;
    border-radius: 8px;
    background: #f5f5f5;
    font-size: 0.85rem;
}
#help-modal .help-platforms .hp-school { border-top: 4px solid #2e7d32; }
#help-modal .help-platforms .hp-event  { border-top: 4px solid #c62828; }
#help-modal .help-platforms .hp-pro    { border-top: 4px solid #1565c0; }
#help-modal .help-platforms strong { display: block; margin-bottom: 0.2rem; }
#help-modal .help-tip {
    background: #fff8e1;
    border-left: 4px solid #f9a825;
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-top: 1rem;
}

@media (max-width: 480px) {
    .platform-choice-tab {
        font-size: 0.8rem;
        padding: 0.25rem 0.3rem;
    }
    .platform-choice-tabs {
        gap: 0.08rem;
    }
    .platform-choice-grid {
        gap: 0.6rem;
    }
    .platform-choice-card {
        padding: 0.4rem 0.4rem 0.55rem;
    }
    .platform-choice-card .pc-icon {
        font-size: 1.4rem;
    }
    .created-platform-item,
    .created-platform-actions {
        align-items: flex-start;
    }
    .created-platform-item {
        flex-direction: column;
    }
    .created-platform-actions {
        flex-wrap: wrap;
    }
    #help-modal .help-platforms { grid-template-columns: 1fr; }
}

/* Styles pour les espaces personnels sur la page de choix */
.my-spaces-list-container {
    margin: 1.5rem 0;
}

.my-spaces-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.my-space-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    transition: all 0.15s ease;
}

.my-space-item:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.12);
}

.my-space-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    min-width: 0;
}

.my-space-link:hover {
    text-decoration: underline;
}

.my-space-link i {
    flex-shrink: 0;
    font-size: 1rem;
}

.my-space-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-space-pseudo {
    display: block;
    font-size: 0.8rem;
    color: #999;
    font-weight: normal;
}

.my-space-forget {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #9ca3af;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.my-space-forget:hover {
    border-color: #ef4444;
    background: #fef2f2;
    color: #ef4444;
}

.my-spaces-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #9ca3af;
}

.my-spaces-empty p {
    margin: 0;
}

.my-spaces-empty .my-spaces-empty-list,
.my-spaces-empty .my-spaces-empty-actions-list {
    text-align: left !important;
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.my-spaces-empty .my-spaces-empty-instructions {
    margin-top: 1rem;
}

.my-spaces-empty .my-spaces-empty-list li,
.my-spaces-empty .my-spaces-empty-actions-list li {
    text-align: left !important;
}

/* Hide intro description when no spaces */
.my-spaces-empty-state .intro-description {
    display: none;
}

/* Align left content in empty state */
.my-spaces-empty-state .my-spaces-empty {
    text-align: center;
    padding-top: 0.5rem;
}

.my-spaces-empty-state .my-spaces-empty > p:first-of-type {
    text-align: center;
    font-weight: bold;
    margin-bottom: 1rem;
}

.my-spaces-empty-state .my-spaces-empty > p:not(:first-of-type) {
    text-align: center;
    margin-top: 1rem;
}

.my-spaces-empty-state .my-spaces-empty-list li,
.my-spaces-empty-state .my-spaces-empty-actions-list li {
    text-align: left !important;
}

.my-spaces-empty-state .my-spaces-empty-list,
.my-spaces-empty-state .my-spaces-empty-actions-list {
    text-align: left !important;
}

.my-spaces-empty-state .my-spaces-empty-list.text-muted,
.my-spaces-empty-state .my-spaces-empty-actions-list.text-muted {
    text-align: left !important;
}

.my-spaces-empty-state .my-spaces-empty-list.text-muted li,
.my-spaces-empty-state .my-spaces-empty-actions-list.text-muted li {
    text-align: left !important;
}

