/* Font loaded via HTML for better performance */

:root {
  /* ── DARK THEME (DEFAULT) ── */
  --bg-deep: #020617;
  --bg-dark: #0f172a;
  --bg-glass: rgba(15, 23, 42, 0.7);
  --border-glass: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-primary: #8b5cf6;
  --accent-secondary: #f97316;
  --brand-orange: #f97316;
  --radius-lg: 24px;
  --radius-md: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --success: #10b981; /* Kept from original */
  --error: #ef4444; /* Kept from original */
  --accent-glow: rgba(139, 92, 246, 0.3); /* Kept from original */
}

[data-theme="light"] {
  --bg-deep: #f8fafc;
  --bg-dark: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.75);
  --border-glass: rgba(255, 255, 255, 0.4);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --glass-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 10px 15px -3px rgba(0, 0, 0, 0.03),
    0 20px 25px -5px rgba(0, 0, 0, 0.02);
  --accent-primary: #7c3aed;
  --accent-secondary: #f97316;
  --accent-glow: rgba(124, 58, 237, 0.08);
}

[data-theme="light"] body::before {
  background: 
    radial-gradient(circle at 0% 0%, #e0e7ff 0%, transparent 40%),
    radial-gradient(circle at 100% 0%, #fef3c7 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, #fae8ff 0%, transparent 40%),
    radial-gradient(circle at 0% 100%, #e0f2fe 0%, transparent 40%);
  opacity: 0.6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* Kept from original */
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  line-height: 1.6; /* Kept from original */
}

/* Aurora Backdrop Effect */
body::before {
  content: '';
  position: fixed;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(217, 70, 239, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
  z-index: -1;
  filter: blur(80px);
  animation: auroraPulse 20s ease-infinite alternate;
}

@keyframes auroraPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

/* ── UI COMPONENTS ── */

.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: var(--transition);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6), 0 0 20px rgba(139, 92, 246, 0.1);
}

/* ── HEADER ── */

header {
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(5, 5, 16, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-glass);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.5rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--brand-orange);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 800;
  margin-right: 10px;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
  transition: var(--transition);
}

.logo:hover .logo-icon {
  transform: rotate(-5deg) scale(1.05);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

.logo-text {
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
}

@media (min-width: 769px) {
  .mobile-only { display: none !important; }
}

@media (max-width: 768px) {
  .header-tags { 
    display: flex !important; 
    gap: 0.2rem; 
    margin-right: -0.5rem;
  }
  .tag {
    font-size: 0.5rem !important;
    padding: 0.1rem 0.25rem !important;
    border-radius: 4px !important;
  }
  header { 
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .logo { 
    font-size: 1.1rem;
    gap: 0.4rem;
  }
  .logo-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px; /* Consolidated and set to 8px */
    font-size: 0.9rem;
    background: #f97316; /* Ensured solid orange */
    font-weight: 800; /* Kept from original */
  }
}

.tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  white-space: nowrap;
}

.badges-list {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.badge-item {
  font-size: 0.65rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0.4rem 0.8rem;
  border-radius: 100px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ── LANGUAGE SWITCHER ── */
.lang-switcher {
  position: relative;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.lang-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.lang-icon {
  font-size: 1.1rem;
}

/* Force absolute and hidden by default */
.lang-menu {
  position: absolute !important;
  top: calc(100% + 1rem);
  right: 0;
  background: var(--bg-glass) !important;
  backdrop-filter: blur(25px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: var(--radius-md);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  width: 200px;
  overflow: hidden;
  display: none !important;
  z-index: 9999;
  animation: slideDownCustom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-menu.show {
  display: block !important;
}

.lang-option {
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.lang-option.active {
  color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.08);
}

@keyframes slideDownCustom {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .lang-menu {
    right: -20px;
    width: 180px;
  }
}

@media (max-width: 768px) {
  .lang-btn, .theme-btn {
    padding: 0.3rem 0.5rem;
  }
  #lang-label {
    display: none;
  }
}

.theme-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-right: 0.5rem;
}

#theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

#theme-icon svg {
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-btn:hover #theme-icon svg {
  transform: rotate(15deg) scale(1.1);
}

.theme-btn:hover {
  background: var(--border-glass);
  transform: translateY(-1px);
}

/* ── HERO ── */

.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .hero {
    padding: 0 1rem 1rem;
    margin-top: 1rem; /* Added space to prevent overlap with social bar */
  }
}

.hero-eyebrow {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 100px;
  color: var(--accent-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  animation: fadeInDown 0.8s ease;
}

h1 {
  font-size: clamp(2.2rem, 8vw, 3.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
  margin-top: 1rem;
  margin-bottom: 1rem;
  animation: fadeIn 1s ease 0.2s both;
}

h1 span {
  background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary), #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: clamp(0.95rem, 2vw, 1.125rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem;
  animation: fadeIn 1s ease 0.4s both;
}

/* ── SEARCH ── */

.search-container {
  max-width: 800px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
  animation: fadeInUp 0.8s ease 0.6s both;
}

@media (max-width: 768px) {
  .search-container {
    margin-bottom: 1rem;
  }
}

.search-wrapper {
  background: var(--bg-dark);
  border: 3px solid var(--border-glass);
  border-radius: 100px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--glass-shadow);
  transition: var(--transition);
  position: relative;
}

@media (max-width: 850px) {
  .search-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    gap: 0.75rem; /* Espacio entre el campo y el botón de abajo */
    flex-direction: column !important;
    display: flex !important;
    align-items: stretch !important;
    margin: 0; /* Removed top space */
  }

  .search-input-group {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: 0.3rem 0.5rem 0.3rem 1.25rem !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .search-input-group:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.25), 
                0 0 0 4px rgba(139, 92, 246, 0.1);
    transform: translateY(-1px);
  }

  input#url-input {
    order: 1; /* Input primero */
    flex: 1;
    color: #fff !important;
    font-size: 0.95rem;
    padding: 10px 0;
  }

  .btn-paste-overlay {
    order: 2; /* Botón de pegar a la derecha */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 100px;
    font-weight: 700;
  }

  .btn-search {
    width: 100% !important;
    border-radius: 100px;
    padding: 1rem;
    font-size: 1rem;
    letter-spacing: 1px;
    font-weight: 800;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
  }

  .btn-search-icon { font-size: 1.1rem; }
  .btn-search span:not(.btn-search-icon) { display: inline-block !important; } /* Re-habilitar texto "Descargar" */
}

@media (min-width: 851px) {
  .search-wrapper {
    flex-direction: row;
    padding: 0.5rem;
    gap: 0.5rem;
    background: var(--bg-dark);
    border-radius: 100px;
  }
  input#url-input {
    color: var(--text-main);
  }
}

@media (min-width: 851px) {
  .search-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.2), 0 25px 50px rgba(0, 0, 0, 0.6);
  }
}

.search-input-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

input#url-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  padding: 0.8rem 0 0.8rem 1rem;
}

input#url-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.btn-search {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 100px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);

  box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-search:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 15px 30px rgba(139, 92, 246, 0.4);
}

.btn-search:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-paste-overlay {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.6rem 1rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-left: 0.5rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-paste-overlay:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: translateY(-1px);
}

/* ── PLATFORMS ── */

.platforms-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem auto;
  max-width: 100%;
  animation: fadeIn 1s ease 0.8s both;
  overflow-x: auto;
  padding: 0.75rem 1rem;
  scrollbar-width: none;
  scroll-behavior: smooth; /* Smooth auto-scroll */
  -webkit-overflow-scrolling: touch;
}
.platforms-grid::-webkit-scrollbar { display: none; }

@media (max-width: 768px) {
  .platforms-grid {
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 0px;
    border-bottom: none;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem; /* Added space below social bar */
  }
  .platform-card {
    padding: 0.4rem 0.7rem;
    font-size: 0.65rem;
    flex-shrink: 0;
  }
}

.platform-card {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  cursor: default;
  opacity: 0.7;
}

.platform-card.active {
  background: rgba(139, 92, 246, 0.2);
  border: 2px solid var(--accent-primary);
  color: #fff;
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.35);
}

.p-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ── RESULTS ── */

#result {
  max-width: 1000px;
  margin: 0 auto 5rem;
  padding: 0 1.5rem;
}

.result-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 2rem;
}

@media (max-width: 850px) {
  .result-layout {
    grid-template-columns: 1fr;
  }
}

.preview-container {
  position: sticky;
  top: 100px;
}

@media (max-width: 850px) {
  .preview-container {
    position: relative !important;
    top: 0 !important;
  }
}

.media-wrapper {
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 600px;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8);
}

.media-wrapper img, .media-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.badge-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.data-badge {
  padding: 0.4rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.format-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.download-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.download-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--accent-primary);
  transform: translateX(6px);
}

.dl-details h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.dl-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
}

.dl-button {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 8px 16px rgba(139, 92, 246, 0.3);
  transition: var(--transition);
}

.download-card.downloading .dl-button {
  transform: rotate(360deg);
  background: var(--success);
}


.res-tag {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
}
.res-HD { color: #facc15; }
.res-4K { color: #fb7185; }

.nowm-tag {
  background: linear-gradient(135deg, #00f2ea, #ff0050);
  color: #fff;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
}

/* Platform Specific Colors for Badges */
.plat-instagram { border-color: #e1306c !important; color: #fff !important; background: rgba(225, 48, 108, 0.1) !important; }
.plat-tiktok { border-color: #00f2ea !important; color: #fff !important; background: rgba(0, 242, 234, 0.1) !important; }
.plat-youtube { border-color: #ff0000 !important; color: #fff !important; background: rgba(255, 0, 0, 0.1) !important; }
.plat-twitter { border-color: #1da1f2 !important; color: #fff !important; background: rgba(29, 161, 242, 0.1) !important; }
.plat-facebook { border-color: #1877f2 !important; color: #fff !important; background: rgba(24, 119, 242, 0.1) !important; }
.plat-vk { border-color: #4c75a3 !important; color: #fff !important; background: rgba(76, 117, 163, 0.1) !important; }

.modal-social-proof {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.proof-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.proof-badge i {
  font-size: 1rem;
}

/* ── VISIBILITY MODIFIERS ── */
.loader, .error-msg, .result, .list-result, .ig-profile {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.loader.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: translateY(0);
  margin: 3rem 0;
}

.error-msg.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
  margin: 2rem auto;
}

.ig-profile {
  margin-top: 2rem;
}

.ig-profile-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 3rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.ig-profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 1.5rem;
  position: relative;
}

@media (min-width: 768px) {
  .ig-profile-header {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem;
  }
}

.ig-avatar-container {
  position: relative;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .ig-avatar-container {
    margin-bottom: 0;
    flex-shrink: 0;
  }
}

.ig-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--accent-primary);
  padding: 3px;
  object-fit: cover;
  background: #111;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5), 0 0 15px var(--accent-glow);
}

@media (min-width: 768px) {
  .ig-avatar {
    width: 120px;
    height: 120px;
  }
}

.ig-info {
  flex: 1;
  text-align: center;
}

@media (min-width: 768px) {
  .ig-info {
    text-align: left;
  }
}

.ig-username {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.ig-fullname {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.ig-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .ig-stats {
    justify-content: flex-start;
  }
}

.ig-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (min-width: 768px) {
  .ig-stat {
    align-items: flex-start;
  }
}

.ig-stat-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.ig-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.ig-bio {
  color: #e2e8f0;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .ig-bio {
    margin: 0;
  }
}

.ig-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .ig-posts-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px; /* Instagram style grid */
    padding: 0 4px;
  }
  .ig-post-card {
    border-radius: 4px;
  }
}

@media (min-width: 769px) {
  .ig-posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
  }
}

.ig-post-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1/1;
  cursor: pointer;
}

.ig-post-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.ig-post-card:hover .ig-post-thumb {
  transform: scale(1.05);
}

.ig-post-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.ig-post-card:hover .ig-post-overlay {
  opacity: 1;
}

.ig-post-stats {
  display: flex;
  gap: 1rem;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
}

.ig-post-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ig-post-type {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.25rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.result.show, .list-result.show, .ig-profile.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ── MODAL PREVIEW ── */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.preview-modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 16, 0.95);
  backdrop-filter: blur(10px);
}

.modal-inner {
  position: relative;
  width: 95%;
  max-width: 1200px;
  height: 85vh;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 350px;
  background: rgba(10, 10, 26, 0.7);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.8), 0 0 20px rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

@media (max-width: 1000px) {
  .modal-inner {
    grid-template-columns: 1fr;
    height: 92vh;
    width: 95%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-radius: var(--radius-md);
  }
  .modal-carousel-container {
    height: 40vh; /* Reducido de 50vh para dar más espacio a las descargas */
    min-height: 300px;
    flex-shrink: 0;
  }
  .modal-sidebar {
    height: auto;
    overflow-y: visible;
  }
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 200;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.modal-carousel-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
}

.modal-sidebar {
  background: var(--bg-glass);
  border-left: 1px solid var(--border-glass);
  padding: 1.5rem; /* Reducido de 2rem */
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

@media (max-width: 1000px) {
  .modal-sidebar {
    border-left: none;
    border-top: 1px solid var(--border-glass);
  }
}

.carousel-track-viewport {
  width: 100%;
  height: 100%;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.carousel-slide img, .carousel-slide video {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.carousel-nav {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  display: flex !important;
  justify-content: space-between;
  padding: 0 1rem;
  pointer-events: none;
  transform: translateY(-50%);
  z-index: 150;
}

.carousel-btn {
  pointer-events: auto;
  width: 50px !important;
  height: 50px !important;
  min-width: 50px !important;
  min-height: 50px !important;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.carousel-btn:hover {
  background: var(--accent-primary);
  transform: scale(1.1);
}

.carousel-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  border-radius: 20px;
}

.carousel-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: var(--transition);
}

@media (max-width: 768px) {
  .carousel-dots .dot {
    width: 12px;
    height: 12px;
  }
}

.carousel-dots .dot.active {
  background: var(--accent-primary);
  transform: scale(1.3);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Slide Actions (Download inside modal) */
.slide-actions {
  position: absolute;
  bottom: 4rem;
  right: 2rem;
  display: flex;
  gap: 1rem;
}

.modal-dl-btn {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 20px rgba(139, 92, 246, 0.4);
  transition: var(--transition);
}

.modal-dl-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(139, 92, 246, 0.5);
}

@media (max-width: 1000px) {
  .modal-inner { 
    height: 90vh; 
    width: 100%;
    border-radius: 0;
    margin-top: auto;
  }
  .modal-close { 
    top: 1rem; 
    right: 1rem; 
    background: rgba(0, 0, 0, 0.6);
  }
  .slide-actions { 
    bottom: 1.5rem; 
    left: 1rem; 
    right: 1rem; 
    justify-content: stretch; 
  }
  .modal-dl-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── ESSENTIALS ── */
.loader {
  width: 100%;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-msg {
  max-width: 600px;
  margin: 0 auto;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  color: var(--error);
  text-align: center;
}

/* ── PRO CONVERSION UI ── */
.pro-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pro-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 100px;
  text-decoration: none;
  color: #fff;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255,255,255,0.05); /* Fallback */
}

.pro-btn:hover {
  transform: translateY(-3px);
  filter: brightness(1.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.pro-btn-primary { background: linear-gradient(135deg, #2563eb, #3b82f6); box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3); }
.pro-btn-premium { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3); }
.pro-btn-audio { background: linear-gradient(135deg, #8b5cf6, #d946ef); box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3); }

.pro-btn-icon {
  font-size: 1.5rem;
  background: rgba(0,0,0,0.2);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pro-btn-text {
  display: flex;
  flex-direction: column;
}

.pro-btn-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
}

.pro-btn-sub {
  display: block;
  font-size: 0.75rem;
  opacity: 0.8;
  font-weight: 600;
}

.pro-multi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.pro-multi-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.pro-multi-item:hover {
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-5px);
}

.pro-multi-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.pro-multi-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
}

.pro-btn-sm {
  padding: 0.75rem 1rem;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: 12px;
  gap: 0.5rem;
}


/* ── FEATURES SECTION ── */
.features-section {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 1.5rem;
  text-align: center;
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s;
  opacity: 1;
  transform: translateY(0);
  overflow: hidden; /* Protection */
  position: relative;
  z-index: 10;
}

.features-section.hide-features {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  visibility: hidden;
  height: 0;
  margin: 0;
  overflow: hidden;
}

.features-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  margin-bottom: 4rem;
  letter-spacing: -1px;
  background: linear-gradient(to bottom, #fff 30%, var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--bg-glass);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 3.5rem 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(249, 115, 22, 0.05), transparent 70%);
  opacity: 0;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-8px);
  border-color: rgba(249, 115, 22, 0.4);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 20px rgba(249, 115, 22, 0.1);
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-icon {
  width: 64px;
  height: 64px;
  background: rgba(249, 115, 22, 0.12);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  color: #f97316;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.feature-icon svg {
  width: 32px !important;
  height: 32px !important;
  display: block;
}

.feature-h {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: #fff;
  letter-spacing: -0.5px;
}

.feature-p {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 0.95rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  .features-section {
    margin: 4rem auto 2rem;
  }
  .features-title {
    margin-bottom: 2.5rem;
  }
  .feature-card {
    padding: 2.5rem 1.5rem;
  }
}
