/* ==========================================================================
   VKGames Hub — Design System & Theme Engine
   ========================================================================== */

/* ===== 1. CSS VARIABLES (JOUR/NUIT) ===== */
:root {
    --bg-1: #f7f5f0; --bg-2: #ffffff; --bg-3: #f0eeea;
    --bg-hero: rgba(255, 163, 1, 0.05);
    --border-1: rgba(0,0,0,0.06); --border-2: rgba(0,0,0,0.10); --border-accent: rgba(255,163,1,0.35);
    --text-1: #1a1a20; --text-2: #4a4a55; --text-3: #7a7a85;
    --accent: #ffa301; --accent-text: #c87d00;
    --accent-bg: rgba(255,163,1,0.08); --accent-bg-hover: rgba(255,163,1,0.15);
    --nav-bg: rgba(247,245,240,0.85); --card-glow: rgba(255,163,1,0.05);
    --skeleton-base: #e5e2db; --skeleton-shine: rgba(255,255,255,0.6);
    --img-placeholder-from: #ece9e3; --img-placeholder-to: #e0ddd6;
}

html.dark {
    --bg-1: #12121a; --bg-2: #1a1a26; --bg-3: #22222e;
    --bg-hero: rgba(255,163,1,0.04);
    --border-1: rgba(255,255,255,0.05); --border-2: rgba(255,255,255,0.10); --border-accent: rgba(255,163,1,0.30);
    --text-1: #eeeef4; --text-2: #9a9aa6; --text-3: #6a6a78;
    --accent: #ffa301; --accent-text: #ffa301;
    --accent-bg: rgba(255,163,1,0.08); --accent-bg-hover: rgba(255,163,1,0.16);
    --nav-bg: rgba(18,18,26,0.85); --card-glow: rgba(255,163,1,0.07);
    --skeleton-base: #22222e; --skeleton-shine: rgba(255,255,255,0.03);
    --img-placeholder-from: #1e1e2a; --img-placeholder-to: #16161f;
}

/* ===== 2. GLOBAL RESET & BASE ===== */
body {
    background-color: var(--bg-1);
    color: var(--text-1);
    font-family: 'Inter', sans-serif;
    transition: background-color 0.5s ease, color 0.5s ease;
    -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #000; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
a { color: inherit; text-decoration: none; }

/* ===== 3. LAYOUT COMPONENTS ===== */
.nav-bar {
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border-1);
    transition: background 0.5s ease;
}
.hero-glow {
    background: radial-gradient(ellipse 80% 55% at 50% 40%, var(--bg-hero) 0%, transparent 70%);
    pointer-events: none;
}
.grid-pattern {
    background-image:
        linear-gradient(var(--border-1) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-1) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
    pointer-events: none;
}
.section-line {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border-2) 50%, transparent 100%);
}

/* ===== 4. CARDS SYSTEM ===== */

/* subdomain-card : pages hub avec lift effect */
.subdomain-card {
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.subdomain-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-bg) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
    pointer-events: none;
}
.subdomain-card:hover {
    background: var(--bg-3);
    border-color: var(--border-accent);
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 24px 56px -14px var(--card-glow);
    z-index: 2;
}
.subdomain-card:hover::before { opacity: 1; }

/* dash-card : dashboard sans lift */
.dash-card {
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    transition: border-color 0.3s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.dash-card:hover {
    border-color: var(--border-accent);
    background: var(--bg-3);
}

/* article-card */
.article-card {
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.article-card:hover {
    background: var(--bg-3);
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px -8px var(--card-glow);
}
.article-card:hover .article-thumb  { transform: scale(1.06); }
.article-card:hover .article-arrow  { transform: translateX(3px); color: var(--accent); }
.article-thumb { transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.article-arrow { transition: all 0.3s ease; color: var(--text-3); }
.thumb-placeholder {
    background: linear-gradient(135deg, var(--img-placeholder-from) 0%, var(--img-placeholder-to) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
}

/* ===== 5. UI ELEMENTS ===== */
.btn-accent {
    background: #ffa301;
    color: #000;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}
.btn-accent:hover  { background: #ffb536; box-shadow: 0 0 28px -6px rgba(255,163,1,0.5); }
.btn-accent:active { transform: scale(0.97); }

.btn-ghost {
    background: var(--accent-bg);
    border: 1px solid var(--border-accent);
    color: var(--accent-text);
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}
.btn-ghost:hover { background: var(--accent-bg-hover); box-shadow: 0 0 18px -6px var(--card-glow); }

.nav-link {
    position: relative;
    color: var(--text-2);
    transition: color 0.3s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--accent);
    transition: width 0.3s ease;
}
.nav-link:hover           { color: var(--accent); }
.nav-link:hover::after    { width: 100%; }

.cat-tag {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 6px;
    display: inline-block;
    line-height: 1.4;
}

.theme-btn {
    background: var(--bg-3);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    transition: all 0.3s ease;
    cursor: pointer;
}
.theme-btn:hover { border-color: var(--border-accent); color: var(--accent); }

.live-dot { animation: livePulse 2s ease-in-out infinite; }
@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 4px rgba(255,163,1,0.3); }
    50%       { box-shadow: 0 0 12px rgba(255,163,1,0.6); }
}

.filter-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 9999px;
    border: 1px solid var(--border-1);
    background: var(--bg-2);
    color: var(--text-3);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}
.filter-btn:hover  { border-color: var(--border-accent); color: var(--accent-text); background: var(--accent-bg); }
.filter-btn.active { background: #ffa301; color: #000; border-color: #ffa301; box-shadow: 0 4px 14px -4px rgba(255,163,1,0.4); }

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border-1);
    background: var(--bg-2);
    color: var(--text-2);
    transition: all 0.2s ease;
}
.page-numbers.current { background: #ffa301; color: #000; border-color: #ffa301; }
.page-numbers:hover   { border-color: var(--accent); color: var(--accent-text); }

/* ===== 6. LOADING STATES ===== */
.skeleton {
    background-color: var(--skeleton-base);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}
.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, var(--skeleton-shine) 50%, transparent 100%);
    animation: shimmer 1.8s ease-in-out infinite;
    pointer-events: none;
}
@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.error-card {
    background: var(--bg-2);
    border: 1px dashed var(--border-2);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

/* ===== 7. ANIMATIONS ===== */
.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: all 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Toast */
.toast {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-2);
    border: 1px solid var(--border-accent);
    color: var(--text-1);
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
    opacity: 0;
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 36px -8px rgba(0,0,0,0.4);
    pointer-events: none;
}
.toast.show { bottom: 28px; opacity: 1; pointer-events: auto; }

/* Clamp utilities */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== 8. SINGLE POST TYPOGRAPHY ===== */
.entry-content { font-size: 1.05rem; line-height: 1.8; }
.entry-content h2,
.entry-content h3,
.entry-content h4 { color: var(--text-1); margin-top: 2.5em; margin-bottom: 0.8em; font-weight: 700; }
.entry-content h2  { font-size: 1.8rem; }
.entry-content h3  { font-size: 1.4rem; }
.entry-content p   { margin-bottom: 1.5em; }
.entry-content a   { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; transition: color 0.2s ease; }
.entry-content a:hover { color: var(--accent); }
.entry-content img { border-radius: 1rem; margin: 2em 0; }
.entry-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 1em 1.5em;
    margin: 2em 0;
    background: var(--accent-bg);
    border-radius: 0 0.75rem 0.75rem 0;
    font-style: italic;
    color: var(--text-2);
}
.entry-content ul,
.entry-content ol  { margin-bottom: 1.5em; padding-left: 1.5em; }
.entry-content li  { margin-bottom: 0.5em; }
.entry-content code {
    background: var(--bg-3);
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent-text);
}
.entry-content pre {
    background: var(--bg-3);
    padding: 1.5em;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 2em 0;
    border: 1px solid var(--border-1);
}
.entry-content pre code { background: transparent; padding: 0; }

/* Mobile menu nav links */
#mobile-menu .nav-link { font-size: 1.5rem; font-weight: 500; color: var(--text-1); display: block; padding: 0.5rem 0; }
footer .menu-item { margin-bottom: 0.75rem; }

/* ===== 9. AUTH FORM INPUTS ===== */
.auth-input { transition: all 0.3s ease; }
.auth-input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(255,163,1,0.15); }
.auth-input::placeholder { color: var(--text-3); opacity: 0.6; }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-1);
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-3) inset;
    transition: background-color 5000s ease-in-out 0s;
}
.toggle-password { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }

/* ===== 10. DASHBOARD ===== */
.dash-nav-link { color: var(--text-2); transition: all 0.2s ease; }
.dash-nav-link:hover  { color: var(--accent); background: var(--accent-bg); }
.dash-nav-link.active { color: var(--accent-text); background: var(--accent-bg); font-weight: 700; }

.dash-tab { color: var(--text-3); position: relative; cursor: pointer; transition: all 0.3s ease; }
.dash-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
    border-radius: 2px;
}
.dash-tab.active       { color: var(--text-1); }
.dash-tab.active::after { width: 100%; }
.dash-tab:hover        { color: var(--text-1); }

.dash-mobile-link { color: var(--text-3); transition: all 0.2s ease; }
.dash-mobile-link.active { color: var(--accent); }
.dash-mobile-link.active span:first-child { filter: drop-shadow(0 4px 6px rgba(255,163,1,0.4)); }

.lg\:col-span-1 { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
.lg\:col-span-1::-webkit-scrollbar       { width: 4px; }
.lg\:col-span-1::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }