/* /public_html/assets/css/base.css */

/* ========== RESET MODERNE ========== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

img,
svg {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

/* ========== VARIABLES GLOBALES (ESPACEMENTS, RAYONS, ETC.) ========== */

:root {
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;

    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --radius-pill: 999px;

    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.35);
    --shadow-subtle: 0 8px 20px rgba(15, 23, 42, 0.25);

    --app-header-height: 64px;
    --app-navbar-h: var(--app-header-height);
    --app-navbar-h-mobile: var(--app-header-height);
}

@media (min-width: 768px) {
    :root {
        --app-header-height: 72px;
        --app-navbar-h: var(--app-header-height);
    }
}

@media (max-width: 768px) {
    :root {
        --app-header-height: 64px;
        --app-navbar-h-mobile: var(--app-header-height);
    }
}

/* ========== TYPO & BODY ========== */

/* Si Montserrat est chargé, on le privilégie */
body {
    min-height: 100vh;
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background-color: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

/* Pour pouvoir bloquer le scroll en cas de modal */
body.is-modal-open {
    overflow: hidden;
}

/* ========== STRUCTURE GÉNÉRALE ========== */

#app-root {
    padding-inline: var(--space-4);
    padding-top: calc(var(--app-header-height) + var(--space-4));
    padding-bottom: var(--space-6);
    max-width: 1200px;
    margin-inline: auto;
}

#app-root:has(#dashboard-view .panel-header-common){
  padding-top: var(--app-header-height);
}

/* ========== HEADER / NAVBAR ========== */

.app-header {
    position: fixed;
    inset-inline: 0;
    top: 0;
    min-height: var(--app-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: var(--space-3);
    gap: var(--space-2);
    background: color-mix(in srgb, var(--color-bg) 80%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border-subtle);
    z-index: 60;
}

.app-header-section {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.app-header-left {
    min-width: 0;
}

.app-header-nav {
    display: none; /* Affichée sur écrans plus larges */
}

.app-header-right {
    margin-left: auto;
}

/* ========== LOGO & MARQUE ========== */

/* Groupe logo + texte de marque dans le header */
.app-header-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-header-brand, var(--color-text));
    height: var(--app-header-height);
}

/* Conteneur du logo = pastille avec aura */
.app-logo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90%;
    border-radius: var(--radius-pill);
    overflow: visible; /* important : ne pas couper l’animation */
}

/* Aura colorée en fonction du thème */
.app-logo::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    z-index: -1;
    pointer-events: none;

    background:
        radial-gradient(circle at 25% 20%,
            color-mix(in srgb,
                var(--color-accent, #a855f7) 80%,
                transparent 20%
            ) 0,
            transparent 55%
        ),
        radial-gradient(circle at 75% 80%,
            color-mix(in srgb,
                var(--color-accent, #a855f7) 55%,
                #0f172a 10%
            ) 0,
            transparent 60%
        );

    opacity: 0;
    transform: scale(0.85);
    filter: blur(0);
    transition:
        opacity 220ms ease-out,
        transform 220ms ease-out,
        filter 220ms ease-out;
}

/* SVG inline du logo */
.app-logo svg {
    display: block;
    height: 100%;
    width: auto;
    max-height: 95%;
    transform-origin: center;
    transition:
        transform 0.18s ease,
        filter 0.25s ease-out,
        opacity 0.18s ease;
}

/* Glow discret du logo en mode light (très soft) */
html[data-theme="light"] .app-logo svg {
    filter: drop-shadow(0 0 3px rgba(148, 163, 184, 0.35));
}

/* Glow néon en mode dark */
html[data-theme="dark"] .app-logo svg {
    filter:
        drop-shadow(0 0 3px rgba(248, 250, 252, 0.55))  /* halo clair */
        drop-shadow(0 0 10px rgba(248, 113, 113, 0.65)) /* néon proche */
        drop-shadow(0 0 22px rgba(248, 113, 113, 0.45));/* néon diffus */
}

/* Petit bonus : survol = glow un peu plus fort */
html[data-theme="dark"] .app-logo:hover svg {
    filter:
        drop-shadow(0 0 6px rgba(248, 250, 252, 1.1))
        drop-shadow(0 0 20px rgba(248, 113, 113, 1.3))
        drop-shadow(0 0 44px rgba(248, 113, 113, 1.9));
    transform: translateY(-0px);
}

/* Bouton “brand” (texte du site) */
.app-brand-btn {
    border: none;
    background: transparent;
    color: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0;
    cursor: pointer;
    white-space: nowrap;
}

/* Span qui contient le texte de la marque */
.app-brand-label {
    display: inline;
}

/* ========== BOUTONS NAV PUBLICS & ICONES ========== */

.app-nav-btn {
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.app-nav-btn:hover {
    background-color: color-mix(in srgb, var(--color-surface) 80%, transparent);
    border-color: var(--color-border-subtle);
    color: var(--color-text);
}

/* Icon buttons */
.icon-btn {
    border: none;
    background: transparent;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    line-height: 1;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* === Bouton thème (clair / sombre / auto) : ICON-ONLY, fond transparent === */

.icon-btn[data-theme-toggle]{
    background: transparent !important;
    box-shadow: none !important;
    border: 0;
    padding: 0;                 /* pas de “pilule” visible */
    width: 40px;                /* zone de tap confortable */
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

/* Icône stable => rotation centrée */
.icon-btn[data-theme-toggle] i{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    line-height: 1;
    text-align: center;
    transform-origin: 50% 50%;
    will-change: transform;
}

/* Petit “squish” */
.icon-btn[data-theme-toggle]:active{
    transform: scale(0.9);
}

@keyframes themeToggleSpin{
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Animation déclenchée par JS (sur l’icône) */
.icon-btn[data-theme-toggle] i.is-theme-spinning{
    animation: themeToggleSpin 0.9s ease;
}

/* Hover : optionnel mais sympa (fond TRÈS léger, tu peux virer si tu veux 100% transparent) */
.icon-btn[data-theme-toggle]:hover{
    background-color: color-mix(in srgb, var(--color-surface) 80%, transparent);
    color: var(--color-text);
}

.icon-btn:hover {
    background-color: color-mix(in srgb, var(--color-surface) 80%, transparent);
    color: var(--color-text);
}

.icon-btn[data-profile-btn]{
  height: 44px;
  width: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn[data-profile-btn] .profile-icon,
.icon-btn[data-profile-btn] .profile-avatar{
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 999px;
}

/* Avatar : image propre */
.icon-btn[data-profile-btn] .profile-avatar{
  object-fit: cover;
}

/* SVG : outline “transparent” */
.icon-btn[data-profile-btn] .profile-icon{
  fill: none;
  stroke: color-mix(in srgb, var(--color-text) 75%, transparent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn[data-profile-btn]:hover .profile-icon{
  stroke: var(--color-text);
}

/* Navbar profile fallback: initials in a circle */
.profile-initials{
  width: 100%;
  height: 100%;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;

  /* couleurs calculées en JS via --avatar-h */
  --avatar-h: 220;
  --avatar-s: 78%;
  --avatar-l: 56%;

  background:
    radial-gradient(circle at 25% 20%,
      hsla(var(--avatar-h), var(--avatar-s), calc(var(--avatar-l) + 18%), 0.95) 0%,
      transparent 55%
    ),
    radial-gradient(circle at 80% 85%,
      hsla(calc(var(--avatar-h) + 40), var(--avatar-s), calc(var(--avatar-l) - 6%), 0.85) 0%,
      transparent 60%
    ),
    linear-gradient(135deg,
      hsla(var(--avatar-h), var(--avatar-s), var(--avatar-l), 0.85),
      hsla(calc(var(--avatar-h) + 55), var(--avatar-s), calc(var(--avatar-l) - 8%), 0.85)
    );

  color: var(--color-text);
  border: 1px solid color-mix(in srgb, var(--color-border-subtle) 75%, transparent);

  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 10px 24px rgba(15, 23, 42, 0.25);

  user-select: none;
}

.profile-initials.is-hidden{
  display: none !important;
}

/* Petit “gloss” en dark (ultra léger) */
html[data-theme="dark"] .profile-initials{
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 14px 34px rgba(15, 23, 42, 0.35);
}

/* Hover premium */
.icon-btn[data-profile-btn]:hover .profile-initials{
  transform: translateY(-0.5px);
  filter: saturate(1.06) contrast(1.03);
}
.icon-btn[data-profile-btn]:active .profile-initials{
  transform: scale(0.94);
}

/* ========== BOUTON CONNEXION ========== */

.app-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.6rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: transparent;
    color: var(--color-text);
    font-weight: 500;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.app-auth-btn:hover {
    background: rgba(148, 163, 184, 0.08);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

/* État CONNECTÉ : bouton plus “plein” */
.app-auth-btn[data-mode="logout"] {
    background: radial-gradient(circle at 0% 0%, #f97373, #e11d48);
    border-color: rgba(248, 113, 113, 0.85);
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(248, 113, 113, 0.45);
}

/* Hover en mode connecté */
.app-auth-btn[data-mode="logout"]:hover {
    box-shadow: 0 14px 32px rgba(248, 113, 113, 0.6);
    transform: translateY(-1px);
}

/* Icône du bouton d’auth */
.app-auth-icon {
    font-size: 1.1rem;
}

/* Mobile-first : on montre l’icône, on cache le texte */
.app-auth-label {
    display: none;
}

/* Profil = même base que Connexion, mais un poil plus compact visuellement */
.app-profile-btn {
    padding: 0.6rem 1.2rem;
}

/* Mobile : profil devient aussi une pastille (comme Connexion) */
@media (max-width: 768px) {
    .app-profile-btn {
        padding: 0.5rem;
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 999px;
        justify-content: center;
    }
}

/* ========== BOUTON PROFIL (icon-only, même hauteur que auth) ========== */

.app-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 40px;               /* même base que .app-auth-btn mobile */
    min-width: 40px;
    padding: 0 0.95rem;         /* donne l’effet “pill” */
    border-radius: 999px;

    border: 1px solid rgba(148, 163, 184, 0.6);
    background: transparent;
    color: var(--color-text);

    cursor: pointer;
    transition:
        background-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.app-profile-btn i {
    font-size: 1.15rem;         /* icône bien lisible */
    line-height: 1;
}

.app-profile-btn:hover {
    background: rgba(148, 163, 184, 0.08);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.app-profile-btn:active {
    transform: scale(0.96);
}

/* Desktop : même hauteur que le header / cohérent avec auth */
@media (min-width: 900px) {
    .app-profile-btn {
        height: 44px;           /* aligne visuellement avec .app-auth-btn desktop */
    }
}

/* Bouton profil = suit la hauteur de la navbar (≈90%) */
:root{
  --profile-avatar-scale: 0.85;
}

.icon-btn[data-profile-btn]{
  width: calc(var(--app-header-height) * var(--profile-avatar-scale));
  height: calc(var(--app-header-height) * var(--profile-avatar-scale));
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Le SVG remplit TOUT le bouton */
.icon-btn[data-profile-btn] .profile-icon{
  width: 100%;
  height: 100%;
  display: block;

  /* icône “transparente” : juste des traits */
  fill: none;
  stroke: color-mix(in srgb, var(--color-text) 75%, transparent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Hover / active clean */
.icon-btn[data-profile-btn]:hover{
  background: transparent;
}
.icon-btn[data-profile-btn]:hover .profile-icon{
  stroke: var(--color-text);
}
.icon-btn[data-profile-btn]:active{
  transform: scale(0.92);
}

/* ========== UTILITAIRES ========== */

.is-hidden {
    display: none !important;
}

/* ========== MEDIA QUERIES ========== */

/* Desktop : nav visible + texte sur le bouton d’auth */
@media (min-width: 900px) {
    .app-header-nav {
        display: flex;
    }

    .app-auth-label {
        display: inline;
    }

    .app-auth-btn {
        padding-inline: 1.6rem;
        width: auto;
        height: auto;
    }
}

/* Mobile & petites tablettes */
@media (max-width: 768px) {
    /* Logo un peu plus petit mais toujours visible */
    .app-logo svg {
        height: 50px;
    }

    .app-header-brand {
        gap: 0.5rem;
    }

    /* On cache le texte de la marque sur mobile */
    .app-brand-label {
        display: none;
    }

    /* Bouton auth = pastille ronde icône seule */
    .app-auth-btn {
        padding: 0.5rem;
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 999px;
        justify-content: center;
    }

    /* Hard override implicite : texte d’auth masqué sur mobile
       (déjà display:none par défaut, donc pas besoin de !important) */
}

/* Fix Bootstrap Icons (ne jamais hériter d'une autre font) */
.bi {
  font-family: "bootstrap-icons" !important;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
}