/* ===================================
   CityZen — Thème sombre violet/bleu
   Inspiré du logo CZ
   =================================== */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #22223a;
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --accent: #4a5af7;
    --accent-light: #7c3aed;
    --accent-glow: rgba(74, 90, 247, 0.3);
    --danger: #ff4757;
    --danger-glow: rgba(255, 71, 87, 0.3);
    --warning: #ffa502;
    --success: #2ed573;
    --border: rgba(255, 255, 255, 0.06);
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, sans-serif;
}

/* ========== THÈME LIGHT ========== */
[data-theme="light"] {
    --bg-primary: #f2f2f7;
    --bg-secondary: #ffffff;
    --bg-card: #f0f0f5;
    --bg-card-hover: #e5e5ea;
    --text-primary: #1c1c1e;
    --text-secondary: #6e6e73;
    --accent: #4a5af7;
    --accent-light: #7c3aed;
    --accent-glow: rgba(74, 90, 247, 0.2);
    --danger: #ff3b30;
    --danger-glow: rgba(255, 59, 48, 0.2);
    --warning: #ff9500;
    --success: #34c759;
    --border: rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* ========== HEADER ========== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 64px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.header-center {
    flex: 1;
    max-width: 480px;
    margin: 0 32px;
}

.search-wrapper {
    position: relative;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0 16px;
    height: 40px;
    transition: border-color 0.2s;
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
    font-size: 14px;
    margin-right: 8px;
    opacity: 0.5;
}

.search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

.search-clear {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.search-clear:hover {
    color: var(--text-primary);
}

/* Résultats de recherche */
.search-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    max-height: 320px;
    overflow-y: auto;
}

.search-results.active {
    display: block;
}

.search-results::-webkit-scrollbar {
    width: 4px;
}
.search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
}

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

.search-result-item:hover {
    background: var(--bg-card-hover);
}

.search-result-icon {
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.search-result-text {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-address {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-loading {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.search-no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Bouton toggle thème */
.btn-theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.btn-theme-toggle:hover {
    background: var(--bg-card-hover);
    transform: rotate(30deg);
}

.btn-notif {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
}

.btn-notif:hover {
    background: var(--bg-card-hover);
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-report {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 12px var(--danger-glow);
}

.btn-report:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--danger-glow);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}

/* ========== LAYOUT PRINCIPAL ========== */
.app-main {
    display: flex;
    height: calc(100vh - 64px);
    position: relative;
}

.map-container {
    flex: 1;
    height: 100%;
    z-index: 1;
}

.leaflet-container {
    background: var(--bg-primary) !important;
}

/* ========== PANEL ALERTES ========== */
.alert-panel {
    width: 400px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
}

/* ========== LIENS FOOTER PANEL ========== */
.panel-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.panel-footer-links a {
    font-size: 11px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.panel-footer-links a:hover {
    color: var(--accent);
}

.panel-footer-sep {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.4;
}

/* ========== BANDEAU SALUTATION ========== */
.greeting-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: #fff;
    animation: greetingSlideIn 0.5s ease-out;
}

@keyframes greetingSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.greeting-emoji {
    font-size: 28px;
    line-height: 1;
}

.greeting-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.greeting-message {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.greeting-name {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.85;
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 0;
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.tab {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ========== HEADER PANEL + BOUTON FILTRES ========== */

.panel-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.panel-header-top h2 {
    margin-bottom: 0;
}

.btn-advanced-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.btn-advanced-filter:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-advanced-filter.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-advanced-filter.has-filters {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-advanced-filter.has-filters.active {
    color: white;
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    padding: 0 4px;
}

/* ========== PANNEAU FILTRES AVANCÉS ========== */

.advanced-filters {
    display: none;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    margin-top: 14px;
    animation: filtersSlideIn 0.25s ease;
}

.advanced-filters.open {
    display: block;
}

@keyframes filtersSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.filter-section {
    margin-bottom: 14px;
}

.filter-section-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Chips de filtre */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-chip:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.filter-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Slider distance */
.filter-distance-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--bg-card);
    border-radius: 4px;
    outline: none;
    border: 1px solid var(--border);
}

.filter-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s;
}

.filter-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.filter-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.filter-distance-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    min-width: 55px;
    text-align: right;
}

/* Toggle switch filtres */
.filter-toggles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
}

.filter-toggle-row input[type="checkbox"] {
    display: none;
}

.filter-toggle-switch {
    width: 40px;
    height: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 22px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.25s;
}

.filter-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.25s;
}

.filter-toggle-row input:checked + .filter-toggle-switch {
    background: var(--accent);
    border-color: var(--accent);
}

.filter-toggle-row input:checked + .filter-toggle-switch .filter-toggle-slider {
    left: 20px;
    background: white;
}

/* Actions filtres */
.filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.btn-filter-reset {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter-reset:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.filter-result-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ========== CARTES D'ALERTES ========== */
.alert-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.alert-list::-webkit-scrollbar {
    width: 4px;
}

.alert-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.alert-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.alert-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.alert-card.urgent::before { background: var(--danger); }
.alert-card.info::before { background: var(--warning); }
.alert-card.resolved::before { background: var(--success); }

.alert-card:hover {
    background: var(--bg-card-hover);
    transform: translateX(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.alert-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.alert-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.badge {
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.urgent { background: rgba(255, 71, 87, 0.15); color: var(--danger); }
.badge.info { background: rgba(255, 165, 2, 0.15); color: var(--warning); }
.badge.resolved { background: rgba(46, 213, 115, 0.15); color: var(--success); }

.alert-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.alert-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

.alert-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.alert-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Photo dans les alertes */
.alert-photo {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.alert-reporter {
    font-size: 11px;
    color: var(--accent);
    margin-top: 4px;
    margin-bottom: 4px;
}

.alert-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.alert-watchers {
    font-size: 12px;
    color: var(--text-secondary);
}

.alert-actions {
    display: flex;
    gap: 8px;
}

.alert-actions button {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.alert-actions button:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.btn-delete {
    font-size: 13px;
}

.btn-delete:hover {
    border-color: var(--danger) !important;
    color: var(--danger) !important;
}

.btn-delete.confirm {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    color: white !important;
    font-size: 10px;
    font-weight: 700;
}

/* ========== MODAL ========== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
    resize: vertical;
}

.btn-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

/* ========== MODAL REPORT AMÉLIORÉE ========== */
.modal-report {
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-report::-webkit-scrollbar {
    width: 4px;
}
.modal-report::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Grille type d'incident */
.incident-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.type-btn:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.type-btn.selected {
    border-color: var(--accent);
    background: rgba(74, 90, 247, 0.1);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.type-icon {
    font-size: 24px;
    line-height: 1;
}

.type-label {
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font);
    text-align: center;
    line-height: 1.2;
}

/* Sélecteur de sévérité */
.severity-selector {
    display: flex;
    gap: 8px;
}

.severity-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.severity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.severity-btn.urgent .severity-dot { background: var(--danger); }
.severity-btn.info .severity-dot { background: var(--warning); }

.severity-btn.urgent.active {
    border-color: var(--danger);
    background: rgba(255, 71, 87, 0.1);
    color: var(--danger);
}

.severity-btn.info.active {
    border-color: var(--warning);
    background: rgba(255, 165, 2, 0.1);
    color: var(--warning);
}

/* Compteur de caractères */
.char-count {
    display: block;
    text-align: right;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Zone photo upload */
.photo-upload-zone {
    position: relative;
    cursor: pointer;
}

.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13px;
    transition: all 0.2s;
}

.photo-placeholder:hover {
    border-color: var(--accent);
    background: rgba(74, 90, 247, 0.05);
}

.photo-icon {
    font-size: 28px;
}

.photo-preview {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    max-height: 200px;
}

.photo-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius);
    display: block;
}

.photo-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.photo-remove:hover {
    background: var(--danger);
}

/* Section localisation */
.location-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-geoloc {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.3);
    border-radius: var(--radius-sm);
    color: #007AFF;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-geoloc:hover {
    background: rgba(0, 122, 255, 0.15);
    border-color: rgba(0, 122, 255, 0.5);
}

.btn-geoloc.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btn-geoloc.success {
    background: rgba(46, 213, 115, 0.1);
    border-color: rgba(46, 213, 115, 0.3);
    color: var(--success);
}

.geoloc-icon {
    font-size: 18px;
}

.location-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.location-hint.success {
    color: var(--success);
}

/* Mini carte */
.mini-map {
    height: 160px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* Bouton submit amélioré */
.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ========== MARQUEURS CARTE — STYLE iOS ========== */

/* Marqueur incident */
.ios-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ios-marker:hover {
    transform: scale(1.15);
}

.ios-marker-icon {
    font-size: 20px;
    line-height: 1;
}

.ios-marker.urgent {
    background: var(--danger);
    border-color: rgba(255, 71, 87, 0.4);
    animation: iosPulse 2.5s ease-in-out infinite;
}

.ios-marker.info {
    background: rgba(255, 165, 2, 0.9);
    border-color: rgba(255, 165, 2, 0.4);
}

.ios-marker.resolved {
    background: rgba(46, 213, 115, 0.8);
    border-color: rgba(46, 213, 115, 0.3);
    opacity: 0.7;
}

@keyframes searchPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 90, 247, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(74, 90, 247, 0); }
}

@keyframes iosPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4); }
    50% { box-shadow: 0 0 0 14px rgba(255, 71, 87, 0); }
}

/* Point bleu utilisateur (style Apple Maps) */
.ios-user-marker {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ios-user-dot {
    width: 14px;
    height: 14px;
    background: #007AFF;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 6px rgba(0, 122, 255, 0.5);
    position: relative;
    z-index: 2;
}

.ios-user-pulse {
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(0, 122, 255, 0.15);
    border-radius: 50%;
    animation: userPulse 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes userPulse {
    0%, 100% { transform: scale(0.5); opacity: 0.8; }
    50% { transform: scale(1); opacity: 0.2; }
}

/* Bouton localisation style iOS */
.ios-locate-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #007AFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    margin-bottom: 8px;
}

.ios-locate-btn:hover {
    background: var(--bg-card);
    transform: scale(1.05);
}

/* Popup style iOS */
.ios-popup-wrapper .leaflet-popup-content-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    padding: 0;
}

.ios-popup-wrapper .leaflet-popup-tip {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.ios-popup-wrapper .leaflet-popup-content {
    margin: 0;
    font-family: var(--font);
}

.ios-popup {
    padding: 14px 16px;
}

.ios-popup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ios-popup-header strong {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.ios-popup p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.ios-popup-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* === Popup mobile enrichi === */
.ios-popup-mobile .popup-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 6px;
    margin-left: auto;
    flex-shrink: 0;
}
.popup-badge.urgent {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}
.popup-badge.info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}
.popup-badge.resolved {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}
.popup-verified {
    display: inline-block;
    font-size: 10px;
    color: #10b981;
    font-weight: 600;
    margin-bottom: 4px;
}
.ios-popup-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 6px 0;
}
.popup-detail-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.popup-detail-btn:active {
    opacity: 0.85;
    -webkit-transform: scale(0.98);
    transform: scale(0.98);
}

/* ===================================
   RECHERCHE MOBILE (overlay dédié)
   =================================== */
.mobile-search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.mobile-search-overlay.active {
    display: block;
}

.mobile-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
}

.mobile-search-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.mobile-search-bar input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 15px;
    color: var(--text-primary);
    font-family: var(--font);
    outline: none;
}

.mobile-search-bar input:focus {
    border-color: var(--accent);
}

.mobile-search-bar input::placeholder {
    color: var(--text-secondary);
}

.mobile-search-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-search-close:active {
    background: var(--bg-card-hover);
}

.mobile-search-results {
    background: var(--bg-primary);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-search-results .search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
}

.mobile-search-results .search-result-item:active {
    background: var(--bg-card-hover);
}

.mobile-search-results .search-result-item .result-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.mobile-search-results .search-result-item .result-text {
    flex: 1;
    line-height: 1.3;
}

.mobile-search-results .search-result-item .result-text small {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 2px;
}

.mobile-search-results .search-loading,
.mobile-search-results .search-no-results {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Masquer contrôles Leaflet par défaut pour look iOS */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: none !important;
}

.leaflet-control-zoom a {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
    font-size: 18px !important;
    border-radius: 12px !important;
    margin-bottom: 4px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    transition: background 0.2s !important;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-card) !important;
}

/* ========== ALERT CARD — STATS ROW ========== */

.alert-stats-row {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    margin-bottom: 2px;
}

.alert-stat {
    font-size: 12px;
    color: var(--text-secondary);
}

.verified-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 2px 8px;
    border-radius: 50px;
}

.btn-detail {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s;
}

.btn-detail:hover {
    opacity: 0.7;
}

/* ========== MODAL DÉTAIL INCIDENT ========== */

.modal-detail {
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.modal-detail .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.detail-header-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.detail-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.detail-header-left h2 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.detail-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 24px;
}

.detail-body::-webkit-scrollbar {
    width: 4px;
}
.detail-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.detail-photo {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.detail-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.detail-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.detail-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.detail-info-icon {
    font-size: 14px;
    flex-shrink: 0;
}

/* ========== BOUTON CONFIRMER ========== */

.confirm-section {
    margin-bottom: 20px;
    text-align: center;
}

.btn-confirm {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-confirm:hover {
    border-color: var(--success);
    background: rgba(46, 213, 115, 0.08);
}

.btn-confirm.confirmed {
    border-color: var(--success);
    background: rgba(46, 213, 115, 0.12);
    color: var(--success);
}

.btn-confirm.confirmed .confirm-icon {
    animation: confirmPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes confirmPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.confirm-icon {
    font-size: 18px;
}

.confirm-count {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
}

.btn-confirm.confirmed .confirm-count {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.confirm-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== SECTION COMMENTAIRES ========== */

.comments-section {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.comments-section h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
}

.comment-list {
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.comment-list::-webkit-scrollbar {
    width: 3px;
}
.comment-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.comment-item {
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.comment-item.own {
    border-left: 3px solid var(--accent);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.comment-author {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
}

.comment-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.comment-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
}

.comments-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.comments-empty span {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}

.comments-empty p {
    font-size: 13px;
}

.comments-empty-hint {
    font-size: 12px !important;
    margin-top: 4px;
    opacity: 0.6;
}

.comments-loading {
    text-align: center;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Formulaire commentaire */
.comment-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.comment-form input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.comment-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.comment-form input::placeholder {
    color: var(--text-secondary);
}

.btn-send-comment {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.btn-send-comment:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-send-comment:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* ========== NOTIFICATION BANNER ==========*/

.notif-banner {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    width: 90%;
    max-width: 440px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    z-index: 5000;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.notif-banner.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

.notif-banner.hiding {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    pointer-events: none;
}

.notif-banner.urgent {
    border-left: 4px solid var(--danger);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 71, 87, 0.15);
}

.notif-banner.info {
    border-left: 4px solid var(--warning);
}

.notif-banner-icon {
    font-size: 28px;
    flex-shrink: 0;
    margin-top: 2px;
}

.notif-banner-content {
    flex: 1;
    min-width: 0;
}

.notif-banner-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-banner-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-banner-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-secondary);
}

.notif-banner-meta span:first-child {
    color: var(--accent);
    font-weight: 600;
}

.notif-banner-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}

.notif-banner-close:hover {
    color: var(--text-primary);
}

/* Animation entrée bannière urgente */
.notif-banner.urgent.visible {
    animation: notifShake 0.4s ease 0.3s;
}

@keyframes notifShake {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    20% { transform: translateX(calc(-50% + 4px)) translateY(0); }
    40% { transform: translateX(calc(-50% - 4px)) translateY(0); }
    60% { transform: translateX(calc(-50% + 2px)) translateY(0); }
    80% { transform: translateX(calc(-50% - 2px)) translateY(0); }
}

/* ============================================
   ONBOARDING / TUTORIEL
   ============================================ */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

.onboarding-overlay.active {
    opacity: 1;
    visibility: visible;
}

.onboarding-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 24px;
    width: 90%;
    max-width: 480px;
    padding: 32px;
    position: relative;
    animation: onboardingSlideUp 0.5s ease;
}

@keyframes onboardingSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Progress dots */
.onboarding-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.onboarding-dots {
    display: flex;
    gap: 8px;
}

.onboarding-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s;
    cursor: pointer;
}

.onboarding-dot.active {
    background: var(--accent);
    width: 28px;
    border-radius: 5px;
    box-shadow: 0 0 12px var(--accent-glow);
}

.onboarding-dot.done {
    background: var(--success);
}

.onboarding-skip {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    font-family: var(--font);
}

.onboarding-skip:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* Content area */
.onboarding-content {
    text-align: center;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.onboarding-illustration {
    font-size: 72px;
    margin-bottom: 20px;
    line-height: 1;
    animation: onboardingFloat 3s ease-in-out infinite;
}

@keyframes onboardingFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.onboarding-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.onboarding-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 380px;
    margin: 0 auto 24px;
}

.onboarding-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

.onboarding-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    text-align: left;
    border: 1px solid var(--border);
    opacity: 0;
    animation: onboardingFeatureIn 0.4s ease forwards;
}

.onboarding-feature:nth-child(1) { animation-delay: 0.1s; }
.onboarding-feature:nth-child(2) { animation-delay: 0.2s; }
.onboarding-feature:nth-child(3) { animation-delay: 0.3s; }
.onboarding-feature:nth-child(4) { animation-delay: 0.4s; }

@keyframes onboardingFeatureIn {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

.onboarding-feature-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 10px;
}

.onboarding-feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.onboarding-feature-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.onboarding-feature-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Highlight pulse */
.onboarding-highlight {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
    animation: onboardingPulse 2s ease-in-out infinite;
}

@keyframes onboardingPulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50% { box-shadow: 0 0 0 12px transparent; }
}

/* Navigation */
.onboarding-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    gap: 12px;
}

.onboarding-btn-prev,
.onboarding-btn-next {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: var(--font);
}

.onboarding-btn-prev {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.onboarding-btn-prev:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.onboarding-btn-prev:disabled {
    opacity: 0;
    pointer-events: none;
}

.onboarding-btn-next {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    flex: 1;
    max-width: 200px;
    margin-left: auto;
}

.onboarding-btn-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.onboarding-btn-next.finish {
    background: linear-gradient(135deg, var(--success), #00b894);
}

/* Welcome name */
.onboarding-welcome-name {
    font-size: 16px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 4px;
}

/* Step transition */
.onboarding-content.transitioning {
    animation: onboardingFadeSwitch 0.35s ease;
}

@keyframes onboardingFadeSwitch {
    0%   { opacity: 1; transform: translateX(0); }
    40%  { opacity: 0; transform: translateX(-30px); }
    60%  { opacity: 0; transform: translateX(30px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* ============================================
   RESPONSIVE — TABLETTE (769px → 1024px)
   ============================================ */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Header */
    .app-header {
        padding: 0 16px;
    }

    .header-center {
        max-width: 320px;
        margin: 0 16px;
    }

    .search-bar {
        height: 38px;
        padding: 0 14px;
    }

    .search-bar input {
        font-size: 13px;
    }

    .btn-report {
        padding: 7px 14px;
        font-size: 13px;
    }

    /* Panel latéral rétréci */
    .alert-panel {
        width: 340px;
    }

    .greeting-banner {
        padding: 12px 16px;
    }

    .greeting-emoji {
        font-size: 24px;
    }

    .greeting-message {
        font-size: 14px;
    }

    .panel-header {
        padding: 16px;
    }

    .panel-header-top h2 {
        font-size: 16px;
    }

    .filter-tabs {
        gap: 6px;
    }

    .tab {
        padding: 5px 10px;
        font-size: 11px;
    }

    /* Cartes alertes */
    .alert-list {
        padding: 10px;
    }

    .alert-card {
        padding: 14px;
    }

    .alert-title {
        font-size: 14px;
    }

    .alert-desc {
        font-size: 12px;
    }

    /* Modal */
    .modal {
        max-width: 440px;
    }

    .modal-detail {
        max-width: 480px;
    }

    /* Zone chat */
    .zone-chat-panel {
        width: 340px;
    }

    /* Notifications */
    .notif-banner {
        max-width: 380px;
    }
}

/* FAB Menu : masqué sur desktop, visible uniquement en mobile */
.fab-menu {
    display: none;
}

/* ============================================
   RESPONSIVE — MOBILE (≤ 768px)
   ============================================ */
@media (max-width: 768px) {
    /* ===== HEADER MOBILE — compact et propre ===== */
    .app-header {
        padding: 0 10px;
        height: 48px;
    }

    .logo img {
        width: 26px;
        height: 26px;
    }

    .logo-text {
        font-size: 15px;
    }

    .header-center {
        display: none;
    }

    .header-right {
        gap: 4px;
    }

    .btn-theme-toggle,
    .btn-notif,
    .btn-lang-toggle {
        width: 32px;
        height: 32px;
        font-size: 14px;
        padding: 0;
    }

    .btn-report {
        padding: 5px 10px;
        font-size: 12px;
    }

    .btn-report span:last-child {
        display: none;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    /* ===== LAYOUT MOBILE — carte plein écran ===== */
    .app-main {
        flex-direction: column;
        height: calc(100vh - 48px);
    }

    .map-container {
        flex: 1;
        min-height: calc(100vh - 48px); /* carte plein écran sous le header */
    }

    /* ===== PANEL D'ALERTES — MASQUÉ sur mobile (incidents via popup carte) ===== */
    .alert-panel {
        display: none !important;
    }

    /* Bouton fermer dans le panel */
    .alert-panel::before {
        content: '✕';
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 50%;
        margin: 10px 12px 4px auto;
        font-size: 14px;
        color: var(--text-secondary);
        cursor: pointer;
    }

    /* ===== BANDEAU SALUTATION — mini ===== */
    .greeting-banner {
        padding: 6px 12px;
        gap: 8px;
        margin: 0;
    }

    .greeting-emoji {
        font-size: 18px;
    }

    .greeting-message {
        font-size: 12px;
    }

    .greeting-name {
        font-size: 10px;
    }

    /* ===== PANEL HEADER — serré ===== */
    .panel-header {
        padding: 6px 12px 8px;
    }

    .panel-header-top {
        margin-bottom: 6px;
    }

    .panel-header-top h2 {
        font-size: 14px;
    }

    .btn-advanced-filter span:not(.filter-count) {
        display: none;
    }

    .filter-tabs {
        gap: 4px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .filter-tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        padding: 4px 10px;
        font-size: 11px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* ===== FILTRES AVANCÉS ===== */
    .filter-chips { gap: 4px; }
    .filter-chip { padding: 3px 8px; font-size: 10px; }
    .filter-distance-row { gap: 8px; }
    .filter-toggle-row { font-size: 12px; }

    /* ===== CARTES ALERTES ===== */
    .alert-list {
        padding: 6px;
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        max-height: calc(100% - 100px);
    }

    .alert-card {
        padding: 10px;
        margin-bottom: 6px;
    }

    .alert-title {
        font-size: 13px;
    }

    .alert-desc {
        font-size: 11px;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .alert-photo {
        height: 100px;
    }

    .alert-footer {
        margin-top: 6px;
        padding-top: 6px;
    }

    .alert-location,
    .alert-reporter {
        font-size: 11px;
    }

    .alert-stats-row {
        font-size: 11px;
    }

    /* ===== MOBILE : cacher les boutons individuels ===== */
    .btn-locate-me,
    .btn-heatmap-toggle,
    .btn-sos,
    .btn-zone-chat {
        display: none !important;
    }

    /* ===== FAB MENU MOBILE ===== */
    .fab-menu {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        position: fixed;
        top: 58px;
        right: 10px;
        z-index: 900;
        gap: 0;
        pointer-events: none; /* laisse passer les clics quand fermé */
    }

    .fab-menu.open {
        pointer-events: auto; /* capte les clics quand ouvert */
    }

    .fab-toggle {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--accent);
        border: none;
        color: white;
        font-size: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 16px rgba(74, 90, 247, 0.45);
        position: relative;
        z-index: 910;
        pointer-events: auto; /* toujours cliquable même quand parent a pointer-events:none */
        -webkit-transition: -webkit-transform 0.25s ease, background 0.25s ease;
        transition: transform 0.25s ease, background 0.25s ease;
    }

    .fab-toggle:active {
        -webkit-transform: scale(0.92);
        transform: scale(0.92);
    }

    .fab-menu.open .fab-toggle {
        background: var(--bg-card);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
        -webkit-transform: rotate(90deg);
        transform: rotate(90deg);
    }

    .fab-close-icon {
        display: none;
    }

    .fab-menu.open .fab-icon {
        display: none;
    }

    .fab-menu.open .fab-close-icon {
        display: inline;
    }

    /* Items du menu */
    .fab-items {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
        opacity: 0;
        pointer-events: none;
        -webkit-transform: translateY(-10px) scale(0.9);
        transform: translateY(-10px) scale(0.9);
        -webkit-transition: opacity 0.2s ease, -webkit-transform 0.2s ease;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .fab-menu.open .fab-items {
        opacity: 1;
        pointer-events: auto;
        -webkit-transform: translateY(0) scale(1);
        transform: translateY(0) scale(1);
    }

    .fab-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px 8px 10px;
        border-radius: 22px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        color: var(--text-primary);
        font-size: 14px;
        cursor: pointer;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        white-space: nowrap;
        transition: transform 0.15s ease, background 0.15s ease;
    }

    .fab-item:active {
        transform: scale(0.95);
        background: var(--bg-card-hover);
    }

    .fab-item span {
        font-size: 18px;
        width: 24px;
        text-align: center;
    }

    .fab-item label {
        font-size: 13px;
        font-weight: 500;
        pointer-events: none;
        font-family: var(--font);
    }

    .fab-item-sos {
        background: linear-gradient(135deg, #ff4757, #c0392b);
        border-color: transparent;
        color: white;
        box-shadow: 0 2px 14px rgba(255, 71, 87, 0.4);
    }

    .fab-item-sos:active {
        background: linear-gradient(135deg, #e8414f, #a93226);
    }

    /* Overlay sombre derrière le menu ouvert */
    .fab-menu.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: -1;
    }

    /* Bouton signaler centré */
    .btn-report-floating {
        bottom: calc(40vh + 18px);
        left: 50%;
        transform: translateX(-50%);
    }

    /* Modals mobile */
    .modal-overlay {
        align-items: flex-end;
    }

    .modal {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0;
        padding: 20px;
        max-height: 90vh;
        animation: modalSlideUp 0.3s ease;
    }

    @keyframes modalSlideUp {
        from { opacity: 0; transform: translateY(100%); }
        to { opacity: 1; transform: translateY(0); }
    }

    .modal-header {
        margin-bottom: 16px;
    }

    .modal-header h2 {
        font-size: 17px;
    }

    .modal-detail {
        padding: 0;
        max-height: 92vh;
    }

    .modal-detail .modal-header {
        padding: 16px 16px 12px;
    }

    .detail-body {
        padding: 14px 16px 20px;
    }

    .detail-icon {
        font-size: 26px;
    }

    .detail-header-left h2 {
        font-size: 15px;
    }

    .detail-photo {
        max-height: 160px;
    }

    .detail-desc {
        font-size: 13px;
    }

    .detail-info-grid {
        padding: 10px;
        gap: 6px;
    }

    .detail-info-item {
        font-size: 12px;
    }

    /* Actions confirmer + suivre mobile */
    .detail-actions-row {
        flex-direction: column;
        gap: 8px;
    }

    .btn-confirm {
        padding: 8px 18px;
        font-size: 13px;
    }

    .btn-follow {
        padding: 8px 16px;
        font-size: 13px;
        align-self: center;
    }

    /* Commentaires mobile */
    .comment-list {
        max-height: 160px;
    }

    .comment-item {
        padding: 8px 10px;
    }

    .comment-text {
        font-size: 12px;
    }

    .comment-form input {
        padding: 8px 14px;
        font-size: 12px;
    }

    .btn-send-comment {
        width: 34px;
        height: 34px;
    }

    /* Grille type incident mobile */
    .incident-type-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .type-btn {
        padding: 10px 2px;
    }

    .type-icon {
        font-size: 20px;
    }

    .type-label {
        font-size: 10px;
    }

    /* Sévérité mobile */
    .severity-btn {
        padding: 8px;
        font-size: 12px;
    }

    /* Photo upload mobile */
    .photo-placeholder {
        padding: 18px;
        font-size: 12px;
    }

    .photo-icon {
        font-size: 24px;
    }

    /* Mini carte */
    .mini-map {
        height: 130px;
    }

    /* Notifications mobile */
    .notif-banner {
        top: 64px;
        width: 95%;
        max-width: 100%;
        border-radius: 12px;
        padding: 12px 14px;
    }

    .notif-banner-icon {
        font-size: 24px;
    }

    .notif-banner-title {
        font-size: 13px;
    }

    .notif-banner-desc {
        font-size: 11px;
    }

    /* Zone chat mobile */
    .btn-zone-chat {
        bottom: 16px;
        left: 16px;
        width: 48px;
        height: 48px;
    }

    .zone-chat-icon {
        font-size: 20px;
    }

    .zone-chat-panel {
        bottom: 12px;
        left: 8px;
        right: 8px;
        width: auto;
        max-height: 70vh;
        border-radius: 16px;
        z-index: 1000;
    }

    .zone-chat-header {
        padding: 12px 14px;
    }

    .zone-chat-header h3 {
        font-size: 14px;
    }

    .zone-chat-messages {
        min-height: 180px;
        max-height: 35vh;
        padding: 12px;
    }

    .zone-msg {
        padding: 8px 12px;
    }

    .zone-msg-text {
        font-size: 12px;
    }

    .zone-chat-form {
        padding: 10px 12px;
    }

    .zone-chat-form input {
        padding: 8px 14px;
        font-size: 12px;
    }

    .btn-zone-chat-send {
        width: 36px;
        height: 36px;
    }

    /* Marqueurs carte mobile */
    .ios-marker {
        width: 38px;
        height: 38px;
    }

    .ios-marker-icon {
        font-size: 17px;
    }

    .ios-locate-btn {
        width: 40px;
        height: 40px;
    }

    .leaflet-control-zoom a {
        width: 38px !important;
        height: 38px !important;
        line-height: 38px !important;
        font-size: 16px !important;
    }
}

/* Onboarding mobile */
@media (max-width: 768px) {
    .onboarding-card {
        width: 95%;
        padding: 24px 20px;
        border-radius: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    .onboarding-illustration { font-size: 56px; }
    .onboarding-title { font-size: 19px; }
    .onboarding-desc { font-size: 13px; }
    .onboarding-feature { padding: 12px 14px; }
    .onboarding-feature-icon { width: 36px; height: 36px; font-size: 20px; }
    .onboarding-btn-prev, .onboarding-btn-next { padding: 10px 18px; font-size: 13px; }
}

/* ============================================
   RESPONSIVE — PETIT MOBILE (≤ 480px)
   ============================================ */
@media (max-width: 480px) {
    .app-header {
        padding: 0 8px;
        height: 50px;
        gap: 4px;
    }

    .logo img {
        width: 26px;
        height: 26px;
    }

    .logo-text {
        font-size: 15px;
    }

    .header-right {
        gap: 6px;
    }

    .btn-theme-toggle,
    .btn-notif {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .btn-report {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-report span:first-child {
        font-size: 14px;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    /* Layout */
    .app-main {
        height: calc(100vh - 50px);
    }

    .alert-panel {
        display: none !important;
    }

    /* Salutation petit mobile */
    .greeting-banner {
        padding: 8px 12px;
        gap: 8px;
    }

    .greeting-emoji {
        font-size: 20px;
    }

    .greeting-message {
        font-size: 12px;
    }

    .greeting-name {
        font-size: 10px;
    }

    /* Panel */
    .panel-header {
        padding: 10px 12px;
    }

    .panel-header-top {
        margin-bottom: 8px;
    }

    .panel-header-top h2 {
        font-size: 14px;
    }

    .tab {
        padding: 4px 8px;
        font-size: 10px;
    }

    /* Cartes */
    .alert-list {
        padding: 6px;
    }

    .alert-card {
        padding: 10px;
        margin-bottom: 6px;
        border-radius: 10px;
    }

    .alert-type {
        font-size: 12px;
    }

    .alert-title {
        font-size: 13px;
    }

    .alert-desc {
        font-size: 11px;
    }

    .alert-photo {
        height: 90px;
        border-radius: 8px;
    }

    .alert-location {
        font-size: 11px;
    }

    .badge {
        font-size: 9px;
        padding: 1px 6px;
    }

    /* Modal petit mobile */
    .modal {
        padding: 16px;
        border-radius: 16px 16px 0 0;
    }

    .modal-header h2 {
        font-size: 15px;
    }

    .form-group label {
        font-size: 12px;
    }

    .form-group select,
    .form-group input,
    .form-group textarea {
        padding: 8px 12px;
        font-size: 13px;
    }

    .btn-submit {
        padding: 10px;
        font-size: 14px;
    }

    /* Grille type incident */
    .incident-type-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }

    .type-btn {
        padding: 8px 2px;
    }

    .type-icon {
        font-size: 18px;
    }

    .type-label {
        font-size: 9px;
    }

    /* Détail mobile */
    .detail-body {
        padding: 12px 14px 16px;
    }

    .detail-icon {
        font-size: 22px;
    }

    .detail-header-left h2 {
        font-size: 14px;
    }

    .detail-desc {
        font-size: 12px;
    }

    .comment-list {
        max-height: 130px;
    }

    /* Notifications */
    .notif-banner {
        top: 56px;
        padding: 10px 12px;
        border-radius: 10px;
    }

    .notif-banner-icon {
        font-size: 20px;
    }

    .notif-banner-title {
        font-size: 12px;
    }

    /* Chat zone */
    .btn-zone-chat {
        bottom: 12px;
        left: 12px;
        width: 44px;
        height: 44px;
    }

    .zone-chat-icon {
        font-size: 18px;
    }

    .zone-chat-panel {
        bottom: 64px;
        left: 6px;
        right: 6px;
        max-height: 50vh;
        border-radius: 14px;
    }

    .zone-chat-messages {
        min-height: 140px;
        max-height: 30vh;
        padding: 10px;
    }
}

/* ========== SYSTÈME "JE SURVEILLE" ========== */

/* Bouton "Je surveille" dans le modal détail */
.detail-actions-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.detail-actions-row .confirm-section {
    flex: 1;
    margin-bottom: 0;
}

.btn-follow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-primary);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-follow:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.btn-follow.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.btn-follow:disabled {
    opacity: 0.5;
    cursor: wait;
}

.follow-icon {
    font-size: 16px;
}

/* Onglet "Mes suivis" */
.tab-suivis {
    position: relative;
}

/* Bouton suivre dans les cartes d'alerte */
.btn-watch.following {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* ========== CHAT COMMUNAUTAIRE PAR ZONE ========== */

/* Bouton flottant chat */
.btn-zone-chat {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: white;
    cursor: pointer;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(74, 90, 247, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-zone-chat:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(74, 90, 247, 0.6);
}

.btn-zone-chat.active {
    background: var(--accent-light);
    transform: scale(0.95);
}

.zone-chat-icon {
    font-size: 24px;
}

.zone-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* Panel de chat */
.zone-chat-panel {
    position: fixed;
    bottom: 90px;
    left: 24px;
    width: 380px;
    max-height: 520px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    z-index: 899;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.zone-chat-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header chat */
.zone-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.zone-chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zone-chat-header-icon {
    font-size: 24px;
}

.zone-chat-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.zone-chat-zone-name {
    font-size: 12px;
    color: var(--text-secondary);
}

.zone-chat-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    z-index: 10;
}

.zone-chat-close:hover {
    color: var(--text-primary);
}

/* Messages */
.zone-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 300px;
    max-height: 360px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.zone-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
    padding: 40px 20px;
}

.zone-chat-empty span {
    font-size: 36px;
}

.zone-chat-empty p {
    font-size: 14px;
}

.zone-chat-empty-hint {
    font-size: 12px !important;
    opacity: 0.6;
}

.zone-chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Message bulle */
.zone-msg {
    max-width: 85%;
    padding: 10px 14px;
    background: var(--bg-card);
    border-radius: 16px 16px 16px 4px;
    border: 1px solid var(--border);
}

.zone-msg.own {
    align-self: flex-end;
    background: var(--accent);
    border-color: var(--accent);
    border-radius: 16px 16px 4px 16px;
}

.zone-msg.own .zone-msg-author {
    color: rgba(255, 255, 255, 0.7);
}

.zone-msg.own .zone-msg-time {
    color: rgba(255, 255, 255, 0.5);
}

.zone-msg.own .zone-msg-text {
    color: white;
}

.zone-msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.zone-msg-author {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
}

.zone-msg-time {
    font-size: 10px;
    color: var(--text-secondary);
}

.zone-msg-text {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
    word-break: break-word;
}

/* Formulaire chat */
.zone-chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.zone-chat-form input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.zone-chat-form input:focus {
    border-color: var(--accent);
}

.zone-chat-form input::placeholder {
    color: var(--text-secondary);
}

.btn-zone-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-zone-chat-send:hover {
    background: var(--accent-light);
    transform: scale(1.05);
}

.btn-zone-chat-send:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* ===================================
   HEATMAP TOGGLE BUTTON
   =================================== */

.btn-heatmap-toggle {
    position: fixed;
    bottom: 100px;
    right: 16px;
    z-index: 800;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.btn-heatmap-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.btn-heatmap-toggle.active {
    background: linear-gradient(135deg, var(--accent), var(--danger));
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.35);
}

.btn-heatmap-toggle.active:hover {
    box-shadow: 0 6px 28px rgba(255, 71, 87, 0.5);
}

/* ===================================
   BOUTON RECENTRER GPS
   =================================== */
.btn-locate-me {
    position: fixed;
    bottom: 160px;
    left: 16px;
    z-index: 800;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-locate-me:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.btn-locate-me:active {
    transform: scale(0.95);
}

.btn-locate-me.locating {
    color: var(--accent);
    animation: locatePulse 1s ease infinite;
}

@keyframes locatePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===================================
   CATEGORY MARKERS (carte)
   =================================== */

.category-marker {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid transparent;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease;
}

.category-marker:hover {
    transform: scale(1.15);
}

.ios-marker-icon {
    font-size: 18px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* ===================================
   SHARE DETAIL BUTTON (modal incident)
   =================================== */

.btn-share-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-share-detail:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-share-detail span:first-child {
    font-size: 16px;
}

.share-label {
    font-weight: 500;
}

.btn-delete-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: var(--radius-sm);
    color: #ff4757;
    font-size: 14px;
    font-family: var(--font);
    cursor: pointer;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-delete-detail:hover {
    background: rgba(255, 71, 87, 0.1);
    border-color: #ff4757;
}

.btn-delete-detail span:first-child {
    font-size: 16px;
}

/* ===================================
   SHARE SHEET (overlay partage)
   =================================== */

.share-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.share-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}

.share-sheet {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.share-sheet-overlay.active .share-sheet {
    transform: translateY(0);
}

.share-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.share-sheet-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.share-sheet-header button {
    background: var(--bg-card);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.share-sheet-header button:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.share-sheet-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-option:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.share-option-icon {
    font-size: 28px;
    line-height: 1;
}

.share-option span:last-child {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ===================================
   NOTIFICATION SETTINGS MODAL
   =================================== */

.modal-notif-settings {
    max-width: 440px;
}

.modal-notif-settings .modal-header {
    border-bottom: 1px solid var(--border);
}

.notif-settings-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-height: 65vh;
    overflow-y: auto;
}

.notif-setting-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notif-setting-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.notif-radius-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notif-radius-row input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-primary);
    outline: none;
}

.notif-radius-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(74, 90, 247, 0.4);
    transition: transform 0.15s;
}

.notif-radius-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.notif-radius-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    min-width: 50px;
    text-align: right;
}

/* Grille de catégories */
.notif-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

.notif-cat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.notif-cat-chip:hover {
    background: var(--bg-card-hover);
}

.notif-cat-chip.active {
    background: rgba(74, 90, 247, 0.15);
    border-color: var(--accent);
    color: var(--text-primary);
}

.notif-cat-chip .cat-icon {
    font-size: 16px;
}

/* Toggles (urgence, son, vibration) */
.notif-setting-section .toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.notif-setting-section .toggle-row span {
    font-size: 14px;
    color: var(--text-primary);
}

.notif-setting-section .toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
}

.notif-setting-section .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.notif-setting-section .toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-primary);
    border-radius: 14px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.notif-setting-section .toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 3px;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.notif-setting-section .toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.notif-setting-section .toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(21px);
}

/* Bouton sauvegarder notif settings */
.btn-save-notif-settings {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.btn-save-notif-settings:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* ===================================
   RESPONSIVE — Nouvelles features
   =================================== */

@media (max-width: 768px) {
    /* .btn-heatmap-toggle: position gérée dans le bloc mobile principal */

    .share-sheet {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }

    .share-sheet-options {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .notif-category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-notif-settings {
        max-width: 100%;
        margin: 0 12px;
    }
}

@media (max-width: 480px) {
    /* .btn-heatmap-toggle: position gérée dans le bloc mobile principal */

    .share-sheet-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .notif-category-grid {
        grid-template-columns: 1fr 1fr;
    }

    .btn-share-detail {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* ===================================
   BOUTON SOS
   =================================== */

.btn-sos {
    position: fixed;
    bottom: 30px;
    right: 16px;
    z-index: 900;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4757, #c0392b);
    border: 3px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    font-weight: 800;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.5);
    transition: all 0.3s ease;
    overflow: visible;
}

.btn-sos:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(255, 71, 87, 0.6);
}

.btn-sos .sos-text {
    position: relative;
    z-index: 2;
    letter-spacing: 1px;
}

.btn-sos .sos-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(255, 71, 87, 0.3);
    animation: sosPulse 2s infinite;
    z-index: 1;
}

@keyframes sosPulse {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

/* ===================================
   MODAL SOS
   =================================== */

.modal-sos {
    max-width: 480px;
}

.sos-header {
    background: linear-gradient(135deg, #ff4757, #c0392b);
}

.sos-header h2 {
    color: white !important;
}

.sos-header .modal-close {
    color: rgba(255, 255, 255, 0.8);
}

.sos-header .modal-close:hover {
    color: white;
}

.sos-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.sos-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sos-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.sos-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: -6px;
}

/* Contacts de confiance */
.sos-contacts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sos-contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.sos-contact-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sos-contact-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.sos-contact-phone {
    font-size: 13px;
    color: var(--text-secondary);
}

.sos-contact-remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 71, 87, 0.15);
    border: none;
    color: var(--danger);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sos-contact-remove:hover {
    background: var(--danger);
    color: white;
}

.sos-no-contacts {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 12px;
}

.sos-add-contact {
    display: flex;
    gap: 8px;
}

.sos-add-contact input {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.sos-add-contact input:focus {
    border-color: var(--accent);
}

.sos-add-contact input::placeholder {
    color: var(--text-secondary);
}

.btn-sos-add {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-sos-add:hover {
    background: var(--accent-light);
}

/* Numéros d'urgence */
.emergency-numbers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.emergency-number-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.emergency-number-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.emergency-card-main {
    border-color: var(--accent);
    background: rgba(74, 90, 247, 0.08);
}

.emergency-card-main:hover {
    background: rgba(74, 90, 247, 0.15);
}

.emergency-icon {
    font-size: 24px;
}

.emergency-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

.emergency-num {
    font-size: 18px;
    font-weight: 800;
    color: var(--danger);
    letter-spacing: 1px;
}

.emergency-card-main .emergency-num {
    color: var(--accent);
}

/* Bouton SOS trigger (gros bouton rouge) */
.sos-trigger-section {
    align-items: center;
    text-align: center;
}

.sos-trigger-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-sos-trigger {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px auto;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.sos-trigger-inner {
    position: relative;
    z-index: 2;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4757, #c0392b);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: white;
    font-weight: 800;
    font-size: 12px;
    font-family: var(--font);
    letter-spacing: 1px;
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.4);
    transition: transform 0.2s ease;
}

.sos-trigger-icon {
    font-size: 28px;
}

.btn-sos-trigger.holding .sos-trigger-inner {
    transform: scale(0.92);
    box-shadow: 0 2px 10px rgba(255, 71, 87, 0.3);
}

/* SVG cercle de progression */
.sos-progress-ring {
    position: absolute;
    inset: 0;
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.sos-progress-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 4;
}

.sos-progress-bar {
    fill: none;
    stroke: #ff4757;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.05s linear;
}

/* Statut SOS */
.sos-status {
    min-height: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.sos-loading {
    color: var(--warning);
    animation: blink 0.8s infinite;
}

.sos-success {
    color: var(--success);
}

.sos-error {
    color: var(--danger);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===================================
   BOUTON LANGUE
   =================================== */

.btn-lang-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-lang-toggle:hover {
    background: var(--bg-card-hover);
    transform: scale(1.05);
}

/* ===================================
   RESPONSIVE — SOS & LANGUE
   =================================== */

@media (max-width: 768px) {
    /* Boutons flottants: positions gérées dans le bloc mobile principal */

    .emergency-numbers-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .modal-sos {
        max-width: 100%;
        margin: 0 10px;
    }

    .btn-lang-toggle {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .sos-add-contact {
        flex-wrap: wrap;
    }

    .sos-add-contact input {
        min-width: 0;
    }
}

@media (max-width: 480px) {
    /* Boutons flottants: positions gérées dans le bloc mobile principal */

    .emergency-numbers-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn-sos-trigger {
        width: 100px;
        height: 100px;
    }

    .sos-trigger-inner {
        width: 80px;
        height: 80px;
    }

    .sos-progress-ring {
        width: 100px;
        height: 100px;
    }

    .sos-trigger-icon {
        font-size: 22px;
    }
}

/* ===================================
   PERFORMANCE & COMPATIBILITÉ
   GPU acceleration, touch, safe areas, fallbacks
   =================================== */

/* GPU acceleration pour les animations */
.alert-card,
.modal-overlay,
.share-sheet-overlay,
.toast,
.ios-marker,
.sos-pulse,
.onboarding-overlay {
    will-change: transform, opacity;
}

/* Contenu isolé pour éviter les repaints globaux */
#alertList {
    contain: layout style;
}

.alert-card {
    contain: layout style paint;
}

/* Touch optimisations mobiles */
button, .btn-detail, .btn-watch, .btn-share, .btn-delete,
.tab, .filter-chip, .btn-primary, .btn-sos,
.share-option, .emergency-number {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Scroll fluide natif (momentum sur iOS) */
#alertList,
.comment-list,
.zone-chat-messages,
.search-results {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Safe area insets (iPhone notch, barre de navigation, etc.) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .app-header {
        padding-top: max(12px, env(safe-area-inset-top));
    }

    /* Les boutons flottants mobile sont gérés via calc(40vh + X)
       dans le bloc @media (max-width: 768px) principal.
       Pas besoin de safe-area override ici car le panel
       gère déjà le safe-area-inset-bottom. */
}

/* Fallback pour les navigateurs sans backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
    .modal-overlay {
        background: rgba(0, 0, 0, 0.92);
    }
    .toast {
        background: rgba(30, 30, 40, 0.98);
    }
    .share-sheet-overlay {
        background: rgba(0, 0, 0, 0.92);
    }
}

/* Focus visible pour accessibilité clavier */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus:not(:focus-visible) {
    outline: none;
}

/* Réduire les animations si l'utilisateur le souhaite */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .sos-pulse,
    .ios-user-pulse {
        animation: none;
    }
}

/* Haute résolution / Retina */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .ios-marker {
        border-width: 0.5px;
    }
}

/* Mode paysage mobile — ajuster la sidebar */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        max-height: 100vh;
    }
    .alert-card {
        padding: 10px 14px;
    }
    .app-header {
        padding: 6px 16px;
    }
}

/* Très petits écrans (SE, Galaxy Fold plié, etc.) */
@media (max-width: 360px) {
    .logo-text { display: none; }
    .header-right button { padding: 6px 8px; font-size: 14px; }
    .tab { font-size: 11px; padding: 6px 10px; }
    .alert-card { padding: 10px; }
    .alert-title { font-size: 14px; }
    .modal-content { padding: 16px; }
    .btn-report { width: 48px; height: 48px; }
    .btn-sos { width: 40px; height: 40px; font-size: 10px; }
    .btn-locate-me, .btn-heatmap-toggle { width: 32px; height: 32px; font-size: 14px; }
    .emergency-grid { grid-template-columns: 1fr 1fr; }
}

/* Print : masquer les éléments non pertinents */
@media print {
    .app-header, .sidebar-tabs, .btn-report, .btn-sos,
    .alert-footer, .modal-overlay, .share-sheet-overlay,
    .toast, .onboarding-overlay, #map { display: none !important; }
    .sidebar { width: 100% !important; max-height: none !important; }
    .alert-card { break-inside: avoid; page-break-inside: avoid; }
}

/* Fin des styles */
