/* =====================================
   ADOS GAY - DESIGN SYSTEM
   Portail #Ados-LGBT+ / réseau Chatteurs
   ===================================== */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --accent: #ec4899;
    --accent-dark: #db2777;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;

    --white: #ffffff;
    --light: #f8fafc;
    --light-2: #eef0fb;
    --border: #e2e8f0;
    --text: #1a202c;
    --text-light: #4a5568;
    --text-muted: #718096;
    --dark: #0f172a;

    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --gradient-soft: linear-gradient(135deg, #eef0fb 0%, #fdf1f8 100%);

    --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.06);
    --shadow: 0 1px 3px 0 rgb(15 23 42 / 0.1), 0 1px 2px -1px rgb(15 23 42 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(15 23 42 / 0.1), 0 2px 4px -2px rgb(15 23 42 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(15 23 42 / 0.1), 0 4px 6px -4px rgb(15 23 42 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(15 23 42 / 0.12), 0 8px 10px -6px rgb(15 23 42 / 0.1);

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;

    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
}

/* ===== Reset & base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--white);
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 var(--space-4); }
.navbar-offset { padding-top: 76px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* =====================================
   NAVIGATION
   ===================================== */
.modern-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

.nav-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand { display: flex; align-items: center; gap: var(--space-2); }
.brand-logo { height: 38px; width: auto; border-radius: var(--radius-sm); }
.brand-text { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.brand-text .accent { color: var(--accent); }

.nav-menu { display: flex; align-items: center; gap: var(--space-6); }
.nav-link {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
    padding: var(--space-2) 0;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--primary); border-color: var(--primary); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; }

/* =====================================
   HERO / FORMULAIRE DE CONNEXION
   ===================================== */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--gradient-primary);
    overflow: hidden;
    padding: 96px 0 var(--space-16);
}

.hero-bg {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.15), transparent 45%),
                radial-gradient(circle at 80% 70%, rgba(255,255,255,0.12), transparent 45%);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: var(--space-16);
    align-items: center;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.hero-text { color: var(--white); }
.hero-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; line-height: 1.15; margin-bottom: var(--space-4); }
.hero-subtitle { font-size: 1.1rem; opacity: 0.92; margin-bottom: var(--space-8); max-width: 42ch; }

.hero-features { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.feature { display: flex; align-items: center; gap: var(--space-2); font-weight: 600; font-size: 0.9rem; }
.feature i { color: var(--white); opacity: 0.9; }

/* Compteur des salles en direct */
.stats-bar { display: flex; gap: var(--space-6); margin-top: var(--space-8); flex-wrap: wrap; }
.stat-item { color: var(--white); }
.stat-number { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.8rem; opacity: 0.85; }

/* Carte formulaire */
.chat-form-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-8);
}

.form-header { text-align: center; margin-bottom: var(--space-6); }
.form-header h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: var(--space-1); }
.form-header p { color: var(--text-muted); font-size: 0.9rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-group { margin-bottom: var(--space-4); }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: var(--space-2); color: var(--text-light); }

.input-group { position: relative; }
.input-group input, .input-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background: var(--light);
    transition: var(--transition);
    color: var(--text);
}
.input-group input::placeholder { color: var(--text-muted); }
.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgb(79 70 229 / 0.12);
}

.error-message { display: none; color: var(--danger); font-size: 0.8rem; margin-top: var(--space-1); }
.error-message.show { display: block; }

.gender-options { display: flex; gap: var(--space-3); }
.gender-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-3);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
}
.gender-option input { position: absolute; opacity: 0; pointer-events: none; }
.gender-option:has(input:checked) { border-color: var(--primary); background: var(--light-2); color: var(--primary); }
.gender-icon { font-size: 1.3rem; }

.checkbox-container { display: flex; align-items: flex-start; gap: var(--space-2); font-size: 0.82rem; color: var(--text-light); cursor: pointer; margin-bottom: var(--space-4); }
.checkbox-container input { margin-top: 3px; }
.terms-link { color: var(--primary); font-weight: 600; text-decoration: underline; }

.connect-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}
.connect-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.connect-btn:active { transform: translateY(0); }
.connect-btn[disabled] { opacity: 0.7; cursor: not-allowed; }

/* =====================================
   SECTIONS GÉNÉRIQUES
   ===================================== */
.section { padding: var(--space-16) 0; }
.section-alt { background: var(--light); }
.section-header { text-align: center; max-width: 640px; margin: 0 auto var(--space-12); }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; margin-bottom: var(--space-3); }
.section-subtitle { color: var(--text-muted); font-size: 1rem; }

/* =====================================
   GALERIE DE PROFILS (API chatteurs)
   ===================================== */
.gallery-toolbar {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-8);
    flex-wrap: wrap;
}
.gallery-filter {
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border);
    background: var(--white);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-light);
    transition: var(--transition);
}
.gallery-filter.active, .gallery-filter:hover { border-color: var(--primary); color: var(--primary); background: var(--light-2); }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-4);
}

.member-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border);
}
.member-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.member-card__avatar { position: relative; aspect-ratio: 1; background: var(--light-2); }
.member-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-card__badge {
    position: absolute; top: 8px; right: 8px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-full);
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 700;
}
.member-card__body { padding: var(--space-3); }
.member-card__name { font-weight: 700; font-size: 0.92rem; display: flex; align-items: center; gap: 4px; }
.member-card__meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.member-card__flames { font-size: 0.75rem; color: var(--warning); font-weight: 700; margin-top: 4px; }

.gallery-pagination { display: flex; justify-content: center; align-items: center; gap: var(--space-4); margin-top: var(--space-8); }
.gallery-pagination button {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    background: var(--white);
    font-weight: 600;
    transition: var(--transition);
}
.gallery-pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.gallery-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.gallery-pagination span { font-size: 0.85rem; color: var(--text-muted); }

.gallery-empty, .gallery-loading { text-align: center; padding: var(--space-12) 0; color: var(--text-muted); }

/* Modale mini-profil */
.profile-hero { text-align: center; padding-bottom: var(--space-4); }
.profile-hero__avatar { width: 96px; height: 96px; border-radius: var(--radius-full); object-fit: cover; margin: 0 auto var(--space-3); border: 3px solid var(--light-2); }
.profile-hero__name { font-size: 1.2rem; font-weight: 800; }
.profile-hero__meta { color: var(--text-muted); font-size: 0.9rem; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin: var(--space-4) 0; }
.profile-stat { background: var(--light); border-radius: var(--radius-md); padding: var(--space-3); text-align: center; }
.profile-stat strong { display: block; font-size: 1.1rem; }
.profile-stat span { font-size: 0.75rem; color: var(--text-muted); }
.profile-bio { background: var(--light); border-radius: var(--radius-md); padding: var(--space-4); font-size: 0.9rem; color: var(--text-light); }

/* =====================================
   BLOG (API chatteurs)
   ===================================== */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-6); }
.blog-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.blog-card__theme { display: inline-block; font-size: 0.7rem; font-weight: 700; color: var(--primary); background: var(--light-2); padding: 2px 10px; border-radius: var(--radius-full); margin-bottom: var(--space-3); }
.blog-card__title { font-size: 1.05rem; font-weight: 700; margin-bottom: var(--space-2); }
.blog-card__desc { font-size: 0.88rem; color: var(--text-muted); }
.blog-card__meta { font-size: 0.75rem; color: var(--text-muted); margin-top: var(--space-4); }

#blogModalContent { font-family: Georgia, serif; }
#blogModalContent p { margin-bottom: var(--space-4); }
#blogModalContent h2, #blogModalContent h3 { margin: var(--space-6) 0 var(--space-3); color: var(--primary); }

/* =====================================
   PROTECTION DES MINEURS / RÈGLES
   ===================================== */
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-6); }
.rule-card { background: var(--white); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.rule-icon { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--gradient-soft); display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 1.3rem; margin-bottom: var(--space-3); }
.rule-card h3 { font-size: 1.05rem; margin-bottom: var(--space-2); }
.rule-card p { font-size: 0.88rem; color: var(--text-light); }

/* =====================================
   ÉQUIPE / STAFF
   ===================================== */
.team-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-6); }
.info-card { background: var(--white); border-radius: var(--radius-lg); padding: var(--space-6); text-align: center; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.card-icon { font-size: 1.8rem; color: var(--primary); margin-bottom: var(--space-3); }

/* =====================================
   FOOTER
   ===================================== */
.modern-footer { background: var(--dark); color: rgba(255,255,255,0.85); padding: var(--space-16) 0 var(--space-6); }
.footer-content { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--space-12); margin-bottom: var(--space-8); }
.footer-brand img { height: 36px; margin-bottom: var(--space-3); }
.footer-nav a { display: block; padding: var(--space-1) 0; color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer-nav a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: var(--space-6); text-align: center; font-size: 0.8rem; color: rgba(255,255,255,0.5); }

/* =====================================
   MODALES
   ===================================== */
.modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}
.modal.show { display: flex; }
.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--white); }
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.4rem; color: var(--text-muted); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: var(--space-6); }

/* =====================================
   TOASTS
   ===================================== */
.toast-container { position: fixed; top: 90px; right: var(--space-4); z-index: 3000; display: flex; flex-direction: column; gap: var(--space-2); }
.toast {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 240px;
    border-left: 4px solid var(--primary);
    animation: slideIn 0.25s ease;
}
.toast-success { border-color: var(--success); }
.toast-success i { color: var(--success); }
.toast-error { border-color: var(--danger); }
.toast-error i { color: var(--danger); }

@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* =====================================
   RESPONSIVE
   ===================================== */
@media (max-width: 1024px) {
    .hero-content { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; gap: var(--space-8); }
}

@media (max-width: 768px) {
    .nav-menu { position: fixed; top: 68px; left: 0; right: 0; background: var(--white); flex-direction: column; padding: var(--space-4); gap: var(--space-3); border-bottom: 1px solid var(--border); transform: translateY(-150%); transition: var(--transition); }
    .nav-menu.open { transform: translateY(0); }
    .nav-toggle { display: flex; }
    .form-row { grid-template-columns: 1fr; }
    .hero-section { padding-top: 84px; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .profile-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-color-scheme: dark) {
    /* Le site reste en thème clair volontairement (lisibilité des CGU/mentions légales) */
}

.animate-on-scroll { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.animate-on-scroll.animate-in { opacity: 1; transform: translateY(0); }
