/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

/* Custom Doctor Who Streaming Style */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #060d17;
  color: #ffffff;
  line-height: 1.6;
}

header {
  background-color: rgba(0, 59, 111, 0.9); /* TARDIS Blue */
  padding: 0.8rem 2rem;
  height: 70px;
  box-sizing: border-box;
  position: fixed; /* Changement de sticky à fixed pour éviter le trou noir */
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  transition: transform 0.5s ease, opacity 0.5s ease;
}

header.home-header {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

header.header-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  letter-spacing: 2px;
  color: #00a8e8;
  text-shadow: 0 0 10px rgba(0,168,232,0.5);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative; /* Pour positionner le dropdown par rapport à cette section */
}

.nav-series-btn {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(0, 168, 232, 0.3);
  border-radius: 5px;
  transition: all 0.3s;
  background: rgba(0, 168, 232, 0.1);
}

.nav-series-btn:hover {
  background: rgba(0, 168, 232, 0.3);
  color: #00a8e8;
  border-color: #00a8e8;
}

.search-bar-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
}

.nav-right {
  display: flex;
  align-items: center;
}

/* User Account Menu */
.user-menu {
  position: relative;
  margin-left: 1.5rem;
}

.user-btn {
  background: rgba(0, 168, 232, 0.1);
  border: 1px solid rgba(0, 168, 232, 0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  transition: all 0.3s;
}

.user-btn:hover {
  background: rgba(0, 168, 232, 0.2);
  border-color: #00a8e8;
}

.user-dropdown {
  position: absolute;
  top: 110%;
  right: 0;
  background: #0d1b2a;
  border: 1px solid rgba(0, 168, 232, 0.3);
  border-radius: 12px;
  min-width: 180px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: none;
  z-index: 1100;
  overflow: hidden;
  animation: slideDownFade 0.3s ease;
}

.user-menu:hover .user-dropdown {
  display: block;
}

.dropdown-item {
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: rgba(0, 168, 232, 0.15);
  color: #00a8e8;
}

.dropdown-item i {
  width: 16px;
  text-align: center;
  font-size: 1rem;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 5px 0;
}

.dropdown-item.logout {
  color: #ff4444;
}

.dropdown-item.logout:hover {
  background: rgba(255, 68, 68, 0.1);
  color: #ff6666;
}

.dropdown-item.admin-link {
  color: #ffcc00;
}

.dropdown-item.admin-link:hover {
  background: rgba(255, 204, 0, 0.1);
}

.nav-links {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

.nav-links li {
  margin-left: 1.5rem;
}

.nav-links li a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links li a:hover {
  color: #00a8e8;
}

.search-bar input {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: none;
  background: #1a2a3a;
  color: white;
  width: 200px;
  transition: width 0.3s;
}

.search-bar input:focus {
  width: 250px;
  outline: none;
  box-shadow: 0 0 10px rgba(0, 168, 232, 0.3);
}

/* Hero Section */
.hero {
  height: 100vh;
  margin-top: 0; /* Assure que le hero commence en haut */
  background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://images.unsplash.com/photo-1446776811953-b23d57bd21aa?q=80&w=1200');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Padding pour compenser le header fixed sur les autres pages */
body:not(:has(.home-header)) .content-section,
body:not(:has(.home-header)) main:not(.hero) {
    padding-top: 70px;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.btn-primary {
  background-color: #00a8e8;
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.btn-primary:hover {
  background-color: #007bb0;
  transform: scale(1.05);
}

/* Series Ribbon Styles */
.series-ribbon {
  background-color: #0d1b2a;
  border-bottom: 2px solid #00a8e8;
  padding: 0;
  display: flex;
  justify-content: center;
  position: sticky;
  top: 70px; /* Ajustez selon la hauteur du header */
  left: 0;
  width: 100%;
  z-index: 999;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  max-height: 0;
  overflow: visible;
  transition: all 0.4s ease;
  pointer-events: none;
  opacity: 0;
}

.series-ribbon.active {
  max-height: 60px;
  opacity: 1;
  pointer-events: auto;
}

.ribbon-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.ribbon-item {
  position: relative;
}

.ribbon-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s;
  padding: 1rem 1.5rem;
  display: block;
  white-space: nowrap;
}

.ribbon-link:hover {
  background: rgba(0, 168, 232, 0.2);
  color: #00a8e8;
}

.seasons-flyout {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #0d1b2a;
  border: 1px solid rgba(0, 168, 232, 0.3);
  border-top: none;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  display: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  z-index: 1200;
  min-width: 160px;
  animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.has-seasons-flyout:hover .seasons-flyout {
  display: block;
}

.seasons-flyout li a {
  display: block;
  padding: 0.7rem 1.2rem;
  color: white;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s;
  text-align: center;
}

.seasons-flyout li a:hover {
  background-color: #00a8e8;
  color: #060d17;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduire l'espace header */
header {
  /* Les styles sont déjà définis au début du fichier */
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.video-card {
  background: #112233;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s, border-color 0.4s;
  cursor: pointer;
  border: 1px solid rgba(0, 168, 232, 0.1);
  opacity: 0;
}

.video-card:hover {
  transform: translateY(-5px);
  border-color: #00a8e8;
}

.thumbnail {
  height: 140px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.thumbnail::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 59, 111, 0.2);
  transition: background 0.3s;
}

.video-card:hover .thumbnail::after {
  background: rgba(0, 59, 111, 0);
}

.play-icon {
  font-size: 3rem;
  opacity: 0;
  transition: opacity 0.3s;
  color: rgba(255, 255, 255, 0.8);
}

.video-card:hover .play-icon {
  opacity: 1;
}

.card-content {
  padding: 1rem;
}

.video-card h3 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #aaa;
}

.episode-info-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
}

.badge {
  background: rgba(0, 168, 232, 0.8);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
}

/* Player Modal */
.player-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease-out;
}

.player-container {
  width: 90%;
  max-width: 1000px;
  background: #0d1b2a;
  padding: 2rem;
  border-radius: 15px;
  position: relative;
  box-shadow: 0 0 30px rgba(0, 168, 232, 0.3);
  animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.player-controls-overlay {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #00a8e8;
  font-weight: bold;
}

.control-group select {
  background: #1b263b;
  color: white;
  border: 1px solid #415a77;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* Series Selector & Dropdown */
.series-selector {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-bottom: 4rem;
  width: 95%; /* Réduit légèrement pour voir les bordures */
  max-width: 1400px; /* Limite pour les très grands écrans */
  margin-left: auto;
  margin-right: auto;
}

.series-btn-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  background: rgba(0, 59, 111, 0.1);
  padding: 2.5rem;
  border-radius: 15px; /* Redonne des bords arrondis */
  border: 1px solid rgba(0, 168, 232, 0.2);
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
}

.series-btn-container:hover {
  background: rgba(0, 59, 111, 0.2);
  border-color: #00a8e8;
  transform: translateY(-5px);
}

.series-btn {
  background: transparent;
  color: #00a8e8;
  border: none;
  padding: 0;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.series-btn:hover {
  background: transparent;
  color: white;
  transform: none;
  box-shadow: none;
}

.seasons-dropdown {
  position: static;
  transform: none;
  background: transparent;
  border: none;
  width: 100%;
  opacity: 1;
  visibility: visible;
  box-shadow: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.season-item {
  padding: 8px 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  color: #fff;
  font-weight: 500;
  display: block;
  text-align: center;
  font-size: 0.9rem;
  border: 1px solid rgba(0, 168, 232, 0.1);
}

.season-item:hover {
  background: #00a8e8;
  color: #060d17;
  border-color: #00a8e8;
}

.series-btn-container:hover .seasons-dropdown {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.season-item.active {
  background: #00a8e8;
  color: white;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.animate-in {
  animation: scaleIn 0.6s ease-out forwards;
}

.video-card {
  background: #112233;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s;
  cursor: pointer;
  opacity: 0; /* Pour l'animation au scroll */
}

.video-card.visible {
  opacity: 1;
  animation: slideUpFade 0.6s ease-out forwards;
}

.video-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 10px 20px rgba(0, 168, 232, 0.2);
}

@keyframes slideUpFade {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  letter-spacing: 2px;
  color: #00a8e8;
  text-shadow: 0 0 10px rgba(0,168,232,0.5);
  animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
  0% { text-shadow: 0 0 10px rgba(0,168,232,0.5); }
  50% { text-shadow: 0 0 20px rgba(0,168,232,0.8), 0 0 30px rgba(0,168,232,0.4); }
  100% { text-shadow: 0 0 10px rgba(0,168,232,0.5); }
}

.close-player {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

.video-wrapper {
  width: 100%;
  aspect-ratio: 16/9;
  background: black;
  margin: 1rem 0;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
}

.player-meta {
  display: flex;
  gap: 2rem;
  font-size: 0.9rem;
  color: #ccc;
  border-top: 1px solid #333;
  padding-top: 1rem;
}

footer {
  text-align: center;
  padding: 2rem;
  background: #040911;
  color: #666;
  border-top: 1px solid #1a2a3a;
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}


/* Styles pour la page Profil */
.profile-container {
  padding: 4rem 2rem;
  min-height: calc(100vh - 200px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-card {
  background: rgba(0, 59, 111, 0.2);
  border: 1px solid rgba(0, 59, 111, 0.5);
  border-radius: 20px;
  padding: 3rem;
  max-width: 500px;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.profile-avatar {
  font-size: 5rem;
  color: #003b6f;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 10px rgba(0, 59, 111, 0.5));
}

.profile-header h1 {
  margin: 0;
  font-size: 2.5rem;
  color: #fff;
}

.badge {
  display: inline-block;
  padding: 0.3rem 1rem;
  background: #333;
  border-radius: 50px;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.admin-badge {
  background: #003b6f;
  color: #fff;
  border: 1px solid #00c3ff;
}

.profile-details {
  margin: 2rem 0;
  text-align: left;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem;
}

.detail-item {
  margin-bottom: 1.5rem;
}

.detail-item label {
  display: block;
  font-size: 0.8rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail-item p {
  margin: 0.2rem 0 0;
  font-size: 1.2rem;
  color: #fff;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-actions button {
  width: 100%;
  padding: 1rem;
  border-radius: 10px;
  font-weight: bold;
}

.btn-secondary {
  background: transparent;
  border: 1px solid #ff4444;
  color: #ff4444;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover {
  background: #ff4444;
  color: #fff;
}

/* Fin Styles Profil */
