/* ========================================================
   INSTAGRAM DOWNLOADER — STANDALONE STYLESHEET
   Modern Glassmorphism & Instagram Accent Palette
   ======================================================== */

:root {
  --bg-main: #0a0c10;
  --bg-card: rgba(18, 22, 32, 0.75);
  --bg-card-hover: rgba(26, 31, 46, 0.85);
  --bg-input: #121620;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(220, 39, 67, 0.5);
  
  --ig-grad-1: #f09433;
  --ig-grad-2: #e6683c;
  --ig-grad-3: #dc2743;
  --ig-grad-4: #cc2366;
  --ig-grad-5: #bc1888;
  
  --ig-gradient: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  --ig-gradient-hover: linear-gradient(135deg, #f3a04a 0%, #eb774e 25%, #e13a54 50%, #d43576 75%, #c52694 100%);
  --ig-glow: rgba(220, 39, 67, 0.35);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --danger: #ef4444;
  --success: #10b981;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Ambient glows */
.bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(120px);
}

.glow-1 {
  background: radial-gradient(circle, rgba(220, 39, 67, 0.18) 0%, transparent 70%);
  top: -100px;
  right: 15%;
}

.glow-2 {
  background: radial-gradient(circle, rgba(240, 148, 51, 0.12) 0%, transparent 70%);
  bottom: 20%;
  left: 10%;
}

/* Navbar */
.navbar {
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 12, 16, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: var(--ig-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px var(--ig-glow);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-name span {
  color: #fb7185;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
}

/* Main */
.main-content {
  flex: 1;
  padding-top: 50px;
  padding-bottom: 70px;
  position: relative;
  z-index: 1;
}

/* Hero */
.hero-section {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 40px auto;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(220, 39, 67, 0.12);
  border: 1px solid rgba(220, 39, 67, 0.3);
  color: #fb7185;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.text-gradient {
  background: var(--ig-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Search bar card */
.search-card {
  margin-top: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
}

.search-form {
  display: flex;
  gap: 10px;
}

.input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 16px;
  transition: var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(220, 39, 67, 0.2);
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-dim);
  margin-right: 12px;
}

.input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 16px 0;
}

.input-wrapper input::placeholder {
  color: var(--text-dim);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.btn-clear {
  font-size: 1.1rem;
}

.btn-primary {
  background: var(--ig-gradient);
  border: none;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0 28px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 18px var(--ig-glow);
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--ig-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(220, 39, 67, 0.5);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Quick Hints */
.quick-hints {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.quick-hints code {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Skeletons */
.loading-section {
  max-width: 820px;
  margin: 30px auto;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 20px;
}

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-thumb { width: 220px; height: 280px; flex-shrink: 0; }
.skeleton-body { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.skeleton-title { height: 26px; width: 80%; }
.skeleton-text { height: 70px; width: 100%; }
.skeleton-btn { height: 46px; width: 60%; margin-top: auto; }

/* Alert Box */
.alert-box {
  max-width: 820px;
  margin: 24px auto;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 14px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-icon { font-size: 1.3rem; }
.alert-content { flex: 1; }
.alert-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; }
.alert-message { font-size: 0.85rem; color: #fecaca; }
.alert-close {
  background: none; border: none; color: inherit; cursor: pointer; font-size: 1.1rem;
}

/* Result Card */
.result-section {
  max-width: 900px;
  margin: 30px auto;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
}

.ig-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.ig-author-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ig-author-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--ig-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px var(--ig-glow);
}

.ig-author-name {
  font-weight: 700;
  font-size: 1rem;
}

.ig-post-type {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ig-provider-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Single Showcase Layout */
.ig-showcase-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 768px) {
  .ig-showcase-container {
    grid-template-columns: 1fr;
  }
}

.ig-media-wrapper {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  aspect-ratio: 9 / 16;
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.ig-details-pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ig-caption-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px;
  border-radius: var(--radius-md);
}

.ig-caption-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.ig-caption-text {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.6;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-line;
}

.ig-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.btn-ig-download {
  background: var(--ig-gradient);
  color: #fff;
  box-shadow: 0 4px 18px var(--ig-glow);
}

.btn-ig-download:hover {
  background: var(--ig-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(220, 39, 67, 0.5);
}

.btn-ig-audio {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.btn-ig-audio:hover {
  background: rgba(168, 85, 247, 0.25);
  color: #fff;
  transform: translateY(-2px);
}

.btn-ig-copy {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-ig-copy:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* Carousel Gallery Grid */
.ig-carousel-container {
  margin-top: 12px;
}

.ig-carousel-header {
  margin-bottom: 18px;
}

.ig-carousel-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.ig-carousel-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ig-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.ig-gallery-item {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.ig-gallery-item:hover {
  border-color: rgba(220, 39, 67, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.ig-gallery-thumb-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #111;
  position: relative;
  overflow: hidden;
}

.ig-gallery-thumb-wrap img,
.ig-gallery-thumb-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ig-item-type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
}

.ig-gallery-item-footer {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ig-item-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.btn-gallery-dl {
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--ig-gradient);
  color: #fff;
  text-decoration: none;
  text-align: center;
  display: block;
  transition: var(--transition);
}

.btn-gallery-dl:hover {
  background: var(--ig-gradient-hover);
}

/* Features */
.features-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 60px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(220, 39, 67, 0.3);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 14px;
}

.feature-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* FAQ */
.faq-section {
  margin-top: 60px;
}

.section-heading {
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 30px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.faq-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius-md);
}

.faq-card h4 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.faq-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--text-main);
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Toast */
.toast-notification {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #181d28;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  font-size: 0.88rem;
  font-weight: 500;
  display: none;
  z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
  .search-form { flex-direction: column; }
  .btn-primary { padding: 14px; }
  .skeleton-card { flex-direction: column; }
  .skeleton-thumb { width: 100%; height: 220px; }
}
