/* ============================================================
   PLAY STORE PWA - DESIGN SYSTEM v2.0
   Fuente: DM Sans + Syne (Google Fonts)
   Paleta: Índigo oscuro + Blanco limpio + Acentos vibrantes
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Syne:wght@700;800&display=swap');

:root {
  /* Paleta principal */
  --primary: #1a0a5e;
  --primary-mid: #2d1b8a;
  --primary-light: #4a35c0;
  --accent: #6c5ce7;
  --accent-soft: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.18);

  /* Neutros */
  --surface: #ffffff;
  --surface-alt: #f6f6fb;
  --surface-card: #ffffff;
  --surface-hover: #f0effe;
  --border: rgba(26, 10, 94, 0.1);
  --border-strong: rgba(26, 10, 94, 0.2);

  /* Texto */
  --text-primary: #1a0a5e;
  --text-secondary: #5c5c7a;
  --text-muted: #9999b5;
  --text-on-dark: #ffffff;

  /* Semánticos */
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #e17055;
  --info: #74b9ff;

  /* Tipografía */
  --font-body: 'DM Sans', sans-serif;
  --font-display: 'Syne', sans-serif;

  /* Espacios */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 100px;

  /* Sombras */
  --shadow-sm: 0 2px 8px rgba(26, 10, 94, 0.07);
  --shadow-md: 0 6px 24px rgba(26, 10, 94, 0.11);
  --shadow-lg: 0 16px 48px rgba(26, 10, 94, 0.14);
  --shadow-card: 0 2px 12px rgba(26, 10, 94, 0.08);

  /* Transición */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration: 0.22s;

  /* Nav height */
  --header-h: 64px;
  --bottom-nav-h: 64px;
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface-alt);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--header-h);
  padding-bottom: calc(var(--bottom-nav-h) + 8px);
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ── Header ────────────────────────────────── */
.top-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 1000;
  background: var(--primary);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  box-shadow: 0 2px 16px rgba(26, 10, 94, 0.35);
}

.top-header .navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.top-header .navbar-brand img { height: 36px; filter: brightness(0) invert(1); }

.top-header .brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-on-dark);
  letter-spacing: -0.3px;
}

/* Search bar in header */
.header-search {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.header-search input {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-pill);
  border: none;
  background: rgba(255,255,255,0.12);
  color: white;
  padding: 0 44px 0 16px;
  font-family: var(--font-body);
  font-size: 14px;
  transition: background var(--duration) var(--ease);
  outline: none;
}

.header-search input::placeholder { color: rgba(255,255,255,0.55); }
.header-search input:focus { background: rgba(255,255,255,0.22); }

.header-search .search-btn {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer; font-size: 16px;
  padding: 0;
}

/* Header right actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.header-action-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  font-size: 17px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--duration);
  text-decoration: none;
}

.header-action-btn:hover { background: rgba(255,255,255,0.2); color: white; }

/* Nav menu (desktop only) */
.header-nav { display: flex; gap: 4px; }

.header-nav a {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  transition: all var(--duration);
  white-space: nowrap;
}

.header-nav a:hover,
.header-nav a.active {
  background: rgba(255,255,255,0.15);
  color: white;
}

/* ── Bottom Navigation ─────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 999;
  box-shadow: 0 -4px 20px rgba(26, 10, 94, 0.08);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--duration);
  text-decoration: none;
  border: none;
  background: none;
  position: relative;
}

.bottom-nav-item i { font-size: 21px; }

.bottom-nav-item.active { color: var(--accent); }

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 32px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
}

/* ── Search Overlay ────────────────────────── */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 40, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1100;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}

.search-overlay.active { display: flex; }

.search-modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 90%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
}

.search-modal-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0 16px;
}

.search-modal-inner input {
  flex: 1;
  height: 48px;
  border: none;
  background: transparent;
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--text-primary);
  outline: none;
}

.search-modal-inner button {
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 18px; cursor: pointer;
}

/* ── Sections & Typography ─────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.section-link:hover { text-decoration: underline; }

/* ── Main Content ──────────────────────────── */
.main-content { padding: 20px 0 12px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ── Radio Cards - Grid (home sections) ────── */
.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 16px;
}

.radio-card-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 6px;
  border-radius: var(--radius-md);
  transition: background var(--duration), transform var(--duration);
  cursor: pointer;
}

.radio-card-icon:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.radio-card-icon img {
  width: 80px; height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.radio-card-icon .radio-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Radio Cards - List (popular) ─────────── */
.radio-list { display: flex; flex-direction: column; gap: 0; }

.radio-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  transition: background var(--duration);
  cursor: pointer;
}

.radio-list-item:hover { background: var(--surface-hover); }

.radio-list-item .rank {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 22px;
  text-align: center;
}

.radio-list-item img {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.radio-list-item .info { flex: 1; min-width: 0; }

.radio-list-item .info h6 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.radio-list-item .info small {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Developer Cards ───────────────────────── */
.dev-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
  transition: transform var(--duration), box-shadow var(--duration);
}

.dev-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.dev-card-banner {
  width: 100%; height: 140px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
}

.dev-card-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.dev-card-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  margin-top: -34px;
  border: 3px solid white;
  box-shadow: var(--shadow-sm);
}

.dev-card-info h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.dev-card-info small { color: var(--text-muted); font-size: 12px; }

/* ── Radio Detail Page ─────────────────────── */
.radio-detail-hero {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.radio-detail-top {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.radio-detail-logo {
  width: 120px; height: 120px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}

.radio-detail-info h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 6px;
}

.radio-detail-dev {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}

.radio-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.install-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration), transform var(--duration);
  box-shadow: 0 4px 16px rgba(26, 10, 94, 0.3);
}

.install-btn:hover { background: var(--primary-mid); transform: translateY(-1px); }

.install-btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: none;
}

.install-btn-secondary:hover { background: var(--surface-hover); }

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(108, 92, 231, 0.25);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration);
}

.share-btn:hover { background: rgba(108, 92, 231, 0.25); }

/* Screenshots scroll */
.screenshots-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.screenshots-scroll img {
  height: 280px;
  width: auto;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

/* Info section card */
.info-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}

.info-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.info-card h4 .ti { font-size: 18px; color: var(--text-muted); }

/* Security badges */
.security-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.security-item:last-child { border-bottom: none; }

.security-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
}

/* Similar apps list */
.similar-app-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.similar-app-item:last-child { border-bottom: none; }

.similar-app-item img {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.similar-app-item .app-info { flex: 1; min-width: 0; }

.similar-app-item .app-info h6 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.similar-app-item .app-info small { color: var(--text-muted); font-size: 12px; }

.btn-get {
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration);
}

.btn-get:hover { background: var(--accent-glow); border-color: var(--accent); }

/* Stars */
.stars { color: var(--warning); font-size: 14px; }
.stars-lg { font-size: 40px; }

/* ── Modal ─────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 24px 16px;
}

.modal-title { font-weight: 700; font-size: 17px; }
.modal-body { padding: 20px 24px; }

/* ── Footer ────────────────────────────────── */
.main-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 24px;
  margin-top: 48px;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: white;
  margin-bottom: 8px;
}

.footer-tagline { font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 24px; }

.footer-col h6 {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 8px;
  transition: color var(--duration);
}

.footer-col a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.footer-bottom a { color: rgba(255,255,255,0.4); margin: 0 8px; }
.footer-bottom a:hover { color: rgba(255,255,255,0.75); }

/* ── Hero Banner / Welcome ─────────────────── */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  color: white;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
}

.hero-banner h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
}

.hero-banner p { font-size: 15px; opacity: 0.85; position: relative; }

/* ── Auth Pages ────────────────────────────── */
body.auth-page {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  padding-top: 24px;
  padding-bottom: 24px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
}

.auth-logo img { height: 52px; margin-bottom: 10px; }

.auth-logo h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.auth-logo p { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.form-control {
  width: 100%;
  height: 46px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color var(--duration), box-shadow var(--duration);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder { color: var(--text-muted); }

.form-group { margin-bottom: 18px; }

.btn-primary {
  width: 100%;
  height: 48px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--duration), transform var(--duration);
  letter-spacing: 0.2px;
}

.btn-primary:hover { background: var(--primary-mid); transform: translateY(-1px); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-google {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: white;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: border-color var(--duration), background var(--duration);
}

.btn-google:hover { border-color: var(--accent); background: var(--surface-alt); }

.auth-footer-text {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 24px;
}

.auth-footer-text a { color: var(--accent); font-weight: 600; }

/* ── Toast ─────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 2000;
}

.toast {
  background: var(--primary);
  color: white;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.3s var(--ease);
}

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

/* ── Badges & Chips ────────────────────────── */
.badge-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* ── Panel / Admin ─────────────────────────── */
.panel-wrapper {
  min-height: 100vh;
  background: var(--surface-alt);
}

/* ── Responsive ────────────────────────────── */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .main-content { padding: 28px 0 24px; }
  .header-search { max-width: 600px; }
  .radio-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

@media (min-width: 1024px) {
  .top-header { padding: 0 32px; }
  .radio-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .auth-card { padding: 48px 40px; }
}

@media (max-width: 576px) {
  .radio-detail-top { flex-direction: column; align-items: flex-start; }
  .radio-detail-logo { width: 96px; height: 96px; }
  .radio-detail-hero { padding: 18px; }
  .hero-banner { padding: 24px 18px; }
  .hero-banner h1 { font-size: 20px; }
  .screenshots-scroll img { height: 220px; }
}
