/* ===== This 2 That — Premium Dark Theme ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #0f172a;
  --bg-light: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.5);
  --accent: #06b6d4;
  --accent-hover: #22d3ee;
  --accent-glow: rgba(6, 182, 212, 0.3);
  --secondary: #f59e0b;
  --secondary-hover: #fbbf24;
  --text: #cbd5e1;
  --text-muted: #64748b;
  --text-bright: #f1f5f9;
  --border: rgba(148, 163, 184, 0.1);
  --border-hover: rgba(6, 182, 212, 0.4);
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(148, 163, 184, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(6, 182, 212, 0.15);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle background grid pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(6, 182, 212, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ===== GRADIENT TEXT ===== */
.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== GLASS CARD MIXIN ===== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

/* ===== NAV ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: 64px;
}

.nav-logo {
  font-family: 'Space Grotesk', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.nav-logo .t2t-this { color: var(--accent); }
.nav-logo .t2t-2 { color: var(--secondary); font-size: 1.3rem; }
.nav-logo .t2t-that { color: var(--text-bright); }

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all var(--transition);
}

.nav-links a:hover {
  color: var(--accent);
  background: rgba(6, 182, 212, 0.08);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 100px 0 80px;
  position: relative;
}

/* Hero glow orb */
.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.1;
}

.hero .subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 16px;
  font-weight: 400;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 50px;
  font-size: 0.875rem;
  color: var(--accent);
  margin-bottom: 48px;
}

.trust-badge .lock { font-size: 1rem; }

/* ===== SEARCH ===== */
.search-wrap {
  max-width: 600px;
  margin: 0 auto 0;
  position: relative;
}

.search-wrap input {
  width: 100%;
  padding: 18px 24px 18px 52px;
  background: var(--bg-light);
  border: 2px solid var(--border);
  border-radius: 50px;
  color: var(--text-bright);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
}

.search-wrap input::placeholder { color: var(--text-muted); }

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.1);
}

.search-wrap .search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 360px;
  overflow-y: auto;
  display: none;
  z-index: 50;
  box-shadow: var(--shadow);
}

.search-results.active { display: block; }

.search-results a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: 0.925rem;
  transition: background var(--transition);
}

.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: rgba(6, 182, 212, 0.06); color: var(--accent); }
.search-results .sr-arrow { color: var(--accent); font-weight: 600; }
.search-results .sr-category { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== SECTIONS ===== */
.section { padding: 80px 0; }

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  text-align: center;
  margin-bottom: 48px;
  font-weight: 600;
}

/* ===== CATEGORY GRID ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.category-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 36px 24px 28px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  display: block;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
}

.category-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.category-card:hover::before { opacity: 1; }

.category-card .emoji {
  font-size: 2.8rem;
  margin-bottom: 16px;
  display: block;
  position: relative;
}

.category-card h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
  position: relative;
}

.category-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  position: relative;
}

/* ===== FEEDBACK BAR ===== */
.feedback-bar {
  padding: 20px 0;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}
.feedback-btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  background: rgba(239,68,68,0.1);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.2);
  transition: all 0.2s;
}
.feedback-btn:hover { background: rgba(239,68,68,0.2); }
.feedback-btn-alt {
  background: rgba(6,182,212,0.1);
  color: #22d3ee;
  border: 1px solid rgba(6,182,212,0.2);
}
.feedback-btn-alt:hover { background: rgba(6,182,212,0.2); }

/* ===== CATEGORY HEADERS ===== */
.category-header {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  color: #e2e8f0;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}

/* ===== POPULAR GRID ===== */
.popular-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.popular-card {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  text-align: center;
  font-weight: 500;
  font-size: 0.925rem;
  transition: all var(--transition);
  display: block;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.popular-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.12);
  color: var(--accent);
}

.popular-card .arrow {
  color: var(--accent);
  margin: 0 6px;
  font-weight: 700;
}

.popular-card .card-icon {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 8px;
}

/* ===== WHY SECTION ===== */
.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.why-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 40px 28px;
  text-align: center;
  transition: all var(--transition);
}

.why-card:hover {
  transform: translateY(-4px);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-glow);
}

.why-card .icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.6rem;
}

.why-card:nth-child(1) .icon-wrap { background: rgba(6, 182, 212, 0.12); }
.why-card:nth-child(2) .icon-wrap { background: rgba(245, 158, 11, 0.12); }
.why-card:nth-child(3) .icon-wrap { background: rgba(34, 197, 94, 0.12); }
.why-card:nth-child(4) .icon-wrap { background: rgba(168, 85, 247, 0.12); }

.why-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.why-card p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  list-style: none;
}

.footer-links a { color: var(--text-muted); font-size: 0.875rem; }
.footer-links a:hover { color: var(--accent); }

.footer-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text);
}

/* ===== CONVERTER PAGE ===== */
.converter-header {
  text-align: center;
  padding: 56px 0 36px;
}

.converter-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 10px;
}

.converter-header p { color: var(--text-muted); font-size: 1.05rem; }

.converter-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  padding-bottom: 60px;
}

/* ===== DROP ZONE ===== */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 72px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-light);
  position: relative;
  overflow: hidden;
}

/* Animated dashed border */
.drop-zone::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius);
  padding: 2px;
  background: conic-gradient(from 0deg, var(--accent), var(--secondary), var(--accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition);
  animation: spin-border 4s linear infinite;
}

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

.drop-zone:hover::before,
.drop-zone.dragover::before {
  opacity: 1;
}

.drop-zone.dragover {
  background: rgba(6, 182, 212, 0.04);
}

.drop-zone .icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  display: block;
  opacity: 0.8;
}

.drop-zone p { color: var(--text-muted); margin-bottom: 8px; }
.drop-zone .browse { color: var(--accent); font-weight: 600; cursor: pointer; }
.drop-zone input[type="file"] { display: none; }

/* ===== FILE PREVIEW ===== */
.file-preview {
  display: none;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}

.file-preview.active { display: block; }

.file-preview .preview-area {
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.file-preview img, .file-preview video, .file-preview audio {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-sm);
  display: block;
}

.file-info {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== SETTINGS PANEL ===== */
.settings-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}

.settings-panel h3 {
  font-size: 0.95rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.setting-group:last-child { margin-bottom: 0; }

.setting-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.setting-group label .value {
  color: var(--accent);
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

/* Custom range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-light);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-light);
  cursor: pointer;
}

/* ===== CONVERT BUTTON ===== */
.convert-btn {
  display: none;
  width: 100%;
  margin: 24px 0;
  padding: 16px 48px;
  background: linear-gradient(135deg, var(--accent), #0891b2);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.convert-btn.active { display: block; }

.convert-btn:hover {
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.3);
  transform: translateY(-2px);
}

.convert-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== OUTPUT SECTION ===== */
.output-section {
  display: none;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 20px;
  text-align: center;
}

.output-section.active { display: block; }

.output-section h3 {
  color: #22c55e;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.output-preview {
  margin-bottom: 16px;
}

.output-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-sm);
}

.output-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

.download-btn:hover {
  color: #fff;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
  transform: translateY(-2px);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  display: none;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  margin-top: 20px;
  overflow: hidden;
}

.progress-bar.active { display: block; }

.progress-bar .fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  transition: width 0.4s ease;
  position: relative;
}

.progress-bar .fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ===== SIDEBAR ===== */
.converter-sidebar h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}

.related-list { list-style: none; }
.related-list li { margin-bottom: 8px; }

.related-list a {
  display: block;
  padding: 12px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  transition: all var(--transition);
}

.related-list a:hover {
  border-color: var(--border-hover);
  color: var(--accent);
  transform: translateX(4px);
}

/* ===== SEO SECTION ===== */
.seo-section {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 40px;
  margin-top: 48px;
}

.seo-section h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.seo-section p, .seo-section li {
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.7;
}

.seo-section ol { padding-left: 20px; }
.seo-section li { margin-bottom: 10px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    gap: 4px;
  }
  .nav-links.open a { padding: 12px 16px; }
  .nav-toggle { display: block; }

  .hero { padding: 64px 0 48px; }
  .hero h1 { font-size: clamp(2rem, 8vw, 3rem); }

  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .category-card { padding: 24px 16px; }

  .popular-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .why-grid { grid-template-columns: 1fr; }

  .converter-layout { grid-template-columns: 1fr; }
  .converter-sidebar { order: 2; }

  .section { padding: 56px 0; }
}

@media (max-width: 480px) {
  .category-grid { grid-template-columns: 1fr 1fr; }
  .popular-grid { grid-template-columns: 1fr 1fr; }
  .drop-zone { padding: 48px 20px; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.6s ease forwards;
}

/* Stagger children */
.stagger > * {
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
}

.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.4s; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
