/* ==========================================================================
   The Exam Archive × Kuru Apps - Scholarly Obsidian & Molten Gold Theme
   Permanent Multi-Platform Design System • Developed by Kumaran
   Strict compliance with Zero Light Chrome Leaks & WCAG AAA Contrast
   ========================================================================== */

@import url('kuru-theme.css');

:root {
  /* Mapping legacy application variables directly to kuru-theme.css tokens */
  --bg-app: var(--kuru-surface-canvas);
  --bg-surface: var(--kuru-surface-card);
  --bg-surface-elevated: var(--kuru-surface-modal);
  --bg-surface-control: var(--kuru-surface-control);
  --bg-surface-glass: rgba(20, 22, 29, 0.92);

  --border-subtle: var(--kuru-border-slate);
  --border-gold-hairline: var(--kuru-border-gold-hairline);
  --border-hover: var(--kuru-border-gold-hover);
  --border-focus: var(--kuru-border-gold-focus);

  --text-primary: var(--kuru-text-primary);
  --text-secondary: var(--kuru-text-secondary);
  --text-muted: var(--kuru-text-muted);
  --text-sublabel: var(--kuru-text-sublabel);
  --text-on-gold: var(--kuru-text-on-gold);

  --accent-primary: var(--kuru-gold-core);
  --accent-primary-hover: var(--kuru-gold-champagne);
  --accent-primary-glow: var(--kuru-glow-pill);
  --accent-gold: var(--kuru-gold-core);
  --gold-champagne: var(--kuru-gold-champagne);
  --gold-bronze: var(--kuru-gold-deep-bronze);
  --accent-ember: var(--kuru-molten-amber);
  --accent-ember-hover: var(--kuru-molten-deep-ember);

  --accent-youtube: #ef4444;
  --accent-youtube-glow: rgba(239, 68, 68, 0.25);
  --accent-download: var(--kuru-semantic-success);
  --accent-download-hover: #10b981;
  --accent-download-glow: rgba(52, 211, 153, 0.25);

  --badge-bg: var(--kuru-surface-control);
  --badge-text: var(--kuru-text-sublabel);
  --badge-disabled-bg: rgba(248, 113, 113, 0.12);
  --badge-disabled-border: rgba(248, 113, 113, 0.3);
  --badge-disabled-text: #fca5a5;

  --font-display: var(--kuru-font-display);
  --font-sans: var(--kuru-font-body);
  --font-mono: var(--kuru-font-mono);

  --radius-sm: var(--kuru-radius-sm);
  --radius-md: var(--kuru-radius-md);
  --radius-lg: var(--kuru-radius-lg);
  --radius-full: var(--kuru-radius-full);

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: var(--kuru-shadow-card);
  --shadow-lg: var(--kuru-shadow-modal);
  --shadow-gold-hover: var(--kuru-glow-hover);
}

/* ==========================================================================
   CSS Reset & Base Controls (Zero Light Chrome Leaks)
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  color-scheme: dark;
}

body {
  background: 
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.06) 0%, transparent 65%),
    radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 0% 50%, rgba(36, 40, 52, 0.35) 0%, transparent 45%),
    var(--bg-app);
  background-attachment: fixed;
}

/* Custom Scrollbars - Warm Amber Accent, Zero Chrome Leak */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-app);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Base Form Controls Dark Theme Enforcement */
input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
  color-scheme: dark;
}

input[type="text"], input[type="search"] {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  color: var(--text-primary);
  -webkit-appearance: none;
  appearance: none;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:hover, input[type="search"]:hover {
  border-color: var(--border-hover);
}

input[type="text"]:focus, input[type="search"]:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
  background-color: var(--bg-surface-elevated);
}

::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

dialog {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0;
  color-scheme: dark;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */

.app-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 48px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================================================
   Header: Rebranded Banner & Developer Credit
   ========================================================================== */

.hub-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  border-top: 1px solid var(--border-gold-hairline);
  margin-bottom: 24px;
  background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.brand-logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#brand-title {
  background: linear-gradient(135deg, #FAF8F5 15%, var(--gold-champagne) 45%, var(--accent-gold) 75%, var(--gold-bronze) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.brand-credit-tag {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-champagne);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 2px 9px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  -webkit-text-fill-color: var(--gold-champagne);
}

.brand-text p {
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

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

/* YouTube Channel Pill Link */
.btn-channel {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-channel:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Sync / Refresh Button */
.btn-sync {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-sync:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-sync.spinning .sync-icon {
  animation: spin 1s linear infinite;
}

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

.sheet-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* ==========================================================================
   Navigation Toolbar: Tabs & Search
   ========================================================================== */

.nav-toolbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 820px) {
  .nav-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.tab-group {
  display: flex;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-group::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

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

.tab-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.tab-count {
  font-size: 11px;
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

/* Search Input Box */
.search-wrapper {
  position: relative;
  min-width: 280px;
  max-width: 420px;
  width: 100%;
}

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

.search-input {
  width: 100%;
  padding-left: 36px !important;
  padding-right: 48px !important;
  font-size: 14px;
}

.search-shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hover);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  display: none;
  border-radius: var(--radius-sm);
}

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

/* ==========================================================================
   Videos View Sub-Toolbar: Filter Chips & Grouping View Toggle
   ========================================================================== */

.videos-toolbar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  min-width: 90px;
}

.chips-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.filter-chip.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #0c0a09;
  font-weight: 600;
  box-shadow: 0 0 10px var(--accent-primary-glow);
}

/* Grouping Toggle */
.group-view-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
  gap: 10px;
}

.group-toggle-title {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.group-btn-group {
  display: flex;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 2px;
  border-radius: var(--radius-md);
}

.group-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.group-btn.active {
  background: var(--border-subtle);
  color: var(--accent-gold);
  font-weight: 600;
}

/* Section Header for Grouped Views */
.grouped-sections-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 32px;
}

.video-group-section {
  width: 100%;
  margin-bottom: 12px;
}

.video-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.video-group-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-group-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--badge-bg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Content Grid & Cards (Apps, Books, Videos, Other)
   ========================================================================== */

.content-area {
  flex: 1;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-top: 1px solid var(--border-gold-hairline);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.item-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  border-top-color: var(--gold-champagne);
  box-shadow: var(--shadow-md), var(--shadow-gold-hover);
  background: var(--bg-surface-elevated);
}

/* Video Card Specific Styling with 16:9 Thumbnail */
.video-card {
  padding: 14px;
}

.video-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000000;
  margin-bottom: 14px;
  border: 1px solid var(--border-subtle);
}

.video-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.video-card:hover .video-thumb-img {
  transform: scale(1.03);
}

.video-play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  transition: background 0.2s ease;
}

.video-card:hover .video-play-badge {
  background: rgba(0, 0, 0, 0.2);
}

.play-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
  transition: transform 0.15s ease;
}

.video-card:hover .play-circle {
  transform: scale(1.1);
  background: #ef4444;
}

.video-meta-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.badge-subject {
  font-size: 11px;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.badge-vtype {
  font-size: 11px;
  font-weight: 500;
  background: rgba(234, 88, 12, 0.12);
  color: #fdba74;
  border: 1px solid rgba(234, 88, 12, 0.3);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.badge-exam {
  font-size: 11px;
  font-weight: 500;
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-type-icon {
  font-size: 20px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.card-category-badge {
  font-size: 11px;
  font-weight: 500;
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.card-description {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 18px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  margin-top: auto;
}

.card-status-indicator {
  font-size: 12px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-action-hint {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  margin: 20px 0;
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 480px;
  margin: 0 auto 16px;
}

/* ==========================================================================
   Item Profile View (Apps, Books, Videos, Other)
   ========================================================================== */

.profile-container {
  display: none; /* Controlled by Router */
}

.profile-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 24px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  cursor: pointer;
}

.profile-nav-back:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-top: 2px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(212, 175, 55, 0.08);
  margin-bottom: 30px;
  background-image: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.06) 0%, transparent 60%);
}

.profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 20px;
}

.profile-title-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  font-size: 32px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-title-area h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.profile-meta-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-type-badge {
  font-size: 12px;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.profile-category-badge {
  font-size: 12px;
  font-weight: 500;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* Embedded YouTube Video Container in Profile */
.video-player-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin: 20px 0 28px;
  border: 1px solid var(--border-subtle);
  background: #000000;
  box-shadow: var(--shadow-md);
}

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

.profile-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 24px;
  white-space: pre-line;
}

/* Action Buttons Suite */
.profile-actions-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 20px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 28px;
}

.btn-primary-action {
  background: linear-gradient(135deg, var(--gold-champagne), var(--accent-primary));
  color: var(--text-on-gold) !important;
  border: none;
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: var(--accent-primary-glow);
  transition: all 0.15s ease;
}

.btn-primary-action:hover {
  background: linear-gradient(135deg, #FFF1C1, var(--gold-champagne));
  color: var(--text-on-gold) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
}

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

.btn-youtube-action {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-youtube-action:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

.btn-secondary-action {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-secondary-action:hover {
  background: var(--border-subtle);
  border-color: var(--accent-primary);
  color: var(--accent-gold);
}

.badge-disabled-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--badge-disabled-bg);
  border: 1px solid var(--badge-disabled-border);
  color: var(--badge-disabled-text);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Helpful Link Validation & Pending Notice Cards
   ========================================================================== */

.link-notice-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, rgba(31, 26, 23, 0.9), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 4px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 20px 0 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.notice-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-content {
  flex: 1;
}

.notice-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 6px;
}

.notice-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.notice-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #fbbf24;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  word-break: break-all;
}

/* ==========================================================================
   Community Support Card
   ========================================================================== */

.support-card {
  background: linear-gradient(145deg, rgba(31, 26, 23, 0.95), rgba(22, 19, 17, 0.95));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 28px 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.support-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #f59e0b, #ea580c, #ef4444);
}

.support-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.support-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.support-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
  max-width: 720px;
}

.support-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-support-upi {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-support-upi:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  transform: translateY(-1px);
}

.btn-support-global {
  background: rgba(234, 88, 12, 0.15);
  border: 1px solid rgba(234, 88, 12, 0.4);
  color: #fdba74;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-support-global:hover {
  background: rgba(234, 88, 12, 0.25);
  border-color: #ea580c;
  transform: translateY(-1px);
}

/* ==========================================================================
   Placeholders: Comments & Version History / Notes
   ========================================================================== */

.placeholders-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 32px;
}

.slot-card {
  background: var(--bg-surface-elevated);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.slot-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.slot-badge {
  font-size: 11px;
  background: var(--badge-bg);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.slot-content-placeholder {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.6;
}

.changelog-list {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.changelog-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.changelog-ver {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Modals: Reader & UPI Support
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background: var(--border-subtle);
}

.modal-body {
  padding: 0;
  flex: 1;
  min-height: 480px;
  position: relative;
  background: #000;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  min-height: 540px;
  border: none;
  display: block;
}

.modal-dialog-upi {
  max-width: 440px;
  padding: 24px;
}

.upi-info-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.upi-id-text {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-gold);
}

.btn-copy-upi {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy-upi:hover {
  background: var(--border-subtle);
  border-color: var(--accent-gold);
}

.upi-chip-group {
  display: flex;
  gap: 8px;
  margin: 12px 0 18px;
  flex-wrap: wrap;
}

.upi-qr-card {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: #ffffff;
  padding: 14px;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.upi-amount-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  font-family: inherit;
}

.upi-amount-chip:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.upi-amount-chip.active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #0c0a09;
  font-weight: 700;
}

/* ==========================================================================
   Footer & Collaboration Banner
   ========================================================================== */

.hub-footer {
  margin-top: auto;
  padding-top: 40px;
  border-top: 1px solid var(--border-subtle);
}

.footer-collab-card {
  background: linear-gradient(135deg, rgba(31, 26, 23, 0.8), rgba(245, 158, 11, 0.08));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.collab-left {
  max-width: 620px;
}

.collab-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.collab-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.collab-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.btn-collab {
  background: linear-gradient(135deg, var(--gold-champagne), var(--accent-primary));
  color: var(--text-on-gold) !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px var(--accent-primary-glow);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-collab:hover {
  background: linear-gradient(135deg, #FFF1C1, var(--gold-champagne));
  color: var(--text-on-gold) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 12px;
}

.footer-bottom a {
  color: var(--accent-gold);
  text-decoration: none;
}

.footer-bottom a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 640px) {
  .app-wrapper {
    padding: 0 12px 24px;
  }

  .brand-area {
    gap: 10px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-text h1 {
    font-size: 18px;
    line-height: 1.3;
    word-break: break-word;
  }

  #brand-title {
    display: inline;
    word-break: break-word;
  }

  .brand-credit-tag {
    font-size: 10px;
    padding: 1px 7px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .profile-card {
    padding: 20px;
  }

  .profile-header {
    flex-direction: column;
  }

  .footer-collab-card {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-collab {
    width: 100%;
    justify-content: center;
  }

  .support-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-support-upi, .btn-support-global {
    width: 100%;
    justify-content: center;
  }
}
