/* Reset / global */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  background-color: #111;
  color: #ccc;
  overflow-x: hidden;
}
*, *::before, *::after { box-sizing: inherit; }

a { text-decoration: none; color: inherit; }

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* HEADER / NAV */
header,
.site-header,
.main-header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 999;
  background: linear-gradient(180deg,#0b0b0b 0%, #121212 100%);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: #fff;
}

header .container,
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  max-width: 100%;
}

/* Logo */
.logo {
  color: #38bdf8;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 1px;
  transition: color .18s, transform .12s;
  display: inline-block;
}
.logo:hover,
.logo:focus {
  color: #0ea5e9;
  transform: translateY(-2px);
}

/* Navigation */
.main-nav, .nav-menu {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.main-nav ul { display:flex; gap:18px; margin:0; padding:0; list-style:none; align-items:center; }

.nav-menu a,
.main-nav a,
header nav a {
  color: #d6d6d6;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all .25s ease;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
}
.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}
.nav-menu a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg,#38bdf8,#0ea5e9);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.nav-menu a:hover,
.nav-menu a.active {
  color: #38bdf8;
  transform: translateY(-2px);
  background: rgba(56,189,248,0.12);
}

/* Mobile burger */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1000;
}
.menu-toggle .bar {
  height: 3px;
  width: 100%;
  background: #38bdf8;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Header actions */
.header-actions,
.user-section,
.user-wrap {
  display:flex;
  gap:6px;
  align-items:center;
}

.search-bar,
.search-form {
  display:flex;
  gap:6px;
  align-items:center;
  background:#222;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.05);
}

.search-bar input,
.search-form input {
  background:transparent;
  border:none;
  color:#fff;
  padding:6px 8px;
  outline:none;
}

.search-bar button,
.search-form button {
  background:transparent;
  border:none;
  cursor:pointer;
}

.user-btn { background:transparent; border:none; color:#fff; display:flex; gap:8px; align-items:center; cursor:pointer; padding:6px 10px; border-radius:8px; }

/* User menu */
.user-menu {
  position: absolute;
  right: 16px;
  top: 56px;
  background:#0f1724;
  border:1px solid rgba(255,255,255,0.04);
  padding:8px;
  border-radius:10px;
  display:none;
  min-width:150px;
  box-shadow:0 8px 30px rgba(0,0,0,0.6);
  max-width: calc(100vw - 40px);
  overflow: auto;
}
.user-menu.open { display:block; }
.user-menu a { display:block; padding:8px 10px; color:#ddd; border-radius:6px; }
.user-menu a:hover { background: rgba(56,189,248,0.06); color:#fff; }

/* Buttons */
.btn { padding:8px 12px; border-radius:8px; font-weight:700; text-decoration:none; display:inline-block; }
.btn-primary { background:#38bdf8; color:#08121a; }
.btn-outline { background:transparent; border:1px solid rgba(255,255,255,0.06); color:#fff; }

/* Video grid & cards */
.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 40px 0;
    justify-items: center;
}
.video-card {
    width: 100%;
    max-width: 400px;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .3s, box-shadow .3s;
    cursor: pointer;
    height: 100%;
}
.video-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 28px rgba(56,189,248,0.5);
}
.video-card img,
.video-card video {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-bottom: 2px solid #38bdf8;
    display: block;
}
.video-info {
    flex:1;
    padding:12px 16px;
    display:flex;
    flex-direction: column;
    justify-content: space-between;
}
.video-title {
    font-size: 1.2rem;
    font-weight:700;
    color:#38bdf8;
    margin-bottom:6px;
}
.video-desc {
    font-size:1rem;
    color:#ccc;
    margin-bottom:10px;
}
.video-actions {
    display:flex;
    gap:8px;
}
.video-actions button {
    flex:1;
    padding:10px 0;
    font-weight:600;
    border:none;
    border-radius:8px;
    cursor:pointer;
    transition: all .25s;
    background: linear-gradient(90deg,#38bdf8 0%,#0ea5e9 100%);
    color:#fff;
}
.video-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(56,189,248,0.5);
}

/* Playlist thumbs */
.playlist-thumb {
    width: 140px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform .25s, box-shadow .25s;
}
.playlist-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}

/* Modal & Video.js */
#videoModal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 20px; }
#videoModal.open { display:flex; }
#playerBox { background:#121212; width:100%; max-width:980px; border-radius:12px; overflow:hidden; position:relative; box-shadow:0 12px 48px rgba(0,0,0,0.6); }
#modalVideo { width:100%; max-height:72vh; background:#000; display:block; }
.close-btn { position:absolute; right:12px; top:8px; background:transparent; border:none; color:#fff; font-size:1.6rem; padding:6px; cursor:pointer; z-index:10001; }

.video-js .vjs-control-bar { transition: opacity .3s; }
.video-js:hover .vjs-control-bar,
.video-js.vjs-user-active .vjs-control-bar { opacity: 1; }
.vjs-back10-button, .vjs-forward10-button {
    display:inline-flex; align-items:center; justify-content:center; font-size:13px; color:#fff;
    background:rgba(56,189,248,0.18); border-radius:4px; padding:4px 8px; margin:0 4px; cursor:pointer;
}
.vjs-back10-button:hover, .vjs-forward10-button:hover { background:rgba(56,189,248,0.35); transform:translateY(-1px); }
.vjs-skip-overlay { position:absolute; bottom:12px; left:12px; padding:8px 14px; background:rgba(0,0,0,0.55); color:#fff; border-radius:6px; cursor:pointer; z-index:9999; font-weight:700; }

/* Footer */
footer { background:#222; padding:20px 0; color:#fff; text-align:center; margin-top:auto; }
footer nav { display:flex; justify-content:center; gap:30px; margin-bottom:10px; }
footer nav a { color:#ccc; font-weight:700; transition:color .3s; }
footer nav a:hover { color:#38bdf8; }

/* Auth forms */
.auth-bg {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  overflow: hidden;
}
#bgCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
}
.auth-container {
  position: relative;
  z-index: 1;
  background: rgba(30,30,30,0.95);
  padding: 40px 32px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  width: 100%;
  max-width: 400px;
  color: #eee;
  text-align: center;
  overflow: hidden;
  animation: fadeIn .8s ease forwards;
}
.auth-container h1 { margin-bottom:24px; font-size:2rem; color:#38bdf8; }
.auth-form { display:flex; flex-direction:column; gap:16px; text-align:left; }
.auth-form label { font-weight:600; color:#fff; }
.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"] {
  padding: 12px 15px;
  border-radius: 12px;
  border: none;
  background: #333;
  color: #fff;
  font-size: 1em;
  outline: none;
  transition: all .3s;
}
.auth-form input:focus {
  background: #444;
  box-shadow: 0 0 12px #38bdf8;
  transform: scale(1.02);
}
.btn-user {
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(90deg,#38bdf8 0%,#0ea5e9 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1em;
  cursor: pointer;
  transition: all .3s;
}
.btn-user:hover { transform: scale(1.05); box-shadow: 0 8px 20px rgba(56,189,248,0.4); }

.forgot a { color: #38bdf8; font-weight: 600; display:inline-block; margin-top:12px; transition:color .3s; }
.forgot a:hover { color: #0ea5e9; }

@keyframes fadeIn {
  from { opacity:0; transform:translateY(-20px); }
  to { opacity:1; transform:translateY(0); }
}

/* Responsive mobile */
@media (max-width: 860px) {
    .menu-toggle { display: flex; }
    .nav-menu { display: none; flex-direction: column; width: 100%; background:#111; position:absolute; top:100%; left:0; padding:12px 0; border-top:1px solid rgba(255,255,255,0.1); gap:0; z-index:999; }
    .nav-menu.open { display:flex; }
    .nav-menu a { padding:12px 20px; font-size:1rem; border-bottom:1px solid rgba(56,189,248,0.1); }
    header .container { flex-wrap: wrap; justify-content: space-between; }
}
@media (max-width: 480px) {
    .search-bar { display:none; }
}
@media (max-width: 1024px) { .video-card { width: calc(50% - 12px); } }
@media (max-width: 768px) { .video-card { width: 100%; } }
@media (max-width: 480px) { .video-card video, .video-card img { height:140px; } .video-title { font-size:1rem; } .video-desc { font-size:0.85rem; } .video-actions button { font-size:0.85rem; padding:6px 0; } }
@media (min-width: 680px) { .video-grid { grid-template-columns: repeat(2, 1fr); } .video-card { max-width: 320px; } }
@media (min-width: 1024px) { .video-grid { grid-template-columns: repeat(3, 1fr); } .video-card { max-width: 320px; } }


/* USER AUTH BUTTONS (HEADER) */
.user-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-section img {
  width: 22px;
  height: 22px;
  opacity: 0.85;
}

/* Bouton connexion */
.btn-login {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #38bdf8;
  border: 1px solid rgba(56,189,248,0.5);
  background: transparent;
  transition: all 0.25s ease;
}

.btn-login:hover {
  background: rgba(56,189,248,0.15);
  box-shadow: 0 0 12px rgba(56,189,248,0.4);
  transform: translateY(-1px);
}

/* Bouton inscription (plus visible) */
.btn-register {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #08121a;
  background: linear-gradient(90deg,#38bdf8,#0ea5e9);
  box-shadow: 0 4px 14px rgba(56,189,248,0.45);
  transition: all 0.25s ease;
}

.btn-register:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 24px rgba(56,189,248,0.6);
}

/* Bouton déconnexion */
.btn-logout {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  color: #f87171;
  border: 1px solid rgba(248,113,113,0.5);
  background: transparent;
  transition: all 0.25s ease;
}

.btn-logout:hover {
  background: rgba(248,113,113,0.15);
  box-shadow: 0 0 12px rgba(248,113,113,0.4);
}
