/* =========================================================
   MEDIAVAULT - MODERN DARK UI STYLESHEET
   ========================================================= */

:root {
  --bg-dark: #0a0e17;
  --bg-card: #131a29;
  --bg-card-hover: #1a2337;
  --bg-surface: #1e283d;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.35);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #818cf8;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(6, 182, 212, 0.06) 0%, transparent 45%);
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

/* =========================================================
   NAVBAR
   ========================================================= */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.brand-text span {
  color: var(--accent-cyan);
}

.nav-search {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

.search-input:focus {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
  font-size: 1rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-admin {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-admin:hover {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--primary);
}

/* =========================================================
   HERO / BANNER SECTION
   ========================================================= */

.hero-section {
  max-width: 1280px;
  margin: 1.5rem auto 1rem;
  padding: 0 1.5rem;
  text-align: center;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 680px;
  margin: 0 auto 1.5rem;
}

/* =========================================================
   PUBLICIDAD / BANNERS
   ========================================================= */

.ad-slot-container {
  max-width: 1280px;
  margin: 1rem auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: center;
}

.ad-banner-placeholder {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background: rgba(19, 26, 41, 0.75);
  border: 1px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.4);
}

.ad-card-placeholder {
  max-width: 100%;
  min-height: 140px;
  background: linear-gradient(135deg, rgba(30, 40, 61, 0.8), rgba(19, 26, 41, 0.95));
}

.ad-tag {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-subtle);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
}

.ad-content {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

/* =========================================================
   CATEGORIES BAR
   ========================================================= */

.categories-bar {
  max-width: 1280px;
  margin: 1rem auto 1.5rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.categories-bar::-webkit-scrollbar {
  display: none;
}

.category-pill {
  white-space: nowrap;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-xl);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  user-select: none;
}

.category-pill:hover {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.category-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.4);
}

/* =========================================================
   MAIN CONTENT & GRID
   ========================================================= */

.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  flex: 1;
  width: 100%;
}

.grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.results-info {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.results-info strong {
  color: var(--text-main);
}

.sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
}

.sort-select:focus {
  border-color: var(--primary);
}

/* ITEMS GRID */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.item-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.card-media {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  overflow: hidden;
}

.card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.item-card:hover .card-img {
  transform: scale(1.05);
}

.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  z-index: 2;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
}

.badge-featured {
  background: rgba(245, 158, 11, 0.9);
  color: #000;
}

.badge-category {
  background: rgba(10, 14, 23, 0.75);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-size {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.card-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-platform {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.35;
  color: #fff;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-download-card {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-download-card:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.45);
}

/* Estado vacío */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* =========================================================
   MODAL DE DETALLES & DESCARGA
   ========================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  box-shadow: var(--shadow-md), 0 0 40px rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: var(--accent-rose);
  color: #fff;
  border-color: var(--accent-rose);
}

.modal-header-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}

.modal-content-body {
  padding: 1.5rem;
}

.modal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
}

.modal-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem;
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 0.7rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  font-weight: 700;
}

.spec-val {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.modal-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.modal-screenshots {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.screenshot-thumb {
  width: 160px;
  height: 90px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.2s;
}

.screenshot-thumb:hover {
  transform: scale(1.04);
}

/* ZONA DE DESCARGA Y MONETIZACIÓN */
.download-action-box {
  background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(19, 26, 41, 0.95) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-download-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), #4338ca);
  color: #fff;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  transition: all 0.25s ease;
}

.btn-download-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
}

.countdown-wrapper {
  display: none;
  margin-top: 0.75rem;
}

.countdown-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-dark);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.countdown-fill {
  height: 100%;
  width: 100%;
  background: var(--accent-emerald);
  transition: width 1s linear;
}

.countdown-text {
  font-size: 0.85rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

.download-disclaimer {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 0.75rem;
}

.download-fallback-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--accent-cyan);
  text-decoration: underline;
  cursor: pointer;
}

/* =========================================================
   TOAST NOTIFICATIONS
   ========================================================= */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  color: var(--text-main);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: rgba(10, 14, 23, 0.95);
  padding: 2rem 1.5rem;
  text-align: center;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-text {
  color: var(--text-subtle);
  font-size: 0.85rem;
}

/* =========================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ========================================================= */

@media (max-width: 768px) {
  .nav-container {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .nav-search {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .items-grid {
    grid-template-columns: 1fr;
  }

  .modal-specs-grid {
    grid-template-columns: 1fr 1fr;
  }
}
