/* === Base === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #1da1f2;
  --primary-dark: #0c8adf;
  --bg: #f7f9fb;
  --text: #2d2f31;
  --gray: #6b7280;
  --radius: 12px;
  --shadow: 0 3px 20px rgba(0,0,0,0.05);
  --surface: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-top: 70px;
  line-height: 1.6;
}

/* === Header Moderno === */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 1000;
}

.header-inner {
  max-width: 1200px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
}

.logo a {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-links a:hover {
  color: var(--primary);
}

/* === Intro y Formulario === */
.intro {
  text-align: center;
  margin: 10px auto 10px;
  max-width: 100%;
}
.intro h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.intro p {
  color: var(--gray);
  font-size: 1rem;
}

.upload-form {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.upload-form input {
  width: 360px;
  padding: 12px 16px;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border 0.2s;
}
.upload-form input:focus {
  border-color: var(--primary-dark);
}

.upload-form button {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}
.upload-form button:hover {
  background: var(--primary-dark);
}

.status-msg {
  text-align: center;
  margin-top: 15px;
  font-weight: 500;
  color: var(--gray);
}

/* === Galer�a tipo Masonry === */
.gallery {
  max-width:85%;
  column-count: 5;
  column-gap: 5px;
  margin: 0 auto;
  padding: 5px 5px;
  text-align: center;
}
@media (max-width: 1200px) { .gallery { column-count: 5; max-width:85%;} }
@media (max-width: 900px)  { .gallery { column-count: 4; } }
@media (max-width: 600px)  { .gallery { column-count: 2; } }
@media (max-width: 480px)  { .gallery { column-count: 2; max-width:100%;} }

.gallery .card {
  display: inline-block;
  width: 100%;
  margin-bottom: 0px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gallery .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 25px rgba(0,0,0,0.12);
}
.gallery img {
  width: 100%;
  display: block;
  border-radius: var(--radius);
}

/* === View Page === */
.view-page {
  background: var(--surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.player-section {
  padding: 10px 5px 10px;
  display: flex;
  justify-content: center;
}

.player-wrapper {
  width: 100%;
  max-width: 900px;
  text-align: center;
}


/* ---- Forma general responsive ---- */
.video-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* VIDEO dentro del contenedor */
.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---- Vista escritorio: forma rectangular 16:9 ---- */
@media (min-width: 900px) {
  .video-frame {
    aspect-ratio: 16 / 9;   /* forma m�s rectangular */
    max-height: 600px;      /* evita que se haga demasiado grande */
  }
}

/* ---- Vista m�vil: 100% adaptable ---- */
@media (max-width: 899px) {
  .video-frame {
    height: auto;
    aspect-ratio: auto;
  }
}


.player {
    padding-bottom: 45%;
    position: relative;
    overflow: hidden;
    clear: both;
    margin: 0 10px 5px 10px;
    background-color: #000;
}

/* === Autor m�s peque�o === */
.video-author-info {
/*  margin-top: 10px; */
  text-align: right;
}
.video-author {
  color: var(--primary);
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s;
}
.video-author:hover {
  color: var(--primary-dark);
}

/* === Botones principales (Descargar / Tweet) === */
.actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 12px 22px;
  font-size: 1rem;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.btn-download {
  background: var(--primary);
  color: #fff;
}
.btn-download:hover {
  background: var(--primary-dark);
}

.btn-tweet {
  background: #000;
  color: #fff;
}
.btn-tweet:hover {
  background: #1a1a1a;
}

/* === Botones de navegaci�n (Anterior / Siguiente) === */
.nav-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.btn-nav {
  background: transparent;
  border: 2px solid #cbd5e1;
  color: var(--gray);
  padding: 10px 22px;
  border-radius: 50px;
  font-weight: 500;
  transition: all 0.25s ease;
}
.btn-nav:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f1f5f9;
}

/* === �cono de X === */
.x-logo {
  width: 16px;
  height: 16px;
  fill: currentColor;
  vertical-align: middle;
}

/* === Share Buttons === */
.share-buttons {
  text-align: center;
  margin-top: 30px;
}
.share-buttons p {
  color: var(--gray);
  font-weight: 500;
  margin-bottom: 10px;
}

.share-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.share-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.25s ease, opacity 0.25s ease;
  color: #fff;
}
.share-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.share-btn:hover {
  transform: scale(1.08);
  opacity: 0.9;
}

/* Colores de marca */
.share-btn.tg { background: #0088cc; }
.share-btn.wa { background: #25d366; }
.share-btn.tw { background: #000; }
.share-btn.rd { background: #ff4500; }
.share-btn.copy { background:#9ca3af; }
.share-btn.copy:hover { background:#6b7280; }

.status-msg a.btn-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius);
  background: rgba(29,161,242,0.1);
  transition: background 0.25s;
}
.status-msg a.btn-link:hover {
  background: rgba(29,161,242,0.2);
}

/* === Overlay username centrado === */
.listn .user {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  text-align: center;
}

.listn .user a {
  text-decoration: none; /* quitar subrayado */
}

.listn .user a span {
  padding: 4px 5px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 400;
  background: rgba(29,161,242,0.9);
  color: #fff;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
  transition: background 0.25s ease, transform 0.25s ease;
}

.listn .user a span:hover {
  background: rgba(13,141,225,0.95);
  transform: scale(1.05);
}

    /* Adaptaci�n para la estructura existente */
    .gallery .card {
      position: relative;
      overflow: hidden;
      display: inline-block;
      width: 100%;
      border-radius: var(--radius);
      background: #fff;
      box-shadow: var(--shadow);
      transition: transform 0.25s ease, box-shadow 0.25s ease;
    }
    .gallery .card img {
      display: block;
      width: 100%;
      height: auto;
      border-radius: var(--radius);
    }

.intro .btn.tweet {
  margin-top: 10px;
  background: #000;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.25s;
}

.intro .btn.tweet:hover {
  background: #1a1a1a;
}

.x-logo {
  width: 18px;
  height: 18px;
  fill: currentColor;
}



/* === Footer === */
footer {
  text-align: center;
  padding: 20px;
  color: var(--gray);
  font-size: 0.9rem;
  border-top: 1px solid #e5e7eb;
  margin-top: 40px;
}


.pagination .btn-nav {
    padding: 8px 14px;
    margin: 0 3px;
    border-radius: 5px;
    text-decoration: none;
    background: #f1f1f1;
    color: #333;
    border: 1px solid #ccc;
}

.pagination .btn-nav:hover {
    background: #ddd;
}

.pagination .btn-nav.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination .dots {
    padding: 8px;
    color: #777;
}


/* === Top Filters === */
.top-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px auto 25px;
}

/* Bot�n base */
.top-filters .btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid #e5e7eb;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

/* Hover */
.top-filters .btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(29,161,242,0.05);
}

/* Activo */
.top-filters .btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(29,161,242,0.35);
}

/* Texto de vistas */
.views {
  font-size: 0.8rem;
  text-align: center;
  margin-top: 6px;
  color: var(--gray);
}

/* Mobile */
@media (max-width: 480px) {
  .top-filters .btn {
    padding: 7px 14px;
    font-size: 0.85rem;
  }
}

.card.listn .views {
  color: #fff;              
  position: absolute;
  bottom: 10px;             
  right: 10px;              
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.timeago {
  opacity: .8;
  font-size: 12px;
  margin-bottom: 4px;
}