/* -----------------------------------------
   SocialGrabber - Modern Glassmorphism UI
   Instagram Reels, Post, Story & HD Avatar Downloader
------------------------------------------ */

:root {
  /* Renk Paleti */
  --bg1: #090d1a;
  --bg2: #140d36;
  --bg3: #081226;
  --bg-gradient: radial-gradient(1200px 600px at 15% 10%, rgba(255, 0, 150, 0.20), transparent 55%),
                 radial-gradient(900px 500px at 85% 20%, rgba(0, 210, 255, 0.16), transparent 55%),
                 radial-gradient(800px 400px at 50% 90%, rgba(109, 92, 255, 0.15), transparent 60%),
                 linear-gradient(135deg, var(--bg1), var(--bg2) 55%, var(--bg3));

  /* Cam Efektleri */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-active: rgba(255, 255, 255, 0.25);
  --glass-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);

  /* Canlı Vurgu Renkleri */
  --accent: #ff2b7a;       /* Instagram Pembe */
  --accent-2: #7d5cff;     /* Canlı Mor */
  --accent-3: #00d2ff;     /* Neon Mavi */
  --accent-gradient: linear-gradient(135deg, #ff2b7a, #9933ff 50%, #00d2ff);
  --ring: rgba(255, 43, 122, 0.35);

  /* Tipografi & Renkler */
  --text-primary: rgba(255, 255, 255, 0.94);
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-muted: rgba(255, 255, 255, 0.42);
  --font-family: "Outfit", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* Yuvarlama & Geçişler */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur-fast: 160ms;
  --dur: 260ms;
}

/* Sıfırlama */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  font-family: var(--font-family);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Arka Plan Hafif Doku */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
  opacity: 0.18;
  mix-blend-mode: overlay;
  z-index: 0;
}

/* Ana Konteyner */
.container {
  width: 100%;
  max-width: 920px;
  padding: 24px 20px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Üst Navigasyon Çubuğu */
.top-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.btn-settings {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}

.btn-settings:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

/* Header */
header {
  text-align: center;
  margin: 10px 0 28px;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #ff2b7a, #a855f7 50%, #00d2ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.subtitle {
  margin-top: 10px;
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 58ch;
}

/* Sekmeler (Tabs Bar) */
.tabs-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  width: 100%;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  user-select: none;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  transform: translateY(-1px);
}

.tab-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 43, 122, 0.28);
}

/* Ana Cam Kart */
.downloader-card {
  width: 100%;
  padding: 36px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--glass-shadow);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

/* Form & Input Grubu */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 16px;
}

.input-icon {
  position: absolute;
  left: 20px;
  color: var(--text-muted);
  font-size: 1.2rem;
  pointer-events: none;
}

input[type="text"], input[type="url"] {
  width: 100%;
  padding: 18px 120px 18px 52px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.05rem;
  outline: none;
  font-family: inherit;
  transition: all var(--dur-fast) var(--ease);
}

input[type="text"]::placeholder, input[type="url"]::placeholder {
  color: var(--text-muted);
  font-size: 0.98rem;
}

input[type="text"]:focus, input[type="url"]:focus {
  border-color: rgba(255, 43, 122, 0.65);
  box-shadow: 0 0 0 4px var(--ring), 0 10px 30px rgba(0, 0, 0, 0.45);
  background: rgba(0, 0, 0, 0.50);
}

/* Input Sağ Butonlar (Yapıştır & Temizle) */
.input-actions {
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-inline {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: none;
  background: rgba(255, 255, 255, 0.10);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}

.btn-inline:hover {
  background: rgba(255, 255, 255, 0.20);
}

.btn-clear {
  display: none;
  padding: 6px 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-clear:hover {
  color: #fff;
  background: rgba(255, 60, 60, 0.4);
}

/* Ana İndir Butonu */
.btn-submit {
  width: 100%;
  padding: 17px 24px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent-gradient);
  box-shadow: 0 10px 30px rgba(255, 43, 122, 0.25), 0 10px 30px rgba(109, 92, 255, 0.18);
  transition: all var(--dur) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 14px 40px rgba(255, 43, 122, 0.35), 0 14px 40px rgba(109, 92, 255, 0.25);
}

.btn-submit:active {
  transform: translateY(0) scale(0.99);
}

/* Yükleniyor / Spinner */
.loading-box {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 10px;
  text-align: center;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  border-right-color: var(--accent-3);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 14px;
}

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

/* Hata & Bilgi Mesajları */
.alert-box {
  margin-top: 20px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeIn var(--dur) var(--ease);
}

.alert-error {
  background: rgba(255, 59, 48, 0.15);
  border: 1px solid rgba(255, 59, 48, 0.35);
  color: #ff6b6b;
}

.alert-success {
  background: rgba(52, 199, 89, 0.15);
  border: 1px solid rgba(52, 199, 89, 0.35);
  color: #34c759;
}

/* -----------------------------------------
   Sonuç Bölümü (Result Box)
------------------------------------------ */
.result-box {
  margin-top: 30px;
  border-top: 1px solid var(--glass-border);
  padding-top: 28px;
  animation: slideUp var(--dur) var(--ease) both;
}

/* Reels / Tekli Medya Kartı */
.media-preview-card {
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.video-container {
  max-width: 380px;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.6);
  background: #000;
}

.video-container video {
  width: 100%;
  max-height: 480px;
  display: block;
  object-fit: cover;
}

.image-preview {
  max-width: 380px;
  width: 100%;
  max-height: 480px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.6);
}

.media-caption {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 500px;
  word-break: break-word;
  line-height: 1.5;
}

/* İndirme Butonları Grubu */
.download-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.btn-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}

.btn-dl-primary {
  background: linear-gradient(45deg, #00d2ff, #0099ff);
  color: #051020;
  box-shadow: 0 10px 25px rgba(0, 210, 255, 0.25);
}

.btn-dl-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 14px 35px rgba(0, 210, 255, 0.35);
}

.btn-dl-secondary {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid var(--glass-border);
  color: #fff;
}

.btn-dl-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

/* -----------------------------------------
   Profil Kartı (HD Profil Resmi Görünümü)
------------------------------------------ */
.profile-card {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.profile-avatar-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  padding: 4px;
  background: var(--accent-gradient);
  box-shadow: 0 12px 35px rgba(255, 43, 122, 0.3);
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #111;
  border: 3px solid #090d1a;
}

.profile-details h2 {
  font-size: 1.5rem;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.badge-verified {
  color: #00d2ff;
  font-size: 1.1rem;
}

.profile-username {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 2px;
}

.profile-stats {
  display: flex;
  gap: 24px;
  margin: 14px 0 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-pill);
}

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

.stat-value {
  font-size: 1.15rem;
  font-weight: 750;
  color: #fff;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-bio {
  max-width: 520px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-line;
}

/* -----------------------------------------
   Carousel & Story Galeri Grid'i
------------------------------------------ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  width: 100%;
  margin-top: 18px;
}

.gallery-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.22);
}

.gallery-thumb {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #111;
}

.gallery-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  justify-content: space-between;
}

.gallery-tag {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* -----------------------------------------
   Ayarlar Modalı (Modal Dialog)
------------------------------------------ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: #121528;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-header h3 {
  font-size: 1.25rem;
  color: #fff;
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.btn-close-modal:hover { color: #fff; }

.modal-body p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.modal-body ol {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-left: 20px;
  margin-bottom: 18px;
  line-height: 1.6;
}

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

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

.form-group input {
  padding: 12px 16px;
  width: 100%;
}

/* -----------------------------------------
   Reklam & Bilgi Alanları
------------------------------------------ */
.ad-space {
  width: 100%;
  min-height: 90px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.info-section {
  max-width: 820px;
  width: 100%;
  color: var(--text-secondary);
  margin-top: 40px;
  line-height: 1.65;
}

.info-section h2 {
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 14px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.feature-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.feature-box h4 {
  color: #fff;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.feature-box p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Footer */
footer {
  margin-top: auto;
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Animasyonlar */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* Duyarlı (Responsive) Tasarım */
@media (max-width: 650px) {
  .downloader-card { padding: 22px 18px; border-radius: 18px; }
  h1 { font-size: 1.85rem; }
  .subtitle { font-size: 0.95rem; }
  .tabs-nav { gap: 6px; }
  .tab-btn { padding: 8px 14px; font-size: 0.84rem; }
  input[type="text"], input[type="url"] { padding: 15px 100px 15px 44px; font-size: 0.95rem; }
  .btn-submit { font-size: 0.98rem; padding: 15px; }
  .profile-stats { gap: 14px; padding: 8px 14px; }
  .stat-value { font-size: 1rem; }
  .gallery-grid { grid-template-columns: 1fr; }
}
