/* =============================================
   PlayLab — Playwright Practice Arena
   Modern CSS with Custom Properties
   ============================================= */

/* ===== CSS RESET & VARIABLES ===== */
:root {
  --bg: #fafbff;
  --bg-alt: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --success: #10b981;
  --success-light: #ecfdf5;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --info: #06b6d4;
  --info-light: #ecfeff;
  --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --gradient-2: linear-gradient(135deg, #06b6d4, #6366f1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.12);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --nav-height: 72px;
}

[data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-alt: #111827;
  --surface: #1a1f35;
  --surface-hover: #1f2545;
  --border: #2d3555;
  --border-hover: #3d4565;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --primary-light: #1e1b4b;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --success-light: #064e3b;
  --danger-light: #450a0a;
  --warning-light: #451a03;
  --info-light: #083344;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
}

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

html {
  scroll-behavior: auto;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.legal-page {
  min-height: 100vh;
  padding: 48px 24px;
  background: var(--bg);
}

.legal-container {
  max-width: 820px;
  margin: 0 auto;
}

.legal-back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.legal-content {
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.legal-content h1 {
  margin-bottom: 8px;
}

.legal-content h2 {
  margin-top: 28px;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.legal-content p {
  margin-bottom: 14px;
  color: var(--text-secondary);
}

.legal-content a {
  color: var(--primary);
}

.legal-updated {
  color: var(--text-muted) !important;
  font-size: 0.875rem;
}

/* ===== IONICONS GLOBAL ===== */
ion-icon {
  font-size: 1.2em;
  vertical-align: -0.15em;
  display: inline-block;
}

.card-header h3 ion-icon {
  font-size: 1.3em;
  color: var(--primary);
  margin-right: 4px;
}

.alert ion-icon {
  font-size: 1.2em;
  vertical-align: -0.2em;
  margin-right: 4px;
}

.context-menu button ion-icon {
  font-size: 1.1em;
  margin-right: 6px;
  vertical-align: -0.15em;
}

.dnd-item ion-icon {
  font-size: 1.2em;
  margin-right: 6px;
  vertical-align: -0.15em;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  overflow: hidden;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  overflow: visible;
}

[data-theme="dark"] .navbar {
  background: rgba(10, 14, 26, 0.8);
}

.navbar.scrolled {
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-links {
  margin-left: auto;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: -0.03em;
}

.logo-img {
  width: 36px;
  height: 36px;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: var(--radius-sm);
}

.logo-accent {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.938rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-btn {
  background: var(--primary) !important;
  color: white !important;
  border-radius: var(--radius-full) !important;
  padding: 8px 20px !important;
}

.nav-auth {
  display: flex;
  align-items: center;
}

.nav-auth a {
  text-decoration: none;
}

.nav-btn:hover {
  background: var(--primary-hover) !important;
}

.nav-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: 12px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px !important;
  border-radius: var(--radius-sm);
  font-size: 0.813rem !important;
  text-align: center;
  white-space: nowrap;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: center;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition);
}

.theme-toggle:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
    flex-shrink: 0;
    order: 2;
  }
  .nav-container {
    gap: 8px;
  }
  .nav-logo {
    font-size: 1.25rem;
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
    flex: 1;
  }
  .logo-img {
    width: 28px;
    height: 28px;
    margin-right: 4px;
    flex-shrink: 0;
  }
  .theme-toggle {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 1rem;
    flex-shrink: 0;
    order: 3;
  }
  .nav-auth {
    order: 1;
    flex-shrink: 0;
  }
  .nav-auth .nav-btn {
    width: auto !important;
    padding: 8px 14px !important;
    margin: 0 !important;
    font-size: 0.813rem !important;
    border-radius: var(--radius-full) !important;
  }
  .nav-auth .btn-sm {
    margin: 0 !important;
    padding: 8px 14px !important;
    font-size: 0.813rem !important;
  }
  .nav-links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--nav-height));
    background: var(--surface);
    display: none;
    grid-template-columns: 1fr 1fr;
    padding: 12px;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    overflow-y: auto;
    box-sizing: border-box;
  }
  .nav-links.active {
    display: grid;
  }
  .nav-links > li {
    border-bottom: none;
    min-width: 0;
  }
  .nav-links > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 8px !important;
    font-size: 0.813rem !important;
    font-weight: 600;
    color: var(--text);
    border-radius: var(--radius) !important;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    transition: var(--transition);
    text-align: center;
    white-space: normal;
    word-break: break-word;
    box-sizing: border-box;
    overflow: hidden;
  }
  .nav-links > li > a:hover,
  .nav-links > li > a:active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
  }
  .nav-btn {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    border-radius: var(--radius) !important;
    padding: 12px 8px !important;
    width: 100% !important;
    margin: 0 !important;
    justify-content: center;
  }
  .nav-btn:hover {
    background: var(--primary-hover) !important;
  }
  .nav-dropdown {
    grid-column: 1 / -1;
    border-bottom: none;
    min-width: 0;
  }
  .nav-links > li > a.dropdown-trigger {
    display: none;
  }
  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-width: 0;
    left: 0;
    background: transparent;
    margin-top: 6px;
    padding: 0;
    border-radius: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .nav-dropdown:hover .dropdown-menu {
    transform: none;
  }
  .dropdown-menu li {
    border-bottom: none;
    min-width: 0;
  }
  .dropdown-menu a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 6px !important;
    font-size: 0.75rem !important;
    font-weight: 500;
    color: var(--text-secondary) !important;
    border-radius: var(--radius) !important;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    text-align: center;
    white-space: normal;
    word-break: break-word;
    box-sizing: border-box;
    overflow: hidden;
  }
  .dropdown-menu a:hover {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
  }

  /* --- Sections responsive --- */
  .section {
    padding: 60px 0;
  }
  .section-header {
    margin-bottom: 32px;
  }
  .section-title {
    font-size: 1.75rem;
  }
  .section-desc {
    font-size: 1rem;
  }
  .container {
    padding: 0 16px;
  }

  /* --- Cards responsive --- */
  .card {
    padding: 20px;
    overflow: hidden;
  }
  .card-header h3 {
    font-size: 1.05rem;
    word-break: break-word;
  }

  /* --- Tabs responsive --- */
  .tab-nav {
    flex-wrap: wrap;
    gap: 2px;
  }
  .tab-btn {
    padding: 10px 14px;
    font-size: 0.8rem;
    flex: 1;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
  }

  /* --- Accordion responsive --- */
  .accordion-header {
    padding: 14px 16px;
    font-size: 0.875rem;
    gap: 8px;
  }
  .accordion-header span:first-child {
    flex: 1;
    min-width: 0;
    word-break: break-word;
  }
  .accordion-body p {
    padding: 14px 16px;
    font-size: 0.813rem;
  }

  /* --- Network / API section responsive --- */
  .result-display {
    word-break: break-all;
    overflow-wrap: break-word;
    overflow-x: auto;
    max-width: 100%;
    font-size: 0.75rem;
  }
  .btn-group {
    flex-wrap: wrap;
  }
  .btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
  .copy-field {
    flex-direction: column;
  }

  /* --- Forms responsive --- */
  .form-row {
    grid-template-columns: 1fr;
  }
  .radio-group,
  .checkbox-group {
    flex-wrap: wrap;
  }

  /* --- Hero responsive --- */
  .hero {
    min-height: auto;
    padding: calc(var(--nav-height) + 16px) 16px 32px;
  }
  .hero-badge {
    margin-bottom: 16px;
  }
  .hero-title {
    margin-bottom: 12px;
  }
  .hero-subtitle {
    margin: 0 auto 20px;
  }
  .hero-actions {
    margin-bottom: 24px;
  }
  .hero-stats {
    gap: 24px;
  }
  .stat-number {
    font-size: 1.75rem;
  }

  /* --- Table responsive --- */
  .table-controls {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .table-controls .table-search-input {
    flex: 1 1 100%;
  }
  .table-controls .table-filter-select {
    flex: 1 1 calc(50% - 6px);
  }
  .table-controls .btn {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
  }
  .table-footer {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 40px) 24px 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.shape-1 {
  width: 600px;
  height: 600px;
  background: #6366f1;
  top: -200px;
  right: -100px;
  animation: float 20s infinite ease-in-out;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: #ec4899;
  bottom: -100px;
  left: -100px;
  animation: float 15s infinite ease-in-out reverse;
}

.shape-3 {
  width: 300px;
  height: 300px;
  background: #06b6d4;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: float 18s infinite ease-in-out;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(30px, -30px);
  }
  50% {
    transform: translate(-20px, 20px);
  }
  75% {
    transform: translate(20px, 10px);
  }
}

[data-theme="dark"] .shape {
  opacity: 0.15;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid var(--primary-glow);
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}

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

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  gap: 48px;
  justify-content: center;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.section-desc {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.938rem;
  font-weight: 600;
  font-family: var(--font);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  background: #059669;
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
}
.btn-warning {
  background: var(--warning);
  color: white;
}
.btn-warning:hover {
  background: #d97706;
}
.btn-info {
  background: var(--info);
  color: white;
}
.btn-info:hover {
  background: #0891b2;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.813rem;
}
.btn-lg {
  padding: 16px 32px;
  font-size: 1.063rem;
  border-radius: var(--radius-lg);
}
.btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  font-size: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
}
.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== GRID ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .dropdown-grid .card {
    overflow: visible;
  }
  .custom-dropdown-trigger,
  .checkbox-dropdown-trigger {
    padding: 10px 14px;
    font-size: 0.875rem;
  }
  .searchable-dropdown-input {
    padding: 10px 14px;
    font-size: 0.875rem;
  }
  .oxd-select-text-input {
    font-size: 0.875rem;
  }
  .subsection-header {
    margin-top: 32px;
    margin-bottom: 20px;
  }
  .subsection-title {
    font-size: 1.15rem;
  }
  .form-group select {
    font-size: 0.875rem;
  }
}

/* Subsection Header */
.subsection-header {
  margin-top: 40px;
  margin-bottom: 24px;
}

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

.subsection-title ion-icon {
  color: var(--primary);
}

.subsection-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Dropdown grid alignment */
.dropdown-grid {
  overflow: visible;
}

.dropdown-grid .card {
  align-self: start;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.dropdown-grid .card:has(.open),
.dropdown-grid .card:has(.oxd-select--open) {
  z-index: 20;
}

#forms .container {
  overflow: visible;
}

/* Loading hint */
.loading-hint {
  font-size: 0.813rem;
  color: var(--primary);
  font-weight: 500;
  margin-top: 6px;
  display: inline-block;
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition:
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.card.full-width {
  grid-column: 1 / -1;
}

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

.card-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.card-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 16px;
}

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.938rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-group input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.error-msg {
  display: block;
  font-size: 0.813rem;
  color: var(--danger);
  margin-top: 4px;
  min-height: 1.2em;
}

.hint {
  font-size: 0.813rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.input-with-icon {
  position: relative;
}

.input-with-icon input {
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.5;
  transition: var(--transition);
}

.toggle-password:hover {
  opacity: 1;
}

.password-strength {
  height: 4px;
  background: var(--bg-alt);
  border-radius: var(--radius-full);
  margin-top: 8px;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0;
  border-radius: var(--radius-full);
  transition: var(--transition-slow);
}

.char-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  float: right;
  margin-top: 4px;
}

/* Radio & Checkbox */
.radio-group,
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.radio-label,
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.radio-label:hover,
.checkbox-label:hover {
  background: var(--bg-alt);
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Range/Slider */
input[type="range"] {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-alt);
  border-radius: var(--radius-full);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Color picker */
input[type="color"] {
  width: 50px;
  height: 50px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 4px;
  background: var(--surface);
}

.color-display {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin-left: 12px;
  color: var(--text-secondary);
}

/* File Upload */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  color: var(--primary);
}

.upload-icon ion-icon {
  font-size: 1em;
}
.upload-link {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.upload-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.file-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.file-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.2rem;
}

/* Autocomplete */
.card:has(.autocomplete-wrapper),
.card:has(.custom-dropdown),
.card:has(.searchable-dropdown),
.card:has(.checkbox-dropdown),
.card:has(.oxd-select-wrapper) {
  position: relative;
  z-index: 10;
  overflow: visible;
}

.autocomplete-wrapper {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius);
  max-height: 200px;
  overflow-y: auto;
  z-index: 60;
  margin-top: 4px;
}

.autocomplete-list:not(:empty) {
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.autocomplete-option {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.875rem;
}

.autocomplete-option:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.autocomplete-no-results {
  padding: 10px 16px;
  font-size: 0.813rem;
  color: var(--text-muted);
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.813rem;
  font-weight: 500;
}

.tag-remove {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1;
}

/* Custom Dropdown (Click-to-open) */
.custom-dropdown {
  position: relative;
}

.custom-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  font-size: 0.938rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.custom-dropdown-trigger:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  outline: none;
}

.custom-dropdown-arrow {
  font-size: 0.75rem;
  color: var(--text);
}

.custom-dropdown.open .custom-dropdown-arrow {
  transform: rotate(180deg);
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  list-style: none;
  z-index: 60;
  display: none;
}

.custom-dropdown.open .custom-dropdown-menu {
  display: block;
}

.custom-dropdown-menu li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.875rem;
}

.custom-dropdown-menu li:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.custom-dropdown-menu li.selected {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.priority-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.priority-low {
  background: var(--success);
}
.priority-medium {
  background: var(--warning);
}
.priority-high {
  background: #f97316;
}
.priority-critical {
  background: var(--danger);
}

/* Focus-Gated Dropdown (OrangeHRM-style) */
.oxd-select-wrapper {
  position: relative;
}

.oxd-select-text {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
}

.oxd-select-text-input {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.875rem;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  border: none;
  background: transparent;
  cursor: pointer;
}

.oxd-select-text-input:focus {
  outline: none;
}

.oxd-select--open .oxd-select-text {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.oxd-select-text--after {
  display: flex;
  align-items: center;
  padding-right: 10px;
}

.oxd-select-text--arrow {
  font-size: 0.7rem;
  color: var(--text);
}

.oxd-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 60;
  max-height: 200px;
  overflow-y: auto;
}

.oxd-select-option {
  padding: 9px 12px;
  font-size: 0.875rem;
  cursor: pointer;
}

.oxd-select-option:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Searchable Dropdown */
.searchable-dropdown {
  position: relative;
}

.searchable-dropdown-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.938rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  outline: none;
}

.searchable-dropdown-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.searchable-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  z-index: 60;
  display: none;
}

.searchable-dropdown.open .searchable-dropdown-menu {
  display: block;
}

.searchable-dropdown-menu li {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.875rem;
}

.searchable-dropdown-menu li:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.searchable-dropdown-menu li.selected {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.searchable-dropdown-menu li.hidden {
  display: none;
}

.searchable-dropdown-menu .no-results {
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 0.813rem;
  cursor: default;
}

/* Checkbox Dropdown (Multi-select with checkboxes) */
.checkbox-dropdown {
  position: relative;
}

.checkbox-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  font-size: 0.938rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.checkbox-dropdown-trigger:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  outline: none;
}

.checkbox-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 60;
  display: none;
}

.checkbox-dropdown.open .checkbox-dropdown-menu {
  display: block;
}

.checkbox-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.875rem;
}

.checkbox-dropdown-item:hover {
  background: var(--primary-light);
}

.checkbox-dropdown-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Toggle Switch */
.switch-label {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch {
  position: relative;
  width: 52px;
  height: 28px;
  display: inline-block;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.switch input:checked + .switch-slider {
  background: var(--primary);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(24px);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* ===== DATA TABLE ===== */
.table-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.table-controls .table-search-input {
  flex: 1 1 180px;
  min-width: 0;
}

.table-controls .table-filter-select {
  flex: 0 1 auto;
}

.table-search-input {
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.875rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.table-search-input:focus {
  border-color: var(--primary);
}

.table-filter-select {
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.875rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.data-table th {
  background: var(--bg-alt);
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-size: 0.813rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table th.sortable:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
  height: 50px;
  box-sizing: border-box;
}

.data-table td ion-icon {
  font-size: 14px;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition);
  height: 50px;
}

.data-table tbody tr:hover {
  background: var(--surface-hover);
}

.data-table tbody tr.selected {
  background: var(--primary-light);
}

.status-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-active {
  background: var(--success-light);
  color: var(--success);
}
.status-inactive {
  background: var(--danger-light);
  color: var(--danger);
}
.status-pending {
  background: var(--warning-light);
  color: var(--warning);
}

.role-admin {
  background: var(--success-light);
  color: var(--success);
}
.role-editor {
  background: #eef2ff;
  color: #6366f1;
}
.role-viewer {
  background: var(--danger-light);
  color: var(--danger);
}

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

.table-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.pagination {
  display: flex;
  gap: 4px;
}

.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.page-arrow ion-icon {
  font-size: 16px;
}

.row-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.row-actions button {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.row-actions button:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.row-actions button.delete:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* Editable Table */
.editable-table td[contenteditable] {
  cursor: text;
  position: relative;
}

.editable-table td[contenteditable]:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: var(--primary-light);
}

/* ===== DRAG & DROP ===== */
.dnd-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dnd-item {
  padding: 14px 18px;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: grab;
  transition: var(--transition);
  font-weight: 500;
  user-select: none;
}

.dnd-item:active {
  cursor: grabbing;
}
.dnd-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.dnd-item.dragging {
  opacity: 0.5;
  border-style: dashed;
}

.drop-zone {
  margin-top: 12px;
  padding: 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.drop-zone.dragover {
  border-color: var(--danger);
  background: var(--danger-light);
  color: var(--danger);
}

/* ===== HOVER EFFECTS ===== */
.hover-demo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.hover-box {
  padding: 24px;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
  transition: var(--transition-slow);
  cursor: pointer;
  position: relative;
}

.hover-box[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  z-index: 10;
}

.hover-box.scale:hover {
  transform: scale(1.1);
}
.hover-box.rotate:hover {
  transform: rotate(10deg);
}
.hover-box.color-shift:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.tooltip-container {
  position: relative;
  display: inline-block;
}
.custom-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.813rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.tooltip-container:hover .custom-tooltip {
  opacity: 1;
  visibility: visible;
}

.result-text {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 500;
}

/* ===== CONTEXT MENU ===== */
.context-area {
  padding: 40px;
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-muted);
  user-select: none;
  cursor: context-menu;
}

.context-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  min-width: 180px;
  z-index: 1001;
}

.context-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.context-menu button:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.context-menu hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* Toggle Buttons */
.toggle-group {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.toggle-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
  transition: var(--transition);
  font-family: var(--font);
}

.toggle-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

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

/* ===== DYNAMIC CONTENT ===== */
.delay-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.delay-controls select {
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
}

.delayed-content {
  margin-top: 16px;
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.placeholder-content {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

.loaded-data {
  padding: 20px;
}

.loaded-data h4 {
  margin-bottom: 8px;
  color: var(--primary);
}

.visible-box {
  padding: 24px;
  background: var(--primary-light);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  text-align: center;
  margin-top: 12px;
  transition: var(--transition);
}

.dynamic-elements-container {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dynamic-el {
  padding: 10px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideIn 0.3s ease;
}

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

/* Counter */
.counter-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 16px 0;
}

.counter-value {
  font-size: 3rem;
  font-weight: 800;
  font-family: var(--font-mono);
  min-width: 80px;
  text-align: center;
  color: var(--primary);
}

.timer-display {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-align: center;
  margin: 16px 0;
  color: var(--primary);
}

/* Progress */
.progress-bar-container {
  height: 28px;
  background: var(--bg-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar {
  height: 100%;
  background: var(--gradient-1);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 0;
}

.spinner-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Skeleton */
.skeleton-area {
  margin-top: 12px;
}

.skeleton-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: var(--radius);
}

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-hover) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  flex-shrink: 0;
}
.skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skeleton-title {
  height: 16px;
  width: 60%;
}
.skeleton-text {
  height: 12px;
  width: 100%;
}
.skeleton-text.short {
  width: 40%;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.loaded-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  align-items: center;
}

.loaded-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

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

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 100%;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ===== TOASTS ===== */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + 16px);
  right: 16px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease;
  min-width: 300px;
}

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

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.toast-content {
  flex: 1;
}
.toast-content strong {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 2px;
}
.toast-content p {
  font-size: 0.813rem;
  color: var(--text-secondary);
  margin: 0;
}

.toast-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
}

.toast.success {
  border-left: 4px solid var(--success);
}
.toast.error {
  border-left: 4px solid var(--danger);
}
.toast.warning {
  border-left: 4px solid var(--warning);
}
.toast.info {
  border-left: 4px solid var(--info);
}

/* ===== ALERTS ===== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 8px;
  border: 1px solid transparent;
}

.alert-success {
  background: var(--success-light);
  color: var(--success);
  border-color: var(--success);
}
.alert-error {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}
.alert-warning {
  background: var(--warning-light);
  color: var(--warning);
  border-color: var(--warning);
}
.alert-info {
  background: var(--info-light);
  color: var(--info);
  border-color: var(--info);
}

/* ===== HTTP BASIC AUTH POPUP ===== */
.sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.sub-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sub-heading ion-icon {
  font-size: 1.2em;
  color: var(--primary);
  flex-shrink: 0;
}

.sub-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.sub-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.sub-desc code {
  font-size: inherit;
  word-break: keep-all;
  overflow-wrap: normal;
}

.credentials-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.credentials-hint ion-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  color: var(--primary);
}

.credentials-hint .cred-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  min-width: 0;
}

.credentials-hint .cred-item {
  white-space: nowrap;
}

.credentials-hint code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-weight: 600;
  color: var(--text);
  font-size: inherit;
  word-break: keep-all;
  overflow-wrap: normal;
}

/* ===== TABS ===== */
.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}
.tab-content.active {
  display: block;
}

.tab-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tab-content li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

/* ===== ACCORDION ===== */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: var(--surface);
  border: none;
  font-family: var(--font);
  font-size: 0.938rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.accordion-header:hover {
  background: var(--surface-hover);
}
.accordion-header.active {
  background: var(--primary-light);
  color: var(--primary);
}

.accordion-icon {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.accordion-header.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-body.open {
  max-height: 200px;
}

.accordion-body p {
  padding: 16px 20px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}

.accordion-body code {
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.813rem;
}

/* ===== IFRAME ===== */
.practice-iframe {
  width: 100%;
  height: 350px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: white;
}

.nested-frames-iframe {
  height: 390px;
}

.external-iframe {
  height: 350px;
}

/* ===== SHADOW DOM ===== */
#shadowHost,
#nestedShadowHost {
  min-height: 200px;
}

/* ===== INFINITE SCROLL ===== */
.scroll-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}

.scroll-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  transition: var(--transition);
}

.scroll-item:last-child {
  border-bottom: none;
}
.scroll-item:hover {
  background: var(--surface-hover);
}

.scroll-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: white;
  font-weight: 600;
  flex-shrink: 0;
}

.scroll-loader {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== CLIPBOARD ===== */
.copy-field {
  display: flex;
  gap: 8px;
}

.copy-field input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--bg);
  color: var(--text);
}

.key-display {
  padding: 12px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin-top: 8px;
  min-height: 46px;
  display: flex;
  align-items: center;
}

/* ===== GALLERY ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gallery-item {
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}

.gallery-item:hover {
  transform: translateY(-4px);
}

.gallery-img {
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  overflow: hidden;
}

.gallery-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-img img {
  transform: scale(1.08);
}

.gallery-item:hover .gallery-img {
  box-shadow: var(--shadow-md);
}

.gallery-item p {
  font-size: 0.813rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lightbox-content {
  width: 300px;
  height: 300px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.lightbox-prev {
  left: 20px;
}
.lightbox-next {
  right: 20px;
}
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== RESULT DISPLAY ===== */
.result-display {
  padding: 10px 14px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  min-height: 40px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  word-break: break-word;
}

.placeholder-text {
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font);
}

/* ===== SUCCESS MESSAGE ===== */
.success-message {
  padding: 20px;
  background: var(--success-light);
  border: 2px solid var(--success);
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
  color: var(--success);
  margin-top: 16px;
  animation: slideIn 0.3s ease;
}

/* ===== SHOPPING ===== */
.shop-products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .shop-products {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .shop-products {
    grid-template-columns: 1fr;
  }
}

.shop-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
}

.shop-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.shop-card-img {
  position: relative;
  height: 200px;
  overflow: hidden;
}

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

.shop-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.shop-card-body {
  padding: 16px;
}

.shop-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.shop-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.shop-card-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.shop-card-actions {
  display: flex;
  gap: 8px;
}

.shop-coupons-display {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.shop-coupons-display h4 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.shop-coupon-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.shop-coupon-chip {
  background: var(--primary-light);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.82rem;
}

.coupon-code {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--primary);
}

.shop-cart-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.shop-cart-panel h4 {
  margin-bottom: 16px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-cart-count {
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.shop-cart-empty {
  color: var(--text-muted);
  font-style: italic;
}

.shop-cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.shop-cart-item-info {
  display: flex;
  flex-direction: column;
}

.shop-cart-item-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.shop-cart-item-price {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.shop-cart-item-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
}

.shop-cart-summary {
  margin-top: 20px;
}

.shop-coupon-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.shop-coupon-row .form-input {
  flex: 1;
}

.shop-coupon-msg {
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.shop-coupon-msg.success {
  background: var(--success-light);
  color: var(--success);
}

.shop-coupon-msg.error {
  background: var(--danger-light);
  color: var(--danger);
}

.shop-totals {
  margin: 16px 0;
}

.shop-total-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.9rem;
}

.shop-total-final {
  font-weight: 700;
  font-size: 1.05rem;
  border-top: 2px solid var(--border);
  padding-top: 10px;
  margin-top: 6px;
}

.shop-discount-row span:last-child {
  color: var(--success);
}

.shop-checkout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.shop-checkout-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

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

.shop-checkout-header h3 {
  font-size: 1.3rem;
}

.shop-checkout-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.shop-step h4 {
  margin-bottom: 16px;
  color: var(--primary);
}

.shop-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.shop-payment-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.shop-payment-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.shop-payment-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.shop-step-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.shop-confirmation {
  text-align: center;
  padding: 20px 0;
}

.shop-confirm-icon {
  font-size: 4rem;
  color: var(--success);
  margin-bottom: 12px;
}

.shop-confirmation h4 {
  color: var(--text);
  font-size: 1.3rem;
}

.shop-order-id {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-col p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}

.footer-col ul {
  list-style: none;
}
.footer-col li {
  margin-bottom: 8px;
}
.footer-col a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: var(--transition);
}
.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.813rem;
}

/* ===== UTILITIES ===== */
.hidden {
  display: none !important;
}
.mb-1 {
  margin-bottom: 0.5rem;
}
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* ===== LOADING DOTS ===== */
.loading-dots::after {
  content: "";
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%,
  20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60%,
  100% {
    content: "...";
  }
}

/* ===== SCROLL ANIMATIONS ===== */
.section-header,
.card {
  opacity: 1;
  transform: none;
}

/* On load, make hero visible */
.hero .hero-content {
  animation: heroIn 0.8s ease forwards;
}

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

/* ===== WIZARD / STEPPER ===== */
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}

.wizard-step.active .step-number {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.wizard-step.active .step-label {
  color: var(--primary);
}

.wizard-step.completed .step-number {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.wizard-step.completed .step-label {
  color: var(--success);
}

.wizard-connector {
  width: 60px;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  margin-bottom: 20px;
  transition: var(--transition);
}

.wizard-connector.active {
  background: var(--primary);
}

.wizard-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.wizard-panel.active {
  display: block;
}

.wizard-panel h3 {
  margin-bottom: 16px;
  font-size: 1.125rem;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.review-summary {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 0.875rem;
  line-height: 1.8;
}

.review-summary strong {
  color: var(--primary);
}

.wizard-done {
  text-align: center;
  padding: 40px 20px;
}

.wizard-done h3 {
  margin-top: 12px;
}

.wizard-done p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ===== COOKIE BANNER ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  z-index: 1050;
  animation: slideUp 0.4s ease;
  flex-wrap: wrap;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.cookie-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.cookie-content ion-icon {
  font-size: 2rem;
  color: var(--primary);
  flex-shrink: 0;
}

.cookie-content strong {
  display: block;
  margin-bottom: 2px;
}

.cookie-content p {
  font-size: 0.813rem;
  color: var(--text-secondary);
  margin: 0;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-banner.hidden {
  display: none !important;
}

/* ===== CAROUSEL ===== */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.carousel-track {
  position: relative;
  height: 320px;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  padding: 40px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-slide h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.carousel-slide p {
  font-size: 1.125rem;
  opacity: 0.9;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 2;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

.carousel-prev {
  left: 16px;
}
.carousel-next {
  right: 16px;
}

.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.carousel-dot.active {
  background: white;
  transform: scale(1.3);
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ===== NETWORK / API ===== */
.api-status {
  font-size: 0.813rem;
  font-weight: 600;
}

.api-status.loading {
  color: var(--info);
}
.api-status.success {
  color: var(--success);
}
.api-status.error {
  color: var(--danger);
}

code {
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.813rem;
  word-break: break-all;
  overflow-wrap: break-word;
}

/* ===== FLAKY ELEMENTS ===== */
.flaky-box {
  padding: 24px;
  background: var(--primary-light);
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.flaky-box.hidden-state {
  opacity: 0.15;
  border-style: dotted;
}

.changing-text-box {
  padding: 20px;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
  font-size: 1.125rem;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

/* ===== DATE PICKER ===== */
.datepicker-input-wrap {
  position: relative;
}

.datepicker-input-wrap input {
  cursor: pointer;
}

.datepicker-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.datepicker-calendar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 16px;
  margin-top: 8px;
  max-width: 320px;
}

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

.datepicker-header .btn-icon {
  width: 32px;
  height: 32px;
  font-size: 1rem;
}

.typed-date-month-year {
  display: flex;
  gap: 6px;
}

.datepicker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.datepicker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.dp-day {
  width: 100%;
  aspect-ratio: 1;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.813rem;
  font-weight: 500;
  color: var(--text);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dp-day:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.dp-day.today {
  border: 2px solid var(--primary);
}
.dp-day.selected {
  background: var(--primary);
  color: white;
}
.dp-day.other-month {
  color: var(--text-muted);
  opacity: 0.5;
}

.datepicker-footer {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}

.month-year-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.month-year-header select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text);
  font-family: var(--font);
}

/* ===== MEDIA PLAYER ===== */
.media-player {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
  max-height: 260px;
}

.media-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.audio-visual {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.audio-art {
  width: 60px;
  height: 60px;
  background: var(--primary-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== ACCESSIBILITY ===== */
.a11y-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.a11y-buttons button:focus {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  display: inline-block;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
}

.skip-link:focus {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.focus-trap-area {
  padding: 20px;
  background: var(--primary-light);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.focus-trap-area:not(.hidden) {
  display: flex;
}

/* ===== RESPONSIVE TESTING ===== */
.responsive-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.responsive-box {
  padding: 24px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.responsive-box ion-icon {
  font-size: 2rem;
  color: var(--primary);
}

.responsive-box span {
  font-weight: 700;
  font-size: 0.938rem;
}

.responsive-box small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.desktop-only {
  background: var(--info-light);
  border-color: var(--info);
}
.tablet-only {
  background: var(--warning-light);
  border-color: var(--warning);
}
.mobile-only {
  background: var(--danger-light);
  border-color: var(--danger);
}
.always-visible {
  background: var(--success-light);
  border-color: var(--success);
}

@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }
  .responsive-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 769px) {
  .tablet-only {
    display: none;
  }
}

@media (max-width: 480px) {
  .tablet-only {
    display: none;
  }
  .responsive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.viewport-info p {
  font-size: 0.938rem;
  margin-bottom: 4px;
}

.responsive-demo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 12px;
}

@media (max-width: 768px) {
  .responsive-demo-grid {
    grid-template-columns: 1fr;
  }
}

.responsive-demo-item {
  padding: 24px;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-weight: 700;
}

/* ===== PROTECTED CONTENT ===== */
.protected-lock,
.protected-unlocked {
  text-align: center;
  padding: 40px 20px;
}

.protected-lock h4,
.protected-unlocked h4 {
  margin: 12px 0 8px;
}

.protected-lock p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ===== EXTRA-SMALL MOBILE (≤480px) ===== */
@media (max-width: 480px) {
  .nav-logo {
    font-size: 1.1rem;
  }
  .logo-img {
    width: 24px;
    height: 24px;
  }
  .theme-toggle {
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 0.9rem;
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .hero-subtitle {
    font-size: 0.938rem;
  }
  .hero-actions {
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
  }
  .hero-stats {
    flex-direction: row;
    gap: 20px;
  }
  .stat-number {
    font-size: 1.5rem;
  }
  .stat-label {
    font-size: 0.75rem;
  }
  .section-title {
    font-size: 1.5rem;
  }
  .card {
    padding: 16px;
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .tab-nav {
    gap: 0;
  }
  .tab-btn {
    padding: 8px 10px;
    font-size: 0.75rem;
  }
  .btn {
    font-size: 0.813rem;
    padding: 10px 18px;
  }
  .btn-lg {
    padding: 12px 24px;
    font-size: 0.938rem;
  }
  .btn-sm {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  .nav-links {
    padding: 8px;
    gap: 4px;
  }
  .nav-links > li > a {
    padding: 8px 4px !important;
    font-size: 0.75rem !important;
  }
  .dropdown-menu {
    gap: 4px;
  }
  .dropdown-menu a {
    padding: 7px 4px !important;
    font-size: 0.688rem !important;
  }
  .custom-dropdown-trigger,
  .checkbox-dropdown-trigger {
    padding: 10px 12px;
    font-size: 0.813rem;
  }
  .custom-dropdown-menu li,
  .oxd-select-option,
  .checkbox-dropdown-item,
  .searchable-dropdown-menu li {
    padding: 8px 12px;
    font-size: 0.813rem;
  }
  .searchable-dropdown-input {
    padding: 10px 12px;
    font-size: 0.813rem;
  }
  .subsection-header {
    margin-top: 28px;
    margin-bottom: 16px;
  }
  .subsection-title {
    font-size: 1.1rem;
  }
}

/* ===== RESPONSIVE BANNER AD SLOTS ===== */
.ad-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px 16px;
  overflow: hidden;
}
.ad-slot-scaler {
  margin: 0 auto;
  /* width/height are set by JS to the scaled banner size to avoid extra gaps */
}
.ad-slot-inner {
  width: 468px;
  height: 60px;
  transform-origin: top left;
  flex: 0 0 auto;
}
.ad-frame {
  width: 468px;
  height: 60px;
  border: 0;
  display: block;
}
