/* ==========================================================================
   BAYU XD DOWNLOADER — NEOBRUTALISM DESIGN SYSTEM (NO EMOJIS, MINIMAL)
   ========================================================================== */

:root {
  --bg-main: #FFFDF0;
  --bg-card: #FFFFFF;
  --black: #000000;
  --white: #FFFFFF;
  
  --yellow-accent: #FFE600;
  --mint-accent: #00E599;
  --blue-accent: #0066FF;
  --sky-accent: #66B2FF;
  --pink-accent: #FF66C4;
  --lilac-accent: #E8DCFF;
  --coral-accent: #FF5757;
  --amber-accent: #FFB800;

  --border-thick: 3px solid #000000;
  --border-heavy: 4px solid #000000;
  
  --shadow-sm: 2px 2px 0px #000000;
  --shadow-md: 4px 4px 0px #000000;
  --shadow-lg: 6px 6px 0px #000000;
  --shadow-xl: 8px 8px 0px #000000;

  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-none: 0px;
  --radius-sm: 4px;
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

::selection {
  background-color: var(--yellow-accent);
  color: var(--black);
}

::-moz-selection {
  background-color: var(--yellow-accent);
  color: var(--black);
}

body {
  background-color: var(--bg-main);
  color: var(--black);
  font-family: var(--font-display);
  line-height: 1.5;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  transform: translateZ(0);
}

/* Always allow normal text interaction in inputs & textareas */
input, textarea {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}

/* Enabled ONLY when user intentionally holds/long-presses down on content text */
body.allow-selection,
body.allow-selection p,
body.allow-selection h1,
body.allow-selection h2,
body.allow-selection h3,
body.allow-selection .result-title,
body.allow-selection .platform-desc,
body.allow-selection .author-meta,
body.allow-selection .download-notice {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}

/* Buttons and interactive navigation elements are always immune to selection */
button, 
a, 
.btn-open-menu-main, 
.btn-open-menu-main *,
.platform-list-item, 
.platform-list-item *,
.btn-back, 
.btn-back *,
.btn-submit-main, 
.btn-submit-main *,
.btn-header-menu,
.btn-input-action,
.btn-clear,
.btn-retry,
.btn-close-result,
.btn-download-item,
.btn-download-item *,
.tag-pill, 
.chip-item, 
.pli-tag, 
.pli-badge, 
.platform-tag, 
.platform-badge, 
.status-pill, 
.logo-box, 
.brand-logo {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transform: translateZ(0);
}

/* Container */
.container {
  width: 100%;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ==========================================================================
   Ticker Marquee Bar
   ========================================================================== */
.ticker-bar {
  background-color: var(--yellow-accent);
  border-bottom: var(--border-thick);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 8px 0;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.ticker-inner {
  display: inline-block;
  white-space: nowrap;
  animation: tickerScroll 24s linear infinite;
}

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

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  background-color: var(--white);
  border-bottom: var(--border-heavy);
  padding: 14px 0;
  position: relative;
  width: 100%;
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--black);
}

.logo-box {
  background-color: var(--coral-accent);
  color: var(--white);
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 18px;
  padding: 4px 8px;
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
  display: inline-block;
}

.logo-text {
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  background-color: var(--white);
  border: 2px solid var(--black);
  box-shadow: var(--shadow-sm);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--mint-accent);
  border: 1.5px solid var(--black);
  border-radius: 50%;
  display: inline-block;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.8; }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  text-align: center;
  padding: 32px 0 20px;
}

.hero-title {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.03em;
  max-width: 780px;
  margin: 0 auto 10px;
}

.highlight-yellow {
  background-color: var(--yellow-accent);
  padding: 0 6px;
  border: 3px solid var(--black);
  box-shadow: 3px 3px 0px var(--black);
  display: inline-block;
}

.hero-subtitle {
  font-size: clamp(14px, 1.6vw, 16px);
  color: #333;
  font-weight: 500;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ==========================================================================
   VIEW CONTAINERS & SHARED BACK BUTTON
   ========================================================================== */
.view-container {
  margin-bottom: 48px;
  animation: viewFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: opacity, transform;
  transform: translateZ(0);
}

@keyframes viewFadeIn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.back-bar {
  margin-bottom: 18px;
}

.btn-back {
  background-color: var(--white);
  color: var(--black);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
  padding: 8px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  will-change: transform;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease;
}

.btn-back:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background-color: var(--yellow-accent);
}

.btn-back:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0px var(--black);
}

.back-arrow {
  font-size: 16px;
  font-weight: 900;
}

/* ==========================================================================
   VIEW 1: HOME LANDING VIEW
   ========================================================================== */
.home-center-box {
  text-align: center;
  max-width: 600px;
  margin: 20px auto 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.btn-open-menu-main {
  background-color: var(--yellow-accent);
  color: var(--black);
  font-family: var(--font-display);
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 900;
  letter-spacing: -0.01em;
  padding: 16px 28px;
  border: var(--border-heavy);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  will-change: transform;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  max-width: 400px;
  justify-content: center;
}

.btn-open-menu-main:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
  background-color: #FFD500;
}

.btn-open-menu-main:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-sm);
}

.btn-menu-icon {
  font-size: 22px;
  font-weight: 900;
}

.btn-menu-arrow {
  font-size: 20px;
  font-weight: 900;
  transition: transform 0.15s ease;
}

.btn-open-menu-main:hover .btn-menu-arrow {
  transform: translateX(4px);
}

.home-hint {
  font-size: 13px;
  color: #555;
  margin-top: 14px;
  font-weight: 500;
}

.supported-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
}

.chip-item {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background-color: var(--white);
  border: 1.5px solid var(--black);
  padding: 3px 8px;
  box-shadow: 2px 2px 0px var(--black);
}

/* ==========================================================================
   VIEW 2: COMPACT PLATFORM MENU (NO GIANT CARDS)
   ========================================================================== */
.menu-section-header {
  text-align: center;
  margin-bottom: 22px;
}

.menu-section-title {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 900;
  margin-bottom: 6px;
}

.menu-section-subtitle {
  font-size: 14px;
  color: #444;
}

/* ==========================================================================
   VIEW 2: 2-COLUMN PLATFORM GRID (Side by Side with Large App Icons)
   ========================================================================== */
.platform-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.platform-grid-card {
  background-color: var(--white);
  color: var(--black);
  border: var(--border-heavy);
  box-shadow: 4px 4px 0px var(--black);
  border-radius: 18px;
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  text-align: center;
  will-change: transform;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, background-color 0.18s ease;
  width: 100%;
}

.platform-grid-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 6px 6px 0px var(--black);
  background-color: #FAFAFE;
}

.platform-grid-card:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: 2px 2px 0px var(--black);
}

/* Large Authentic App Icon Box */
.pg-icon-box,
.app-icon-box {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 18px;
  border: 3px solid var(--black);
  box-shadow: 3.5px 3.5px 0px var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  overflow: hidden;
}

.platform-grid-card:hover .pg-icon-box {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: 4.5px 4.5px 0px var(--black);
}

/* Brand specific authentic backgrounds */
.pg-icon-all,
.app-icon-all {
  background-color: #FFE600;
  color: #12101A;
}

.pg-icon-tiktok,
.app-icon-tiktok {
  background-color: #000000;
  color: #FFFFFF;
}

.pg-icon-instagram,
.app-icon-instagram {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
  color: #FFFFFF;
}

.pg-icon-youtube,
.app-icon-youtube {
  background-color: #FF0000;
  color: #FFFFFF;
}

.pg-icon-twitter,
.app-icon-twitter {
  background-color: #000000;
  color: #FFFFFF;
}

.pg-icon-spotify,
.app-icon-spotify {
  background-color: #1ED760;
  color: #000000;
}

.pg-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--black);
}

/* ==========================================================================
   VIEW 3: DEDICATED PLATFORM DOWNLOADER
   ========================================================================== */
.platform-downloader-box {
  background-color: var(--white);
  border: var(--border-heavy);
  box-shadow: var(--shadow-xl);
  padding: 24px;
  max-width: 720px;
  margin: 0 auto 24px;
}

.platform-compact-header {
  background-color: #F8F6FF;
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.platform-tag {
  padding: 0;
  border: 2.5px solid var(--black);
}

.platform-compact-text {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.platform-name {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.platform-badge {
  background-color: var(--yellow-accent);
  color: var(--black);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border: 1.5px solid var(--black);
  box-shadow: 2px 2px 0px var(--black);
  white-space: nowrap;
}

/* Input Form */
.url-input-form {
  margin-bottom: 18px;
}

.input-container {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  background-color: var(--white);
  border: var(--border-heavy);
  box-shadow: var(--shadow-md);
  position: relative;
  height: 54px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.input-container:focus-within {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.url-input-field {
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  border: none;
  outline: none;
  background: transparent;
  color: var(--black);
  height: 100%;
}

.url-input-field::placeholder {
  color: #888;
  font-size: 13px;
  font-weight: 500;
}

.btn-input-action {
  flex: 0 0 auto;
  background-color: var(--yellow-accent);
  border: none;
  border-left: var(--border-heavy);
  padding: 0 16px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  color: var(--black);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  letter-spacing: 0.02em;
  transition: background-color 0.12s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn-input-action:hover {
  background-color: #FFD500;
}

.btn-input-action:active {
  background-color: #E6C000;
}

.btn-clear {
  flex: 0 0 auto;
  background-color: #FFDFDF;
  border-left: var(--border-thick);
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 800;
  padding: 0 12px;
}

.btn-clear:hover {
  background-color: #FFB5B5;
}

/* Validation Message */
.input-validation-msg {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  margin-top: 8px;
  border: 2px solid var(--black);
  box-shadow: 2px 2px 0px var(--black);
  display: inline-block;
}

.input-validation-msg.valid {
  background-color: var(--mint-accent);
  color: var(--black);
}

.input-validation-msg.invalid {
  background-color: #FFBDBD;
  color: #8A0000;
}

/* Official Cloudflare Turnstile Verification Wrapper */
.turnstile-wrapper {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 65px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.turnstile-wrapper.turnstile-highlight {
  animation: turnstileShake 0.45s ease-in-out;
  outline: 3px solid #FF3B30;
  background-color: #FFEAEA;
  padding: 6px;
}

@keyframes turnstileShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

/* Form Actions - Vibrant Green "Unduh" Button */
.form-actions {
  margin-top: 14px;
}

.btn-submit-main {
  width: 100%;
  background-color: var(--mint-accent);
  color: var(--black);
  border: var(--border-heavy);
  box-shadow: var(--shadow-md);
  padding: 15px 20px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  will-change: transform;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn-submit-main:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
  background-color: #00FF9D;
}

.btn-submit-main:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-sm);
}

.btn-submit-main:disabled {
  background-color: #DDD;
  color: #777;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-sm);
}

/* Quick Formats Bar */
.quick-formats-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 2px dashed #000000;
}

.qf-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #444;
}

.qf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  background-color: #F2F2F2;
  border: 2px solid var(--black);
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   State Containers: Loading, Error, Result
   ========================================================================== */
.state-container {
  margin-bottom: 48px;
  animation: fadeIn 0.2s ease-out;
}

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

/* Loading Card */
.loading-card {
  background-color: var(--white);
  border: var(--border-heavy);
  box-shadow: var(--shadow-xl);
  padding: 32px 20px;
  text-align: center;
}

.brutalist-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border: 5px solid #EEE;
  border-top: 5px solid var(--black);
  border-right: 5px solid var(--yellow-accent);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text h3 {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 4px;
}

.loading-text p {
  font-size: 13px;
  color: #555;
  margin-bottom: 20px;
}

.progress-stripe-bar {
  height: 12px;
  background: repeating-linear-gradient(
    45deg,
    var(--yellow-accent),
    var(--yellow-accent) 15px,
    var(--black) 15px,
    var(--black) 30px
  );
  border: var(--border-thick);
  animation: stripeMove 1s linear infinite;
}

@keyframes stripeMove {
  0% { background-position: 0 0; }
  100% { background-position: 42px 0; }
}

/* Error Card */
.error-card {
  background-color: #FFEAE8;
  border: var(--border-heavy);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.error-tag {
  background-color: #9E0000;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border: 2px solid var(--black);
  box-shadow: 2px 2px 0px var(--black);
}

.error-content h3 {
  font-size: 18px;
  font-weight: 900;
  color: #9E0000;
  margin-bottom: 4px;
}

.error-content p {
  font-size: 13px;
  color: #333;
  line-height: 1.5;
  margin-bottom: 14px;
}

.btn-retry {
  background-color: var(--white);
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.btn-retry:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Result Card (Media Preview & Downloads)
   ========================================================================== */
.state-container {
  opacity: 1 !important;
  visibility: visible !important;
}

.result-card {
  background-color: var(--white);
  border: var(--border-heavy);
  box-shadow: var(--shadow-xl);
  padding: 24px;
  opacity: 1 !important;
  visibility: visible !important;
  animation: viewFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--black);
}

.result-platform-badge {
  background-color: var(--mint-accent);
  color: var(--black);
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
}

.btn-close-result {
  background-color: var(--bg-main);
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

/* ==========================================================================
   Media Player Container (Video & Audio Previews)
   ========================================================================== */
.media-player-container {
  margin-bottom: 16px;
}

.video-player-wrapper {
  background-color: var(--black);
  border: var(--border-heavy);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 480px;
  transition: max-width 0.25s cubic-bezier(0.16, 1, 0.3, 1), aspect-ratio 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Landscape / 16:9 Video */
.video-player-wrapper.is-landscape {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
}

/* Portrait / 9:16 Vertical Video (TikTok, Shorts, Reels) */
.video-player-wrapper.is-portrait {
  width: 100%;
  max-width: 270px;
  aspect-ratio: 9 / 16;
}

/* Square / 1:1 Video */
.video-player-wrapper.is-square {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
}

.preview-video-element {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: contain;
  background-color: var(--black);
  display: block;
  outline: none;
}

/* Image Preview Wrapper */
.image-player-wrapper {
  background-color: var(--white);
  border: var(--border-heavy);
  box-shadow: var(--shadow-md);
  padding: 12px;
}

.image-preview-frame {
  position: relative;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: hidden;
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
  height: 380px;
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1100px;
  -webkit-perspective: 1100px;
  perspective-origin: 50% 50%;
  touch-action: pan-y;
}

.coverflow-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.coverflow-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.coverflow-slide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  max-width: 290px;
  height: 90%;
  max-height: 340px;
  transform-origin: center center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
  background: transparent;
  border: none;
  overflow: hidden;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1), filter 0.4s ease, opacity 0.4s ease;
  will-change: transform, filter, opacity;
}

.coverflow-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
  display: block;
  pointer-events: none;
  background-color: var(--white);
}

.coverflow-slide .slide-dark-overlay {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.coverflow-slide.is-prev .slide-dark-overlay,
.coverflow-slide.is-next .slide-dark-overlay {
  opacity: 1;
}

.coverflow-slide.is-active {
  cursor: default;
}

.coverflow-slide.is-active img {
  border: 3px solid var(--yellow-accent);
  box-shadow: var(--shadow-md), 0 8px 24px rgba(0, 0, 0, 0.25);
}

.image-slide-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: var(--yellow-accent);
  color: var(--black);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border: 1.5px solid var(--black);
  box-shadow: 1.5px 1.5px 0px var(--black);
  z-index: 5;
}

/* Floating Overlay Arrow Buttons (< >) */
.btn-slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(18, 16, 26, 0.82);
  color: var(--yellow-accent);
  border: 2px solid var(--black);
  box-shadow: 2px 2px 0px var(--black);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.15s ease, transform 0.12s ease, color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.btn-slide-arrow:hover {
  background-color: var(--yellow-accent);
  color: var(--black);
  transform: translateY(-50%) scale(1.08);
}

.btn-slide-arrow:active {
  transform: translateY(-50%) scale(0.94);
}

.btn-slide-arrow:disabled {
  opacity: 0.25;
  pointer-events: none;
  cursor: not-allowed;
}

.btn-slide-prev {
  left: 8px;
}

.btn-slide-next {
  right: 8px;
}

.image-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 8px;
}

.btn-carousel-nav {
  background-color: #F0EDFF;
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
  padding: 6px 12px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.12s ease, transform 0.1s ease;
}

.btn-carousel-nav:hover {
  background-color: var(--yellow-accent);
  transform: translateY(-1px);
}

.btn-carousel-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.carousel-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

/* Active Photo Download Box */
.active-photo-download-box {
  margin-top: 12px;
  width: 100%;
}

.active-photo-card {
  background-color: #FFFDF0;
  border: var(--border-heavy);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
}

.active-photo-card:hover {
  border-color: var(--black);
  box-shadow: var(--shadow-md);
}

.active-photo-card .btn-dl-action-trigger {
  background-color: var(--yellow-accent);
  min-width: 110px;
}

.active-photo-card .btn-dl-action-trigger:hover {
  background-color: var(--mint-accent);
}

.audio-player-wrapper {
  background-color: #FAFAFA;
  border: var(--border-heavy);
  box-shadow: var(--shadow-md);
  padding: 14px;
}

.audio-player-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

@media (max-width: 500px) {
  .audio-player-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

.audio-cover-box {
  width: 80px;
  height: 80px;
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  flex-shrink: 0;
  background-color: var(--black);
}

.audio-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.audio-player-info {
  flex-grow: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audio-preview-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  background-color: var(--mint-accent);
  border: 1.5px solid var(--black);
  padding: 2px 8px;
  display: inline-block;
  align-self: flex-start;
}

.preview-audio-element {
  width: 100%;
  height: 42px;
  outline: none;
}

.caption-container {
  background-color: var(--white);
  border: 2px solid var(--black);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.caption-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.result-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  color: var(--black);
  word-break: break-word;
}

/* Collapsible Detail Info Button */
.btn-toggle-details {
  width: 100%;
  background-color: #F0EDFF;
  color: var(--black);
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
  padding: 9px 14px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
  will-change: transform;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn-toggle-details:hover {
  background-color: var(--yellow-accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-toggle-details:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0px var(--black);
}

.toggle-icon {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

/* Collapsible Detail Box Container */
.result-details-collapsible {
  background-color: #FAFAFA;
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 18px;
  animation: detailSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes detailSlide {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.details-content-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 600px) {
  .details-content-box {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
    align-items: start;
  }
}

/* Preview Media Box in Collapsible */
.preview-media-box {
  position: relative;
  background-color: var(--black);
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
  aspect-ratio: 16 / 9;
  max-height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duration-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background-color: var(--black);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border: 1px solid var(--white);
}

.details-meta-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.author-meta {
  background-color: var(--white);
  border: 2px solid var(--black);
  padding: 8px 12px;
  font-size: 13px;
}

.author-label {
  display: block;
  font-size: 10px;
  color: #666;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
}

.author-meta strong {
  display: block;
  font-size: 14px;
  color: var(--black);
  font-weight: 800;
  margin-top: 2px;
}

.result-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stat-item {
  background-color: #E8F0FE;
  border: 1.5px solid var(--black);
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.result-options-section {
  margin-top: 8px;
}

.download-section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #444;
  margin-bottom: 10px;
}

.download-buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

/* Block native long-press download popups on preview media */
.media-player-container,
.video-player-wrapper,
.preview-video-element,
.image-player-wrapper,
.image-preview-frame,
.preview-image-element,
.audio-player-wrapper,
.audio-cover-box,
.audio-cover-img,
.preview-media-box,
.preview-thumb {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
}

/* Download Item Card (Interactive Card, click trigger on SIMPAN button only) */
.download-item-card {
  background-color: var(--white);
  color: var(--black);
  border: var(--border-heavy);
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease, background-color 0.15s ease;
}

.download-item-card:hover {
  background-color: #FAFAFA;
}

.dl-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.dl-card-info-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.dl-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.btn-dl-type {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
  background-color: var(--yellow-accent);
  border: 1.5px solid var(--black);
  box-shadow: 1.5px 1.5px 0px var(--black);
  padding: 2px 6px;
  flex-shrink: 0;
}

.btn-dl-label {
  font-weight: 800;
  font-size: 13.5px;
  line-height: 1.25;
  color: var(--black);
  white-space: normal;
  word-break: break-word;
}

.dl-card-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-dl-badge {
  background-color: #F4F0FF;
  border: 1.5px solid var(--black);
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}

.dl-card-action-col {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Clickable SIMPAN Action Button Only */
.btn-dl-action-trigger {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 12px;
  background-color: var(--mint-accent);
  color: var(--black);
  padding: 9px 14px;
  border: 2px solid var(--black);
  box-shadow: 2px 2px 0px var(--black);
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  will-change: transform;
  transition: transform 0.1s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.1s ease, background-color 0.1s ease;
}

.btn-dl-action-trigger:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--black);
  background-color: #00FF9D;
}

.btn-dl-action-trigger:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px var(--black);
}

.btn-dl-action-trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Card Progress Mode (0-100%) */
.dl-card-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 6px 0;
  animation: progressCardFadeIn 0.15s ease-out forwards;
}

@keyframes progressCardFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.dl-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 900;
}

.dl-progress-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--black);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.dl-progress-percent {
  background-color: var(--yellow-accent);
  color: var(--black);
  border: 2px solid var(--black);
  box-shadow: 2px 2px 0px var(--black);
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 900;
  min-width: 48px;
  text-align: center;
}

.dl-progress-track {
  width: 100%;
  height: 16px;
  background-color: #EAEAEA;
  border: 2px solid var(--black);
  overflow: hidden;
  position: relative;
}

.dl-progress-bar {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    -45deg,
    #00E599,
    #00E599 12px,
    #4DFFB8 12px,
    #4DFFB8 24px
  );
  background-size: 200% 200%;
  animation: downloadStripe 0.6s linear infinite;
  transition: width 0.06s linear;
}

.download-item-card.is-finished {
  background-color: #E6FFF2 !important;
  border-color: #000000 !important;
}

.download-item-card.is-finished .dl-progress-label {
  color: #006633 !important;
}

.download-item-card.is-finished .dl-progress-percent {
  background-color: var(--mint-accent) !important;
}

.download-notice {
  background-color: #F8F8F8;
  border: 2px dashed #000000;
  padding: 8px 12px;
  font-size: 11px;
  color: #444;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: var(--white);
  border-top: var(--border-heavy);
  padding: 28px 0 24px;
  margin-top: auto;
}

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

.footer-left {
  max-width: 480px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  margin-bottom: 6px;
}

.footer-disclaimer {
  font-size: 11px;
  color: #666;
  line-height: 1.4;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.footer-badge {
  background-color: var(--yellow-accent);
  border: 2px solid var(--black);
  box-shadow: 2px 2px 0px var(--black);
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
}

.copyright-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #444;
}

/* ==========================================================================
   Toast Notification Modal
   ========================================================================== */
.toast-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--yellow-accent);
  color: var(--black);
  border: var(--border-thick);
  box-shadow: var(--shadow-lg);
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  animation: slideInUp 0.15s ease-out;
}

.toast-tag {
  background-color: var(--black);
  color: var(--white);
  padding: 2px 6px;
  font-size: 10px;
}

@keyframes slideInUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 768px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }

  .result-body-grid {
    grid-template-columns: 1fr;
  }
  
  .header-flex {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .footer-flex {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-right {
    align-items: flex-start;
  }
}

@media (max-width: 500px) {
  .platform-downloader-card {
    padding: 18px 14px;
  }

  .platform-list {
    gap: 12px;
  }

  .platform-grid-card {
    padding: 18px 10px 14px;
    gap: 10px;
    border-radius: 14px;
  }
  
  .pg-icon-box {
    width: 54px;
    height: 54px;
    min-width: 54px;
    border-radius: 14px;
  }

  .pg-icon-box svg {
    width: 28px;
    height: 28px;
  }
  
  .pg-name {
    font-size: 14px;
  }

  .platform-header-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
  }

  .input-container {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    height: 52px;
  }

  .url-input-field {
    font-size: 13px;
    padding: 0 12px;
    height: 100%;
  }

  .btn-input-action {
    width: auto;
    border-left: var(--border-heavy);
    border-top: none;
    padding: 0 14px;
    font-size: 13px;
    height: 100%;
  }

  .btn-clear {
    width: auto;
    position: static;
    border-left: var(--border-thick);
    border-top: none;
    height: 100%;
    padding: 0 10px;
  }

  .btn-submit-main {
    font-size: 15px;
    padding: 12px;
  }

  .btn-download-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .btn-dl-right {
    width: 100%;
    justify-content: space-between;
  }
}
