/* ==========================================================================
   ESTILOS GENERALES Y VARIABLES DE TEMA GAMER VIP
   ========================================================================== */
:root {
  --bg-primary: #070a13;
  --bg-secondary: #0d1322;
  --bg-card: #111827;
  --bg-card-hover: #162032;
  --border-color: #1e293b;
  --border-highlight: #334155;
  
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.25);
  --accent-blue: #38bdf8;
  --accent-indigo: #6366f1;
  --accent-amber: #f59e0b;
  --accent-pink: #ec4899;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Space Grotesk', 'Outfit', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================================================
   PANTALLA DE LOGIN / AUTENTICACIÓN
   ========================================================================== */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(circle at 50% 20%, #131d36 0%, #070a13 70%);
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  box-shadow: var(--shadow-card), 0 0 40px rgba(0, 0, 0, 0.8);
  text-align: center;
  backdrop-filter: blur(12px);
  animation: fadeIn 0.4s ease-out;
}

.auth-logo {
  height: 48px;
  object-fit: contain;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.auth-badge {
  display: inline-block;
  background: linear-gradient(90deg, #10b981, #059669);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

.auth-header h1 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-main);
}

.auth-header p {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 24px;
}

.input-group {
  text-align: left;
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.input-container {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 14px;
  transition: all 0.2s;
}

.input-container:focus-within {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px var(--accent-green-glow);
}

.input-icon {
  font-size: 16px;
  margin-right: 10px;
  opacity: 0.7;
}

.input-container input {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  padding: 13px 0;
  outline: none;
  font-family: var(--font-main);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-main);
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.alert-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  text-align: left;
  line-height: 1.4;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.auth-footer {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.auth-footer p {
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 8px;
}

.btn-support {
  color: var(--accent-green);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn-support:hover {
  text-decoration: underline;
}

/* ==========================================================================
   APP DASHBOARD / NAVBAR
   ========================================================================== */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.navbar {
  background: rgba(13, 19, 34, 0.85);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  height: 34px;
  object-fit: contain;
}

.vip-tag {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: #000;
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-install {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-install:hover {
  background: var(--accent-blue);
  color: #000;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
}

.user-avatar {
  font-size: 13px;
}

.user-email {
  color: #cbd5e1;
  font-weight: 500;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: 16px;
  padding: 6px 9px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  background: radial-gradient(circle at 50% 0%, #152244 0%, #070a13 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 40px 20px 28px;
  text-align: center;
}

.hero-content {
  max-width: 860px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-green);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.hero-content h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  color: var(--text-muted);
  font-size: 14.5px;
  margin-bottom: 24px;
}

.hero-quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.quick-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-main);
}

.quick-btn:hover {
  background: var(--border-highlight);
  color: #fff;
  border-color: #475569;
}

.quick-btn.active-quick {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #070a13;
  font-weight: 800;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   CONTROLS & SEARCH SECTION
   ========================================================================== */
.controls-section {
  max-width: 1280px;
  margin: 20px auto 0;
  padding: 0 20px;
  width: 100%;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}

.search-bar:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.search-icon {
  font-size: 16px;
  margin-right: 12px;
  opacity: 0.6;
}

.search-bar input {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14.5px;
  padding: 14px 0;
  outline: none;
  font-family: var(--font-main);
}

.btn-clear {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

.stats-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ==========================================================================
   MAIN CONTENT & TV BOX BANNER
   ========================================================================== */
.main-content {
  max-width: 1280px;
  margin: 16px auto 40px;
  padding: 0 20px;
  width: 100%;
  flex: 1;
}

.tv-box-banner {
  background: linear-gradient(135deg, #131c35 0%, #0d1322 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-left: 5px solid var(--accent-blue);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.tv-badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-blue);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.tv-box-info h3 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.tv-box-info p {
  color: var(--text-muted);
  font-size: 13px;
}

.tv-box-code-box {
  background: rgba(7, 10, 19, 0.8);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  text-align: center;
}

.tv-label {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.code-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.code-number {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 900;
  color: var(--accent-green);
  letter-spacing: 1px;
}

.btn-copy {
  background: var(--border-highlight);
  border: 1px solid #475569;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: var(--accent-green);
  color: #000;
  border-color: var(--accent-green);
}

/* ==========================================================================
   CARDS GRID & CARDS
   ========================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.system-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.system-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: #334155;
  box-shadow: var(--shadow-card);
}

.system-card.card-featured {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(180deg, #131c30 0%, #111827 100%);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-icon-wrapper {
  font-size: 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.card-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.card-badge.badge-vip {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.4);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.card-system-tag {
  font-size: 11.5px;
  color: var(--accent-green);
  font-weight: 600;
  margin-bottom: 8px;
}

.card-desc {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 16px;
  flex: 1;
}

.card-footer {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn-card-drive {
  flex: 1;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-card-drive:hover {
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-card-guide {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-card-guide:hover {
  background: var(--border-highlight);
  color: #fff;
}

/* ==========================================================================
   ESTADO VACÍO & TOAST
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.7;
}

.empty-state h3 {
  font-size: 18px;
  color: #fff;
  margin-bottom: 6px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 16px;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #10b981;
  color: #070a13;
  font-size: 13px;
  font-weight: 800;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  animation: slideUp 0.3s ease-out;
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 500;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 17px;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  color: #cbd5e1;
  font-size: 13.5px;
  line-height: 1.5;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.app-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 24px 20px;
  text-align: center;
  margin-top: auto;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-logo {
  height: 28px;
  object-fit: contain;
  margin-bottom: 8px;
  opacity: 0.8;
}

.footer-container p {
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 12.5px;
}

.footer-links a {
  color: var(--accent-green);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   RESPONSIVO / MOBILE FIRST
   ========================================================================== */
@media (max-width: 640px) {
  .hero-content h1 {
    font-size: 24px;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .tv-box-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .tv-box-code-box {
    text-align: center;
  }
  .nav-container {
    padding: 10px 14px;
  }
}
