/* Variables CSS */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --accent-primary: #f16363;
  --accent-hover: #f88181;
  --border-color: #262626;
  --error: #ff4444;
  --error-bg: rgba(255, 68, 68, 0.1);
  --success: #4CAF50;
  --bg-input: #2a2a2a;
  --bg-hover: #333333;
}

/* Global Styles */
html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  width: 100%;
  overflow-x: hidden;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

a:visited {
  color: var(--accent-primary) !important; /* Forcer la même couleur que les liens non visités */
}

/* Empêcher les liens visités de changer de couleur pour les éléments spécifiques */
.nav-link:visited {
  color: var(--text-secondary) !important; /* Garde la couleur gris clair */
}

.video-card:visited,
.video-title:visited {
  color: #fff !important; /* Garde la couleur blanche */
}

.footer-link:visited {
  color: var(--text-secondary) !important; /* Garde la couleur d'origine */
}

.pagination-btn:visited {
  color: var(--text-primary) !important; /* Garde la couleur blanche */
}

.pagination-btn.active:visited {
  color: white !important; /* Garde la couleur blanche pour les boutons actifs */
}

.video-meta a:visited {
  color: #999 !important; /* Garde la couleur grise pour les tags/métadonnées */
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header Styles */
header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.container {
  max-width: 1700px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header-top {
  padding: 1rem 0;
}

.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: translateY(-1px);
}

.logo-img {
  width: 32px;
  height: 32px;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.highlight {
  color: var(--accent-primary);
}

.desktop-nav {
  display: flex;
  gap: 1rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--accent-primary);
  background: rgba(255, 46, 46, 0.1);
}

.nav-icon {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.nav-link:hover .nav-icon {
  opacity: 1;
}

.header-bottom {
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-color);
}

.search-form {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
}

.search-input {
  width: -webkit-fill-available;
  padding: 0.75rem 1rem;
  padding-right: 3rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(255, 46, 46, 0.1);
}

.search-button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
}

.search-button:hover {
  color: var(--accent-primary);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

.menu-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 24px;
}

.bar {
  height: 2px;
  background-color: currentColor;
  transition: 0.3s ease;
}

.menu-icon.open .bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-icon.open .bar:nth-child(2) {
  opacity: 0;
}

.menu-icon.open .bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav {
  display: none;
  padding: 1rem 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.mobile-nav.open {
  display: block;
}

.mobile-nav .container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-nav .nav-link {
  padding: 0.75rem;
  background: var(--bg-primary);
}

.hidden-mobile {
  display: none;
}

.hidden-desktop {
  display: block;
}

/* Main Content Styles */
main {
  flex: 1;
  background: var(--bg-primary);
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.content {
  max-width: 1700px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
  box-sizing: border-box;
  display: block;
  min-width: 0;
}

.pageTitle {
  font-size: 20px;
  text-align: center;
  color: var(--text-primary);
}

/* Video Grid Styles */
.video-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
  gap: 1.5rem;
  padding: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow: visible;
}

.video-card-wrapper {
  display: block;
  background-color: #1c1c1c;
  border-radius: 8px;
  border: 1px solid #020202;
}

.video-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s;
}

.video-card:hover {
  transform: translateY(-2px);
}

.thumbnail-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.video-preview,
.video-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.video-preview {
  z-index: 2;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

.video-thumbnail {
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
  opacity: 1;
}

.duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 2px 4px;
  border-radius: 2px;
  font-size: 0.8rem;
  z-index: 3;
}

.video-info {
  padding: 8px;
}

.video-title {
  margin: 0;
  font-size: 1rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0rem;
  font-size: 0.85rem;
  color: #999;
}

.date {
  font-size: 0.8rem;
  color: #ececec;
  margin-top: 0.25rem;
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.pagination-btn:hover:not(.disabled) {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.pagination-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-ellipsis {
  color: var(--text-secondary);
  padding: 0 0.5rem;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
}

.no-results {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

/* Footer Styles */
footer {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border-color);
  box-shadow:
    0 -4px 6px -1px rgba(0, 0, 0, 0.1),
    0 -2px 4px -1px rgba(0, 0, 0, 0.06);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-primary);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.footer-section h3 svg {
  width: 20px;
  height: 20px;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 0.75rem;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 0.5rem;
  border-radius: 6px;
}

.footer-link:hover {
  color: var(--accent-primary);
  background-color: rgba(255, 255, 255, 0.05);
  transform: translateX(5px);
}

.footer-link svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.footer-link:hover svg {
  opacity: 1;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.copyright p,
.rta-label p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

.rta-label p {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.7;
}

.rta-label svg {
  width: 16px;
  height: 16px;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .hidden-desktop {
    display: none;
  }
  
  .hidden-mobile {
    display: block;
  }
  
  .container {
    padding: 0 1rem;
  }

  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .mobile-nav {
    position: absolute;
    width: 100%;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }

  .mobile-nav .nav-link {
    padding: 0.75rem;
    background: var(--bg-primary);
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 1rem;
  }

  .content {
    padding: 1rem;
  }

  .footer-content {
    padding: 0 1rem;
  }

  .footer-grid {
    gap: 2rem;
  }

  .footer-section {
    text-align: center;
  }

  .footer-section h3 {
    justify-content: center;
  }

  .footer-link {
    justify-content: center;
  }

  .footer-link:hover {
    transform: none;
  }
}

