/* ==========================================================================
   MediaPulse - Modern Glassmorphic Dark Theme System
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #090d16;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 56, 0.85);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-highlight: rgba(99, 102, 241, 0.4);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --accent: #a855f7;
  --accent-secondary: #ec4899;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Font Families */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Radius & Transitions */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

/* Ambient Background Lights */
.glow-bg {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: var(--primary);
  top: -100px;
  left: -100px;
  animation: float-1 12s infinite alternate ease-in-out;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: var(--accent);
  bottom: 50px;
  right: -150px;
  animation: float-2 15s infinite alternate ease-in-out;
}

.glow-3 {
  width: 400px;
  height: 400px;
  background: var(--accent-secondary);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.25;
}

@keyframes float-1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 60px) scale(1.1); }
}

@keyframes float-2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-60px, -80px) scale(1.15); }
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

/* Header & Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.35rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.brand-name .highlight {
  background: linear-gradient(135deg, #a5b4fc, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-item {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-item:hover, .nav-item.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.badge {
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 600;
}

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

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Main Layout */
.main-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  position: relative;
  z-index: 10;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 3.5rem;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid var(--border-highlight);
  color: #a5b4fc;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 2.5rem auto;
}

/* Extractor Input Form */
.extractor-card {
  padding: 1.75rem;
  border: 1px solid var(--border-highlight);
  box-shadow: 0 20px 50px -15px rgba(99, 102, 241, 0.25);
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(10, 15, 26, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.input-icon {
  color: var(--text-subtle);
  font-size: 1.2rem;
}

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

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

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-icon-only {
  padding: 0.65rem;
  border-radius: var(--radius-sm);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-outline:hover {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
}

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

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

.hidden {
  display: none !important;
}

/* Quick Samples */
.quick-samples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.sample-label {
  font-size: 0.85rem;
  color: var(--text-subtle);
  font-weight: 600;
}

.sample-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.sample-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.color-ig { color: #e1306c; }
.color-tw { color: #38bdf8; }
.color-rd { color: #ff4500; }
.color-tt { color: #00f2fe; }

/* Section Headers */
.section-header {
  margin-bottom: 1.75rem;
}

.section-header.center {
  text-align: center;
}

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

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

.text-success { color: var(--success); }
.text-accent { color: var(--accent); }

.platform-badge {
  background: var(--primary-glow);
  color: #a5b4fc;
  border: 1px solid var(--border-highlight);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Results Display Container */
.results-section {
  margin-bottom: 3.5rem;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.result-card {
  padding: 2rem;
}

.result-media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

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

.media-preview-container {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-glass);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.media-preview-container video,
.media-preview-container img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  display: block;
}

.media-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.media-title {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.35;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.download-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.option-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.format-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.format-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.format-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.format-quality {
  font-weight: 700;
  color: var(--text-main);
}

.format-size {
  font-size: 0.8rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

/* Platforms Grid */
.platforms-section {
  margin-bottom: 4rem;
}

.platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.platform-card {
  padding: 1.5rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

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

.platform-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.platform-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
}

.ig-bg { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.tw-bg { background: #15202b; border: 1px solid rgba(255, 255, 255, 0.2); }
.rd-bg { background: #ff4500; }
.tt-bg { background: #000; border: 1px solid rgba(0, 242, 254, 0.4); }
.yt-bg { background: #ff0000; }
.im-bg { background: linear-gradient(135deg, #1bb76e, #00e676); }

.platform-status {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(16, 185, 129, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* History Section */
.history-section {
  margin-bottom: 3rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(18, 24, 38, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.history-item:hover {
  background: rgba(26, 35, 56, 0.8);
  border-color: rgba(255, 255, 255, 0.18);
}

.history-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
}

.history-thumb {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}

.history-text {
  overflow: hidden;
}

.history-url {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}

.history-date {
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.empty-history {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-subtle);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-highlight);
  color: var(--text-main);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

/* Footer */
.footer {
  border-top: 1px solid var(--border-glass);
  padding: 2rem 1.5rem;
  margin-top: 4rem;
  position: relative;
  z-index: 10;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-subtle);
  font-size: 0.88rem;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.footer-links {
  display: flex;
  gap: 1.5rem;
}
