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

:root {
  --bg-dark: #090d16;
  --card-bg: rgba(21, 29, 46, 0.75);
  --border-color: rgba(255, 255, 255, 0.1);
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --red-accent: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  line-height: 1.5;
}

.app-layout {
  width: 100%;
  max-width: 780px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Navbar Header */
.navbar {
  text-align: center;
  padding: 12px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 2rem;
  font-weight: 800;
}

.brand-icon {
  font-size: 2.2rem;
}

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

.badge-v2 {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.brand-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 6px;
}

/* AdSense Card Style */
.adsense-card {
  width: 100%;
  background: rgba(30, 41, 59, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  position: relative;
}

.ad-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  margin-bottom: 6px;
}

.ad-mock p {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Main Container */
.main-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.hero-section h1 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.35;
}

.highlight {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 10px;
}

/* Input Card */
.input-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.input-wrapper {
  display: flex;
  gap: 10px;
}

.input-wrapper input {
  flex: 1;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.btn-parse {
  padding: 0 24px;
  border-radius: 12px;
  border: none;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s, opacity 0.2s;
  white-space: nowrap;
}

.btn-parse:hover {
  opacity: 0.95;
}

.btn-parse:active {
  transform: scale(0.98);
}

.example-pills {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pill-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.pill-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

/* Result Section */
.result-section.hidden {
  display: none;
}

.result-card {
  background: var(--card-bg);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.media-preview {
  position: relative;
  width: 220px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.media-preview img {
  width: 100%;
  height: 125px;
  object-fit: cover;
  display: block;
}

.duration-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.media-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  color: #f8fafc;
}

.video-meta {
  display: flex;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.download-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.dl-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.15s, filter 0.2s;
}

.dl-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.dl-mp4 {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
}

.dl-mp3 {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
}

.dl-img {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

.dl-fmt {
  font-size: 0.9rem;
}

.dl-desc {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.feature-item {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
}

.feat-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.feature-item h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.feature-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Coupang Partners Container */
.coupang-container {
  background: linear-gradient(145deg, rgba(230, 0, 18, 0.08) 0%, rgba(30, 41, 59, 0.6) 100%);
  border: 1px solid rgba(230, 0, 18, 0.3);
  border-radius: 20px;
  padding: 24px;
}

.coupang-header {
  margin-bottom: 16px;
}

.coupang-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #f8fafc;
}

.coupang-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.coupang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.cp-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.cp-img-box {
  width: 50px;
  height: 50px;
  background: rgba(230, 0, 18, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.cp-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cp-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #ff4d4d;
}

.cp-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
}

.cp-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cp-link-btn {
  display: inline-block;
  margin-top: 4px;
  align-self: flex-start;
  background: #e60012;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
}

.cp-link-btn:hover {
  background: #cc0010;
}

.coupang-notice {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 16px;
  text-align: center;
}

/* Tip Box */
.tip-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 14px;
  padding: 16px 20px;
}

.tip-header {
  font-size: 0.92rem;
  color: #818cf8;
  margin-bottom: 6px;
}

.tip-content {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer */
.app-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  margin-top: 10px;
}

.copyright {
  font-size: 0.8rem;
  color: #64748b;
}

/* Responsive Breakdown */
@media (max-width: 640px) {
  .input-wrapper {
    flex-direction: column;
  }
  .btn-parse {
    justify-content: center;
    padding: 14px;
  }
  .result-card {
    flex-direction: column;
  }
  .media-preview {
    width: 100%;
  }
  .media-preview img {
    height: 180px;
  }
}
