/* ==========================================================================
   VKGames Hub — Design System & Theme Engine (OPTIMISED & WARM LIGHT MODE)
   ========================================================================== */

/* ===== 1. CSS VARIABLES (DAY / NIGHT) ===== */
:root {
  /* Fond neutre chaud — plus une goutte de blanc */
  --bg-1: #e2ddd4;       /* Gris-brun clair, comme du papier kraft */
  --bg-2: #e8e3db;       /* Cartes légèrement plus claires que le fond */
  --bg-3: #d5cfc5;       /* Hover / tertiaire — plus soutenu */
  --bg-hero: rgba(120, 80, 50, 0.04);

  /* Bordures ajustées */
  --border-1: rgba(80, 60, 30, 0.10);
  --border-2: rgba(80, 60, 30, 0.18);
  --border-accent: rgba(160, 70, 10, 0.28);

  /* Textes bien sombres pour un bon contraste */
  --text-1: #1a1612;     /* Presque noir, très lisible */
  --text-2: #3e3830;     /* Gris foncé chaud */
  --text-3: #6b6258;     /* Tertiaire lisible */

  /* Accent ambré qui reste chaud */
  --accent: #b45309;
  --accent-text: #92400e;
  --accent-bg: rgba(180, 83, 9, 0.10);
  --accent-bg-hover: rgba(180, 83, 9, 0.18);

  /* Navigation */
  --nav-bg: rgba(226, 221, 212, 0.94);

  /* Ombres & glow */
  --card-glow: rgba(160, 100, 40, 0.06);

  /* Squelettes */
  --skeleton-base: #d5cfc5;
  --skeleton-shine: rgba(240, 235, 225, 0.6);
  --img-placeholder-from: #d5cfc5;
  --img-placeholder-to: #c8c1b5;
}



/* Dark mode stays unchanged — already well balanced */
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.92);
  --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: #fff; }

::-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(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  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 {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.45s ease,
              box-shadow 0.45s ease;
  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 {
  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 {
  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 {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.4s ease,
              box-shadow 0.4s ease;
  overflow: hidden;
}

.article-card:hover {
  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: transform 0.3s ease, color 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: var(--accent);
  color: #ffffff;
  font-weight: 600;
  transition: filter 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
  border: none; cursor: pointer;
}
html.dark .btn-accent { color: #000000; }
.btn-accent:hover { filter: brightness(1.1); box-shadow: 0 0 28px -6px var(--accent-bg); }
.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: 600;
  transition: background 0.2s ease, box-shadow 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-text); }
.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: border-color 0.3s ease, color 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 var(--accent-bg); }
  50% { box-shadow: 0 0 12px var(--border-accent); }
}

.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: border-color 0.3s ease, color 0.3s ease, background 0.3s ease, box-shadow 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: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 4px 14px -4px rgba(180, 83, 9, 0.35);
}
html.dark .filter-btn.active { color: #000; 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: border-color 0.2s ease, color 0.2s ease;
}
.page-numbers.current { background: var(--accent); color: #fff; border-color: var(--accent); }
html.dark .page-numbers.current { color: #000; }
.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;
  will-change: transform;
}
@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: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.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;
  box-shadow: 0 12px 36px -8px rgba(0,0,0,0.1);
}
html.dark .toast { box-shadow: 0 12px 36px -8px rgba(0,0,0,0.5); }
.toast.show { bottom: 28px; opacity: 1; pointer-events: auto; }

.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-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: border-color 0.3s ease, box-shadow 0.3s ease; }
.auth-input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-bg-hover); }
.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: color 0.2s ease, background 0.2s ease; }
.dash-nav-link:hover { color: var(--accent-text); 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: color 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: color 0.2s ease, filter 0.2s ease; }
.dash-mobile-link.active { color: var(--accent-text); }
.dash-mobile-link.active span:first-child { filter: drop-shadow(0 4px 6px var(--accent-bg)); }

.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; }