/* ============================================================
   CodeFémina Academy — Design System
   Traduit depuis src/index.css + tailwind.config.ts du frontend
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Variables CSS (HSL, identiques au frontend React) ─────── */
:root {
  --background:          270 80%  7%;
  --foreground:            0  0% 100%;

  --card:                270 60% 10%;
  --card-foreground:       0  0% 100%;

  --popover:             270 60% 10%;
  --popover-foreground:    0  0% 100%;

  --primary:             262 65% 51%;
  --primary-foreground:    0  0% 100%;

  --secondary:           262 40% 30%;
  --secondary-foreground:  0  0% 100%;

  --muted:               270 30% 15%;
  --muted-foreground:    270 10% 60%;

  --accent:               38 92% 50%;
  --accent-foreground:     0  0%  5%;

  --destructive:           0 84% 60%;
  --destructive-foreground:0  0% 100%;

  --border:              270 30% 18%;
  --input:               270 30% 18%;
  --ring:                262 65% 51%;

  --radius:              0.75rem;

  --sidebar-background:  270 60%  8%;
  --sidebar-foreground:    0  0% 90%;
  --sidebar-primary:     262 65% 51%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent:      270 30% 15%;
  --sidebar-accent-foreground: 0 0% 90%;
  --sidebar-border:      270 30% 18%;
  --sidebar-ring:        262 65% 51%;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, hsl(262 65% 51%), hsl(280 60% 40%));
  --gradient-accent:  linear-gradient(135deg, hsl(38 92% 50%), hsl(30 90% 55%));
  --gradient-card:    linear-gradient(145deg, hsl(270 60% 12%), hsl(270 50% 8%));

  /* Shadows */
  --shadow-glow: 0 0 30px hsl(262 65% 51% / 0.2);
  --shadow-card: 0 4px 20px hsl(270 80% 5% / 0.5);
}

/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-color: hsl(var(--border));
}

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  line-height: 1.2;
}

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

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

/* ── Utilities ──────────────────────────────────────────────── */
.gradient-primary  { background: var(--gradient-primary); }
.gradient-accent   { background: var(--gradient-accent); }
.gradient-card     { background: var(--gradient-card); }

.shadow-glow { box-shadow: var(--shadow-glow); }
.shadow-card { box-shadow: var(--shadow-card); }

/* Glassmorphism — .glass */
.glass {
  background-color: hsl(var(--card) / 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid hsl(var(--border) / 0.5);
}

/* ── Layout container (identique au Tailwind container) ─────── */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: 2rem;
  padding-left: 2rem;
  max-width: 1400px;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px hsl(262 65% 51% / 0.3); }
  50%       { box-shadow: 0 0 40px hsl(262 65% 51% / 0.5); }
}
@keyframes accordion-down {
  from { height: 0; }
  to   { height: var(--radix-accordion-content-height); }
}
@keyframes accordion-up {
  from { height: var(--radix-accordion-content-height); }
  to   { height: 0; }
}

.animate-fade-in    { animation: fade-in 0.5s ease-out forwards; }
.animate-pulse-glow { animation: pulse-glow 3s ease-in-out infinite; }

/* ── HEADER / NAVBAR ─────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid hsl(var(--border) / 0.3);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem; /* h-16 */
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar__logo img {
  height: 2rem; /* h-8 */
}

/* Desktop nav */
.navbar__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.navbar__nav-link {
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
  color: hsl(var(--muted-foreground));
}

.navbar__nav-link:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--muted) / 0.5);
}

.navbar__nav-link--active {
  background: var(--gradient-accent);
  color: hsl(var(--accent-foreground));
}

/* Right actions */
.navbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar__credits {
  display: none;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  background-color: hsl(var(--muted));
  font-size: 0.875rem;
  transition: background-color 0.15s;
}
.navbar__credits:hover { background-color: hsl(var(--muted) / 0.8); }
.navbar__credits .icon { color: hsl(var(--accent)); }
.navbar__credits .count { color: hsl(var(--accent)); font-weight: 600; }

.navbar__btn {
  padding: 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  border: none;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  transition: color 0.15s, background-color 0.15s;
  position: relative;
}
.navbar__btn:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--muted) / 0.5);
}
.navbar__btn .notif-dot {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: hsl(var(--accent));
}

/* Profile dropdown */
.navbar__dropdown {
  position: relative;
}
.navbar__dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  width: 12rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border) / 0.5);
  padding: 0.25rem 0;
  box-shadow: var(--shadow-card);
  z-index: 50;
  display: none;
}
.navbar__dropdown-menu.is-open { display: block; }

.navbar__dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.15s, background-color 0.15s;
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}
.navbar__dropdown-item:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--muted) / 0.5);
}
.navbar__dropdown-item--danger { color: hsl(var(--destructive)); }

.navbar__dropdown-divider {
  border-top: 1px solid hsl(var(--border) / 0.3);
  margin: 0.25rem 0;
}

/* Mobile hamburger */
.navbar__hamburger {
  display: block; /* hidden on lg */
}

/* Mobile nav panel */
.navbar__mobile {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border-top: 1px solid hsl(var(--border) / 0.3);
}
.navbar__mobile.is-open { display: flex; }

/* ── FOOTER ──────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid hsl(var(--border) / 0.3);
  padding: 1.5rem 0;
  margin-top: auto;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.footer__links {
  display: flex;
  gap: 1.5rem;
}

.footer__links a {
  transition: color 0.15s;
}
.footer__links a:hover { color: hsl(var(--foreground)); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (min-width: 640px) {   /* sm */
  .navbar__credits { display: flex; }
}

@media (min-width: 1024px) {  /* lg */
  .navbar__nav        { display: flex; }
  .navbar__hamburger  { display: none; }
  .footer__inner      { flex-direction: row; }
}

@media (max-width: 1023px) {  /* < lg */
  .navbar__nav { display: none; }
}
