/* ==========================================================================
   ALFAPROJECTS DESIGN SYSTEM (STRICT ANTISLOP CRAFTSMANSHIP)
   Brand: AlfaProjects | Domain: perseverance.my.id
   Dials: ENERGY 3 | RHYTHM 2 | MOTION 2
   No AI Slop: No purple-blue gradients, no random emojis, no raw JSON dumps.
   ========================================================================== */

:root {
  /* Color Palette (WCAG AAA Compliant) */
  --color-canvas: #090d16;        /* Deep Obsidian Night */
  --color-surface: #111726;       /* Solid Navy Slate */
  --color-surface-hover: #172033;
  --color-surface-active: #1d2840;
  --color-surface-subtle: #0d1320;
  --color-border: #1e293b;        /* Slate 800 Solid */
  --color-border-hover: #334155;
  --color-border-focus: #f97316;

  --color-text-primary: #f8fafc;  /* Slate 50 (> 15:1 contrast) */
  --color-text-muted: #94a3b8;    /* Slate 400 (> 6.5:1 contrast, WCAG AAA) */
  --color-text-subtle: #64748b;   /* Slate 500 */

  --color-accent: #f97316;        /* Warm Tangerine */
  --color-accent-hover: #ea580c;
  --color-accent-subtle: rgba(249, 115, 22, 0.12);
  --color-accent-border: rgba(249, 115, 22, 0.35);

  --color-success: #10b981;       /* Emerald */
  --color-success-subtle: rgba(16, 185, 129, 0.12);
  --color-danger: #ef4444;        /* Crimson Red */
  --color-danger-subtle: rgba(239, 68, 68, 0.12);
  --color-warning: #f59e0b;       /* Amber */

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 36px;
  --space-2xl: 48px;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Layout */
  --max-width: 1200px;
  --header-height: 64px;
  --bottom-nav-height: 60px;
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--color-canvas);
  color: var(--color-text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--color-canvas);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--color-canvas);
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: var(--radius-xs);
}

::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.font-mono {
  font-family: var(--font-mono);
}

.hidden {
  display: none !important;
}

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

.text-error {
  color: #fca5a5;
}

.w-full {
  width: 100%;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.95);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-md);
}

/* Brand */
.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-badge-icon {
  width: 34px;
  height: 34px;
  background: var(--color-surface);
  border: 1px solid var(--color-accent-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-symbol {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-accent);
  line-height: 1;
}

.brand-text-group {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.brand-domain {
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  color: var(--color-text-subtle);
}

/* Universal Command Search Bar */
.header-search-wrap {
  position: relative;
  flex: 1;
  max-width: 440px;
}

.header-search-box {
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-search-box:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.search-icon {
  width: 15px;
  height: 15px;
  color: var(--color-text-subtle);
  margin-right: 8px;
  flex-shrink: 0;
}

.header-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--color-text-primary);
}

.header-search-box input::placeholder {
  color: var(--color-text-subtle);
}

.search-shortcut-hint {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-text-subtle);
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  padding: 2px 5px;
  border-radius: var(--radius-xs);
  margin-left: 6px;
  user-select: none;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85);
  z-index: 150;
  max-height: 380px;
  overflow-y: auto;
}

.search-suggest-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background-color 0.15s ease;
  position: relative;
}

.search-suggest-item:last-child {
  border-bottom: none;
}

.search-suggest-item:hover {
  background-color: var(--color-surface-hover);
}

.suggest-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.suggest-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.suggest-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

.search-suggest-empty {
  padding: 16px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
}

/* Header Status */
.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-success);
  background: var(--color-success-subtle);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--color-success);
  border-radius: 50%;
  animation: pulseDot 2s infinite ease-in-out;
}

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

/* Nav Tab Bar (Horizontal Hubs) */
.nav-scroll-container {
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.desktop-nav {
  display: none;
  gap: 4px;
  min-width: max-content;
}

@media (min-width: 860px) {
  .desktop-nav {
    display: flex;
  }
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 38px;
}

.nav-tab .icon {
  width: 16px;
  height: 16px;
}

.nav-tab:hover {
  color: var(--color-text-primary);
  background: var(--color-surface);
  border-color: var(--color-border);
}

.nav-tab.active {
  color: var(--color-text-primary);
  background: var(--color-surface);
  border-color: var(--color-accent);
}

/* ==========================================================================
   MAIN WORKSPACE & VIEWS
   ========================================================================== */

.site-main {
  flex: 1;
  padding: var(--space-xl) 0 calc(var(--bottom-nav-height) + var(--space-xl));
}

@media (min-width: 860px) {
  .site-main {
    padding: var(--space-xl) 0 var(--space-2xl);
  }
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: viewFade 0.2s ease forwards;
}

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

/* View Header */
.view-header-flex {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--space-lg);
}

@media (min-width: 768px) {
  .view-header-flex {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.view-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
}

.view-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 2px;
  max-width: 680px;
}

/* Hero section for Downloader */
.hero-compact {
  margin-bottom: var(--space-lg);
}

/* ==========================================================================
   CARDS & FORMS
   ========================================================================== */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.card-input {
  margin-bottom: var(--space-lg);
}

.card-title-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .icon {
  width: 18px;
  height: 18px;
  color: var(--color-accent);
}

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

/* Form Elements */
.form-group {
  margin-bottom: var(--space-md);
}

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

.form-input {
  width: 100%;
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 44px;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

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

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .form-row-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-inline-search {
  display: flex;
  gap: 8px;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-accent);
  color: #ffffff;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
  min-height: 44px;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-canvas);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  min-height: 44px;
}

.btn-secondary:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  min-height: 34px;
}

.btn-block {
  width: 100%;
}

.btn-text-only {
  background: transparent;
  border: none;
  color: var(--color-text-subtle);
  font-family: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
}

.btn-text-only:hover {
  color: var(--color-text-muted);
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: var(--radius-xs);
}

.btn-close:hover {
  color: var(--color-text-primary);
}

/* ==========================================================================
   DOWNLOADER VIEW
   ========================================================================== */

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-prefix {
  position: absolute;
  left: 14px;
  color: var(--color-text-subtle);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.input-icon-prefix .icon {
  width: 18px;
  height: 18px;
}

.form-input-with-icon {
  padding-left: 42px;
  padding-right: 90px;
  font-size: 0.9375rem;
}

.input-actions-suffix {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon-clear {
  background: transparent;
  border: none;
  color: var(--color-text-subtle);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}

.btn-paste {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 30px;
}

.btn-paste:hover {
  color: var(--color-text-primary);
  border-color: var(--color-border-hover);
}

.btn-paste .icon {
  width: 12px;
  height: 12px;
}

.yt-options {
  margin: var(--space-md) 0;
  padding: 12px;
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 640px) {
  .yt-options {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.yt-options-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.radio-group {
  display: flex;
  gap: var(--space-md);
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--color-text-muted);
}

.radio-label input {
  display: none;
}

.radio-custom {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  position: relative;
}

.radio-label input:checked + .radio-custom {
  border-color: var(--color-accent);
}

.radio-label input:checked + .radio-custom::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
}

.radio-label input:checked ~ span:last-child {
  color: var(--color-text-primary);
  font-weight: 600;
}

/* Platform Chips */
.platform-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: var(--space-md) 0;
  -webkit-overflow-scrolling: touch;
}

.chip-item {
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 32px;
}

.chip-item:hover {
  color: var(--color-text-primary);
  border-color: var(--color-border-hover);
}

.chip-item.active {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Result Card */
.card-result {
  margin-top: var(--space-lg);
  border-color: var(--color-border-hover);
  animation: viewFade 0.2s ease;
}

.result-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

@media (min-width: 640px) {
  .result-header {
    flex-direction: row;
    align-items: flex-start;
  }
}

.result-thumb {
  width: 100%;
  max-width: 220px;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.result-info {
  flex: 1;
}

.result-platform-badge {
  display: inline-block;
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.result-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.35;
}

.result-author {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

/* History */
.history-section {
  margin-top: var(--space-xl);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  gap: 12px;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.history-title {
  font-size: 0.8125rem;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   AI STUDIO VIEW
   ========================================================================== */

.subtabs-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.ai-subtab-btn, .tool-filter-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 38px;
}

.ai-subtab-btn:hover, .tool-filter-btn:hover {
  color: var(--color-text-primary);
  border-color: var(--color-border-hover);
}

.ai-subtab-btn.active, .tool-filter-btn.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* Chat */
.chat-card {
  display: flex;
  flex-direction: column;
  height: 520px;
  padding: 0;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--color-surface-subtle);
  border-bottom: 1px solid var(--color-border);
}

.chat-model-select-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-label-inline {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.form-select-sm {
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  outline: none;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  display: flex;
  width: 100%;
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-message.assistant {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-message.user .chat-bubble {
  background-color: var(--color-accent);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.chat-message.assistant .chat-bubble {
  background-color: var(--color-canvas);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 2px;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

/* ==========================================================================
   TOOLS & BESPOKE VISUAL RESULTS (NO JSON SLOP!)
   ========================================================================== */

.grid-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}

.tool-action-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.tool-action-card:hover {
  border-color: var(--color-accent);
  background: var(--color-surface-hover);
  transform: translateY(-2px);
}

.tool-icon-box {
  width: 36px;
  height: 36px;
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}

.tool-icon-box .icon {
  width: 18px;
  height: 18px;
}

.tool-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.tool-desc {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* 1. BESPOKE BANK CARD RESULT */
.debit-card-mockup {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  margin-top: 14px;
}

.debit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.bank-logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-emv-chip {
  width: 38px;
  height: 28px;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  border-radius: 4px;
  border: 1px solid #b45309;
}

.card-acc-number {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  letter-spacing: 0.15em;
  margin-bottom: 18px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.debit-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.card-holder-label {
  font-size: 0.65rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-holder-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f8fafc;
}

.card-status-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

/* 2. BESPOKE TAX SLIP (STNK PKB) */
.tax-slip-card {
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 14px;
}

.tax-slip-header {
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.tax-plat-number {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-accent);
}

.tax-vehicle-name {
  font-size: 0.95rem;
  color: var(--color-text-primary);
  font-weight: 600;
}

.tax-grid-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 0.8125rem;
  margin-bottom: 12px;
}

.tax-label {
  color: var(--color-text-subtle);
}

.tax-value {
  color: var(--color-text-primary);
  font-weight: 600;
  text-align: right;
}

.tax-total-bar {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 10px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tax-total-amount {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: #34d399;
}

/* 3. BESPOKE TRACKING TIMELINE */
.tracking-stepper {
  position: relative;
  padding-left: 24px;
  margin-top: 16px;
}

.tracking-stepper::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 2px;
  background: var(--color-border);
}

.tracking-step {
  position: relative;
  padding-bottom: 16px;
}

.tracking-step::before {
  content: '';
  position: absolute;
  top: 4px;
  left: -21px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
}

.tracking-step.completed::before {
  background: var(--color-accent);
}

.tracking-step-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.tracking-step-desc {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.tracking-step-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-subtle);
}

/* 4. BESPOKE SEISMIC BMKG BOX */
.seismic-radar-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.seismic-header-bar {
  display: flex;
  gap: 14px;
  align-items: center;
}

.seismic-mag-disc {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--color-danger);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.seismic-mag-val {
  font-size: 1.25rem;
  line-height: 1;
}

.seismic-mag-unit {
  font-size: 0.65rem;
}

.seismic-wilayah-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.seismic-grid-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.seismic-tsunami-status {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-danger-subtle);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 0.8125rem;
  font-weight: 600;
}

/* 5. BESPOKE TWITTER CARD MOCKUP */
.tweet-mockup {
  background: #000000;
  border: 1px solid #2f3336;
  border-radius: 12px;
  padding: 16px;
  color: #e7e9ea;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin-top: 14px;
}

.tweet-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.tweet-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #333;
}

.tweet-user-info {
  display: flex;
  flex-direction: column;
}

.tweet-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: #f7f9f9;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tweet-handle {
  font-size: 0.875rem;
  color: #71767b;
}

.tweet-body {
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.tweet-time {
  font-size: 0.8125rem;
  color: #71767b;
  border-bottom: 1px solid #2f3336;
  padding-bottom: 12px;
  margin-bottom: 10px;
}

.tweet-metrics {
  display: flex;
  gap: 18px;
  font-size: 0.8125rem;
  color: #71767b;
}

/* ==========================================================================
   ANIME & MANGA CATALOGS
   ========================================================================== */

.grid-catalog {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .grid-catalog {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-catalog {
    grid-template-columns: repeat(5, 1fr);
  }
}

.catalog-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.catalog-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent);
}

.catalog-thumb-box {
  position: relative;
  width: 100%;
  padding-top: 140%;
  background: var(--color-canvas);
  overflow: hidden;
}

.catalog-thumb-box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-badge-top {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
}

.catalog-content {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.catalog-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog-sub-info {
  font-size: 0.75rem;
  color: var(--color-text-subtle);
}

/* ==========================================================================
   MODALS & DRAWERS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
}

/* Player Frame */
.player-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
}

.player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.player-loading {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.mirror-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.mirror-btn {
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.mirror-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-text-primary);
}

.mirror-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 8px;
}

.episode-btn {
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.episode-btn:hover {
  border-color: var(--color-accent);
}

.episode-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* Manga Vertical Reader */
.reader-view {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 250;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reader-toolbar {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(9, 13, 22, 0.95);
  border-bottom: 1px solid var(--color-border);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.reader-chapter-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.reader-pages {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #000;
}

.reader-pages img {
  width: 100%;
  height: auto;
  display: block;
}

.reader-bottom-bar {
  width: 100%;
  max-width: 800px;
  padding: 24px 16px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* ==========================================================================
   MOBILE BOTTOM BAR & DRAWER
   ========================================================================== */

.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: rgba(9, 13, 22, 0.96);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(10px);
}

@media (min-width: 860px) {
  .mobile-nav {
    display: none;
  }
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--color-text-subtle);
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  height: 100%;
  min-height: 44px;
}

.mobile-nav-btn .icon {
  width: 20px;
  height: 20px;
}

.mobile-nav-btn.active {
  color: var(--color-accent);
}

.drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.drawer-tab-btn {
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  cursor: pointer;
  text-align: left;
  min-height: 64px;
}

.drawer-tab-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-accent);
}

.drawer-icon-box {
  color: var(--color-accent);
  margin-bottom: 2px;
}

.drawer-icon-box .icon {
  width: 20px;
  height: 20px;
}

.drawer-name {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-text-primary);
}

.drawer-count {
  font-size: 0.75rem;
  color: var(--color-text-subtle);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-canvas);
  padding: var(--space-lg) 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
  }
}

.footer-brand {
  font-weight: 800;
  color: var(--color-text-primary);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 12px);
  right: var(--space-md);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

@media (min-width: 860px) {
  .toast-container {
    bottom: var(--space-lg);
  }
}

.toast {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75);
  pointer-events: auto;
}

.toast.toast-error {
  border-color: var(--color-danger);
  color: #fca5a5;
  background: #1c1518;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}

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

.catalog-status {
  text-align: center;
  padding: var(--space-xl) 0;
  color: var(--color-text-muted);
  grid-column: 1 / -1;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
}

.alert-error {
  background: var(--color-danger-subtle);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}
