/* ==========================================================================
   1. GLOBAL & RESET
   ========================================================================== */
/* ========================================================================== 
   1. GLOBAL & RESET 
   ========================================================================== */
:root {
    --saf-red: #e74c3c;
    --saf-dark: #2c3e50;
    --accent-orange: #f39c12;
    --text-main: #34495e;
    --bg-main: #ffffff;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    padding-bottom: 100px;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    font-weight: 400;
}

.content-section {
    line-height: 1.6;
    font-size: 0.9rem;
    color: #444;
}

/* Supprime la surcouche bleue/grise par défaut sur mobile au toucher (tap) */
a, button, .card, .scroll-item, .leaflet-popup-content a {
    -webkit-tap-highlight-color: transparent !important;
}

/* BOUTONS LIENS : empêchons le comportement texte bleu souligné */
a.btn, a.btn-primary, a.btn-saf {
    color: rgb(0, 0, 0) !important;
    text-decoration: none !important;
}
a.btn-danger {
    color: rgb(255, 255, 255) !important;
    text-decoration: none !important;
}
a.btn-outline-secondary, a.btn-outline-light, a.btn-outline-dark {
    text-decoration: none !important;
}

.btn {
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-saf,
.btn-saf.btn,
.btn.btn-saf {
    background: var(--gradient-bg);
    color: white !important;
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
    border: none;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.btn-saf:hover,
.btn-saf:focus {
    background: var(--accent-orange);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.35);
}

a {
    color: inherit;
}

a:hover {
    color: inherit;
    text-decoration: none;
}

.page-loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* ==========================================================================
   2. NAVIGATION (Navbar & Menu)
   ========================================================================== */
nav {
    z-index: 1100 !important;
}

.nav-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 2px;
}

.menu-btn {
    background: #f8f9fa;
    border: none;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
    transition: 0.2s;
    text-align: left;
}

.menu-btn:active {
    background: #e9ecef;
    transform: scale(0.98);
}

.icon-square {
    width: 45px;
    height: 45px;
    background: #dc3545;
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 15px;
}

/* ==========================================================================
   3. STRUCTURE DES PAGES (Sub-pages & Layouts)
   ========================================================================== */
.sub-page {
    display: none;
    padding-bottom: 100px;
}

.sub-page.active {
    display: block;
}

.back-btn,
.btn-back {
    width: 40px;
    height: 40px;
    opacity: 0.8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.back-btn {
    background: #eee;
    border: none;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.7rem;
    color: #333;
    padding: 8px 15px;
    border-radius: 20px;
    margin-bottom: 20px;
}

/* Grilles & Conteneurs de scroll */
.grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.grid-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #f8f9fa;
}

.scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

.scroll-item {
    flex-shrink: 0;
    width: 75vw;
    scroll-snap-align: center;
}

.hero-gradient {
    background: linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0) 100%
    );
}

/* ==========================================================================
   4. ARTISTES & ŒUVRES
   ========================================================================== */
.artist-card,
.oeuvre-card {
    transition: all 0.3s ease;
    border: none;
}

.artist-card:active {
    transform: scale(0.96);
}

.oeuvre-card:active {
    transform: scale(0.98);
}

.pfp-spacejunk {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
}

.bio-truncated {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

.badge-year {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(220, 53, 69, 0.9);
    backdrop-filter: blur(4px);
    z-index: 10;
}

/* Filtrage */
.d-none-filter {
    display: none !important;
}

.filter-btn {
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn.active {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

/* Style de la popup "Toast" */
.copy-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px); /* Caché en bas */
    background-color: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Classe activée par le JavaScript */
.copy-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
/* ==========================================================================
   5. CARTE (Leaflet)
   ========================================================================== */
/* 1. STRUCTURE GLOBALE */
#map {
    height: 100vh;
    width: 100%;
    z-index: 1;
}

body {
    overflow: auto;
}


/* Si nécessaire plus tard : body.carte-page permet d'isoler le non-scroll sur carte
   mais actuellement on ne l'utilise pas pour éviter des problèmes de scrolling globaux. */
body.carte-page {
    overflow: auto;
}

/* 2. LEAFLET CUSTOMIZATION */
.custom-marker-dot {
    width: 16px;
    height: 16px;
    background-color: #dc3545;
    border: 2px solid white;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.marker-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #000;
    color: #fff;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 10px;
    border: 1px solid white;
}

.leaflet-popup-content-wrapper {
    border-radius: 15px;
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    width: 200px !important;
}

.popup-img {
    height: 120px;
    width: 100%;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

/* 3. BOTTOM SHEET (Interface de ton croquis) */
#nearbyBar {
    transition: transform 0.4s cubic-bezier(0.32, 1, 0.23, 1);
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
    background: white;
}

/* 4. CARROUSELS HORIZONTAUX */
.no-scrollbar::-webkit-scrollbar {
    display: none; /* Cache la scrollbar sur Chrome/Safari */
}

.no-scrollbar {
    -ms-overflow-style: none; /* IE/Edge */
    scrollbar-width: none; /* Firefox */
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 5px;
}

.scroll-item {
    flex: 0 0 auto; /* Empêche les cartes de rétrécir */
    width: 160px;
}

.scroll-item .card {
    transition: var(--transition);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.scroll-item .card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

/* ==========================================================================
   6. ADMIN PANEL STYLING
   ========================================================================== */
.admin-sidebar, .sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    background: #1f2a36;
    color: #fff;
    border-right: 1px solid rgba(255,255,255,0.08);
    z-index: 1000;
    transition: all 0.3s ease;
}

.admin-main, .main-content {
    margin-left: 260px;
    padding: 30px;
    transition: all 0.3s ease;
    min-height: 100vh;
    background: #f4f6f9;
}

.nav-link {
    color: rgba(255,255,255,0.8);
    border-radius: 10px;
    margin: 8px 0;
    padding: 12px 20px;
    transition: all 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fff !important;
    background: rgba(220,53,69,0.9) !important;
    box-shadow: 0 4px 12px rgba(220,53,69,0.25);
}

.stat-card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

#map-picker,
.map-edit {
    border-radius: 15px;
    border: 2px solid #eee;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.table-img {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 10px;
}

/* ==========================================================================
   7. Boutons (adaptation couleur texte selon fond)
   ========================================================================== */
.btn {
    transition: all 0.2s ease;
    font-weight: 600;
}

.btn-primary,
.btn-danger,
.btn-saf,
.btn-dark,
.btn-danger,
.btn-secondary {
    color: #fff !important;
}

.btn-light,
.btn-white,
.btn-outline-light,
.btn-outline-secondary,
.btn-outline-white,
.btn-outline-none {
    color: #000 !important;
}

.btn-white {
    background-color: #fff !important;
    border: 1px solid #e3e3e3 !important;
}

.btn-light {
    background-color: #f8f9fa !important;
    border: 1px solid #ced4da !important;
}

.btn-outline-light {
    background: transparent !important;
    color: #000 !important;
    border: 1px solid #f8f9fa !important;
}

.btn-outline-dark {
    color: #fff !important;
    border: 1px solid #000 !important;
}

.btn-light:hover,
.btn-white:hover {
    background-color: #e9ecef !important;
    color: #000 !important;
}

.btn-saf {
    background: var(--saf-red) !important;
    color: white !important;
}

.btn-saf:hover,
.btn-saf:focus,
.btn-saf:active {
    background: #bd2130 !important;
    color: white !important;
}

/* Pour bouton de retour mobile/desktop en mode accessible */
.btn-back {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    color: #333;
    border: 1px solid rgba(0,0,0,0.08);
}

.btn-back:hover {
    background: #fff;
    box-shadow: 0 3px 12px rgba(0,0,0,0.16);
    color: #000;
}


.scroll-item .card:active {
    transform: scale(0.95);
}

/* Style spécifique pour tes parcours en dur */
.card-img-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    border-radius: 0 0 15px 15px;
}
/* ==========================================================================
   6. INFO & FAQ
   ========================================================================== */
.faq-item {
    margin-bottom: 25px;
    border-bottom: 1px solid #f1f1f1;
    padding-bottom: 1rem;
}

.faq-q {
    font-weight: 800;
    color: #212529;
    font-size: 1rem;
    margin-bottom: 8px;
    display: block;
}

.team-cat {
    color: #dc3545;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-top: 25px;
    margin-bottom: 10px;
    border-bottom: 2px solid #dc3545;
    display: inline-block;
}
