/* ============================================================
   METANOVA DESIGN SYSTEM v1.1
   Tokens, base styles, header/footer/drawer components
   ============================================================ */

/* ─── CSS Custom Properties ─── */
:root {
    /* Background & Surface */
    --ds-bg-app:    #0D0D0D;
    --ds-surface-1: #141414;
    --ds-surface-2: #1E1E1E;
    --ds-surface-3: #252525;

    /* Emeraude — Accent Primaire */
    --ds-emeraude:      #00C896;
    --ds-emeraude-deep: #00A37A;
    --ds-emeraude-dim:  #0A3D2E;
    --ds-emeraude-bg:   #051F17;

    /* Or Chaud — Accent Secondaire */
    --ds-or:       #F5A623;
    --ds-or-clair: #FFD580;
    --ds-or-deep:  #C7861A;
    --ds-or-bg:    #4A3210;

    /* Texte */
    --ds-text-primary:   #F5F5F0;
    --ds-text-secondary: #9A9A8F;
    --ds-text-tertiary:  #5A5A52;
    --ds-text-disabled:  #3A3A34;

    /* États sémantiques */
    --ds-success: #00C896;
    --ds-error:   #FF4D4D;
    --ds-warning: #F59E0B;
    --ds-info:    #3B82F6;

    /* Typographie */
    --ds-font-primary:   'Plus Jakarta Sans', system-ui, sans-serif;
    --ds-font-secondary: 'Inter', system-ui, sans-serif;

    /* Espacement — base 4px */
    --ds-space-1:  4px;
    --ds-space-2:  8px;
    --ds-space-3:  12px;
    --ds-space-4:  16px;
    --ds-space-5:  20px;
    --ds-space-6:  24px;
    --ds-space-8:  32px;
    --ds-space-12: 48px;
    --ds-space-16: 64px;

    /* Border Radius */
    --ds-radius-sm:   6px;
    --ds-radius-md:   10px;
    --ds-radius-lg:   16px;
    --ds-radius-xl:   24px;
    --ds-radius-full: 9999px;

    /* Transitions */
    --ds-transition-fast:   150ms ease-out;
    --ds-transition-normal: 280ms ease-out;

    /* Z-index */
    --ds-z-header:  100;
    --ds-z-overlay: 150;
    --ds-z-drawer:  200;
    --ds-z-toast:   300;
}

/* ─── Base Reset ─── */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    background-color: var(--ds-bg-app);
    color: var(--ds-text-primary);
    font-family: var(--ds-font-secondary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
}

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

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

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    line-height: inherit;
}

ul, ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ─── SITE HEADER ─── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--ds-z-header);
    background-color: var(--ds-surface-1);
    border-bottom: 1px solid var(--ds-surface-3);
    height: 60px;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--ds-space-4);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--ds-space-2);
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo img {
    height: 34px;
    width: auto;
}

.header-logo-text {
    font-family: var(--ds-font-primary);
    font-weight: 700;
    font-size: 16px;
    color: var(--ds-text-primary);
    letter-spacing: -0.3px;
    white-space: nowrap;
}

/* ─── HAMBURGER BUTTON ─── */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    border-radius: var(--ds-radius-md);
    background: transparent;
    padding: 0;
    transition: background var(--ds-transition-fast);
    flex-shrink: 0;
}

.hamburger-btn:hover {
    background: var(--ds-surface-2);
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--ds-text-primary);
    border-radius: 2px;
    transition: transform var(--ds-transition-fast), opacity var(--ds-transition-fast);
    transform-origin: center;
}

.hamburger-btn.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.is-active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger-btn.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ─── DRAWER OVERLAY ─── */
.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--ds-z-overlay);
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ds-transition-normal);
}

.drawer-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* ─── NAV DRAWER ─── */
.nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(300px, 88vw);
    z-index: var(--ds-z-drawer);
    background-color: var(--ds-surface-1);
    border-left: 1px solid var(--ds-surface-3);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--ds-transition-normal);
    overflow: hidden;
}

.nav-drawer.is-active {
    transform: translateX(0);
}

/* Drawer Top Bar */
.drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--ds-space-4);
    min-height: 60px;
    border-bottom: 1px solid var(--ds-surface-3);
    flex-shrink: 0;
}

.drawer-brand {
    font-family: var(--ds-font-primary);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    color: var(--ds-text-primary);
}

.drawer-brand em {
    color: var(--ds-emeraude);
    font-style: normal;
}

.drawer-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface-2);
    color: var(--ds-text-secondary);
    transition: background var(--ds-transition-fast), color var(--ds-transition-fast);
    flex-shrink: 0;
}

.drawer-close-btn:hover {
    background: var(--ds-surface-3);
    color: var(--ds-text-primary);
}

/* Drawer Nav Scroll Area */
.drawer-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--ds-space-2) 0;
    scrollbar-width: none;
}
.drawer-nav::-webkit-scrollbar { display: none; }

/* ─── DRAWER ITEM ─── */
.drawer-item {
    position: relative;
}

.drawer-item + .drawer-item {
    border-top: 1px solid var(--ds-surface-3);
}

/* Row: link + expand toggle */
.drawer-item-row {
    display: flex;
    align-items: center;
    min-height: 52px;
}

.drawer-item-link {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    flex: 1;
    padding: var(--ds-space-3) var(--ds-space-4);
    font-family: var(--ds-font-primary);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ds-text-secondary);
    text-decoration: none;
    transition: color var(--ds-transition-fast), background var(--ds-transition-fast);
    min-height: 52px;
}

.drawer-item-link:hover {
    color: var(--ds-text-primary);
    background: var(--ds-surface-2);
}

.drawer-item-link.is-active {
    color: var(--ds-emeraude);
}

.drawer-item-link i.ph,
.drawer-item-link .ph {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}

.drawer-item-label {
    flex: 1;
}

/* Coming Soon badge inline with label */
.drawer-coming-soon-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-or-bg);
    color: var(--ds-or);
    font-family: var(--ds-font-primary);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-left: auto;
}

/* Expand toggle button */
.drawer-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 52px;
    background: none;
    border: none;
    border-left: 1px solid var(--ds-surface-3);
    color: var(--ds-text-tertiary);
    cursor: pointer;
    transition: color var(--ds-transition-fast), background var(--ds-transition-fast);
    flex-shrink: 0;
}

.drawer-expand-btn:hover {
    color: var(--ds-text-primary);
    background: var(--ds-surface-2);
}

.drawer-expand-btn svg {
    transition: transform var(--ds-transition-fast);
    flex-shrink: 0;
}

.drawer-expand-btn.is-expanded {
    color: var(--ds-emeraude);
}

.drawer-expand-btn.is-expanded svg {
    transform: rotate(180deg);
}

/* ─── SUBMENU ─── */
.drawer-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--ds-transition-normal);
    background: var(--ds-bg-app);
}

.drawer-submenu.is-open {
    max-height: 500px;
}

.drawer-submenu-link {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    padding: var(--ds-space-3) var(--ds-space-4) var(--ds-space-3) calc(var(--ds-space-4) + 18px + var(--ds-space-3));
    font-family: var(--ds-font-secondary);
    font-weight: 500;
    font-size: 14px;
    color: var(--ds-text-secondary);
    text-decoration: none;
    border-top: 1px solid var(--ds-surface-2);
    transition: color var(--ds-transition-fast), background var(--ds-transition-fast);
    min-height: 44px;
}

.drawer-submenu-link:first-child {
    border-top: 1px solid var(--ds-surface-3);
}

.drawer-submenu-link:hover {
    color: var(--ds-text-primary);
    background: var(--ds-surface-2);
}

.drawer-submenu-link i.ph,
.drawer-submenu-link .ph {
    font-size: 16px;
    flex-shrink: 0;
    color: var(--ds-text-tertiary);
}

/* Disabled (coming soon) submenu row */
.drawer-submenu-disabled {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--ds-space-3) var(--ds-space-4) var(--ds-space-3) calc(var(--ds-space-4) + 18px + var(--ds-space-3));
    border-top: 1px solid var(--ds-surface-2);
    min-height: 44px;
    gap: var(--ds-space-2);
}

.drawer-submenu-disabled:first-child {
    border-top: 1px solid var(--ds-surface-3);
}

.drawer-submenu-disabled-label {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    font-family: var(--ds-font-secondary);
    font-weight: 500;
    font-size: 14px;
    color: var(--ds-text-disabled);
}

.drawer-submenu-disabled-label i.ph,
.drawer-submenu-disabled-label .ph {
    font-size: 16px;
    flex-shrink: 0;
}

/* ─── DRAWER FOOTER (user info) ─── */
.drawer-footer {
    flex-shrink: 0;
    padding: var(--ds-space-4);
    border-top: 1px solid var(--ds-surface-3);
}

.drawer-user {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    padding: var(--ds-space-3);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface-2);
}

.drawer-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-emeraude-dim);
    border: 1.5px solid var(--ds-emeraude);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ds-font-primary);
    font-weight: 700;
    font-size: 14px;
    color: var(--ds-emeraude);
    flex-shrink: 0;
}

.drawer-user-info {
    overflow: hidden;
    flex: 1;
}

.drawer-user-name {
    font-family: var(--ds-font-secondary);
    font-size: 14px;
    font-weight: 500;
    color: var(--ds-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-user-email {
    font-size: 12px;
    color: var(--ds-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── BODY OFFSET FOR FIXED HEADER ─── */
body .site-content,
.site-content {
    padding-top: 60px;
}

/* ─── SITE FOOTER ─── */
.site-footer {
    background-color: var(--ds-surface-1);
    border-top: 1px solid var(--ds-surface-3);
    padding: var(--ds-space-8) var(--ds-space-4) var(--ds-space-6);
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--ds-space-5);
}

/* Social Icons */
.footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-3);
    flex-wrap: wrap;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-surface-2);
    color: var(--ds-text-secondary);
    border: 1px solid var(--ds-surface-3);
    transition: background var(--ds-transition-fast), color var(--ds-transition-fast), transform var(--ds-transition-fast), border-color var(--ds-transition-fast);
    text-decoration: none;
}

.footer-social-link:hover {
    background: var(--ds-emeraude-dim);
    color: var(--ds-emeraude);
    border-color: var(--ds-emeraude-dim);
    transform: translateY(-2px);
}

.footer-social-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Footer Links */
.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-3);
    flex-wrap: wrap;
}

.footer-nav-link {
    font-family: var(--ds-font-secondary);
    font-size: 13px;
    color: var(--ds-text-secondary);
    text-decoration: none;
    transition: color var(--ds-transition-fast);
    white-space: nowrap;
}

.footer-nav-link:hover {
    color: var(--ds-emeraude);
}

.footer-sep {
    color: var(--ds-surface-3);
    font-size: 16px;
    user-select: none;
}

/* Copyright */
.footer-copyright {
    font-family: var(--ds-font-secondary);
    font-size: 12px;
    color: var(--ds-text-tertiary);
    text-align: center;
}

/* ─── COMING SOON PAGE ─── */
.coming-soon-wrap {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ds-space-8) var(--ds-space-4);
}

.coming-soon-card {
    max-width: 440px;
    width: 100%;
    background: var(--ds-surface-1);
    border: 1px solid var(--ds-surface-3);
    border-radius: var(--ds-radius-lg);
    padding: var(--ds-space-8) var(--ds-space-6);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.coming-soon-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ds-emeraude), transparent);
}

.coming-soon-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-emeraude-dim);
    border: 1.5px solid var(--ds-emeraude);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--ds-space-6);
    font-size: 30px;
    color: var(--ds-emeraude);
}

.coming-soon-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: var(--ds-radius-full);
    background: var(--ds-or-bg);
    color: var(--ds-or);
    font-family: var(--ds-font-primary);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: var(--ds-space-5);
}

.coming-soon-title {
    font-family: var(--ds-font-primary);
    font-weight: 700;
    font-size: 24px;
    color: var(--ds-text-primary);
    margin-bottom: var(--ds-space-3);
    line-height: 1.2;
}

.coming-soon-desc {
    font-family: var(--ds-font-secondary);
    font-size: 15px;
    color: var(--ds-text-secondary);
    line-height: 1.65;
    margin-bottom: var(--ds-space-6);
}

.coming-soon-back {
    display: inline-flex;
    align-items: center;
    gap: var(--ds-space-2);
    padding: 0 var(--ds-space-5);
    height: 44px;
    border-radius: var(--ds-radius-xl);
    background: var(--ds-surface-2);
    border: 1px solid var(--ds-surface-3);
    color: var(--ds-text-secondary);
    font-family: var(--ds-font-primary);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: all var(--ds-transition-fast);
}

.coming-soon-back:hover {
    background: var(--ds-surface-3);
    color: var(--ds-text-primary);
    border-color: var(--ds-text-tertiary);
}

/* ─── UTILITY CLASSES ─── */
.ds-text-emeraude   { color: var(--ds-emeraude); }
.ds-text-secondary  { color: var(--ds-text-secondary); }
.ds-text-primary    { color: var(--ds-text-primary); }
.ds-font-primary    { font-family: var(--ds-font-primary); }
.ds-font-secondary  { font-family: var(--ds-font-secondary); }

/* ─── BTN COMPONENTS ─── */
.ds-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-2);
    height: 52px;
    padding: 0 var(--ds-space-6);
    border-radius: var(--ds-radius-xl);
    background: var(--ds-emeraude);
    color: #0D0D0D;
    font-family: var(--ds-font-primary);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.3px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background var(--ds-transition-fast), transform var(--ds-transition-fast);
    width: 100%;
}

.ds-btn-primary:hover {
    background: var(--ds-emeraude-deep);
    transform: translateY(-1px);
}

.ds-btn-primary:active {
    transform: scale(0.97);
}

.ds-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-2);
    height: 48px;
    padding: 0 var(--ds-space-5);
    border-radius: var(--ds-radius-xl);
    background: transparent;
    color: var(--ds-emeraude);
    border: 1.5px solid var(--ds-emeraude);
    font-family: var(--ds-font-primary);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--ds-transition-fast), color var(--ds-transition-fast);
}

.ds-btn-secondary:hover {
    background: var(--ds-emeraude-dim);
}

/* ─── SKELETON LOADING ─── */
@keyframes ds-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.ds-skeleton {
    background: linear-gradient(
        90deg,
        var(--ds-surface-2) 25%,
        var(--ds-surface-3) 50%,
        var(--ds-surface-2) 75%
    );
    background-size: 200% 100%;
    animation: ds-shimmer 1.5s infinite;
    border-radius: var(--ds-radius-sm);
}

/* ─── TOAST ─── */
.ds-toast {
    position: fixed;
    bottom: calc(var(--ds-space-4) + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: var(--ds-z-toast);
    background: var(--ds-surface-2);
    border: 1px solid var(--ds-surface-3);
    border-radius: var(--ds-radius-lg);
    padding: var(--ds-space-3) var(--ds-space-5);
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    font-family: var(--ds-font-secondary);
    font-size: 14px;
    color: var(--ds-text-primary);
    opacity: 0;
    transition: opacity var(--ds-transition-fast), transform var(--ds-transition-fast);
    white-space: nowrap;
    max-width: calc(100vw - 32px);
}

.ds-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ds-toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.ds-toast--success { border-color: var(--ds-emeraude-dim); }
.ds-toast--success .ds-toast-icon { color: var(--ds-emeraude); }
.ds-toast--error   { border-color: rgba(255,77,77,0.3); }
.ds-toast--error   .ds-toast-icon { color: var(--ds-error); }
