/* ============================================
   ContGoogle — Premium Dark Theme Stylesheet
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

/* ── CSS Custom Properties ─────────────────── */
:root {
  /* Backgrounds */
  --bg-primary: #0a0a0f;
  --bg-surface: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-glass: rgba(26, 26, 46, 0.7);
  --bg-input: rgba(15, 15, 25, 0.8);
  --bg-hover: rgba(99, 102, 241, 0.08);

  /* Accent */
  --accent: #6366f1;
  --accent-light: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --gradient-accent: linear-gradient(135deg, #6366f1, #8b5cf6);
  --gradient-accent-hover: linear-gradient(135deg, #818cf8, #a78bfa);

  /* Semantic */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --info: #6366f1;
  --info-bg: rgba(99, 102, 241, 0.12);

  /* Text */
  --text-primary: #f1f1f6;
  --text-secondary: #9ca3b0;
  --text-muted: #5f6577;
  --text-inverse: #0a0a0f;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.10);
  --border-accent: rgba(99, 102, 241, 0.4);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 4px 24px rgba(99, 102, 241, 0.2);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Typography */
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Z-index layers */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 500;
  --z-toast: 600;
  --z-tooltip: 700;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(99, 102, 241, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(139, 92, 246, 0.04), transparent);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--text-primary);
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #c4b5fd;
}

img {
  max-width: 100%;
  display: block;
}

/* ── Utility Classes ───────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: 560px;
}

.container--wide {
  max-width: 1400px;
}

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

.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-accent { color: var(--accent-light); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ── Navigation Header ────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  padding: var(--space-md) 0;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border-subtle);
}

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

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.nav__logo-icon {
  width: 34px;
  height: 34px;
  background: var(--gradient-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
}

.nav__link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

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

.nav__link--active {
  color: var(--accent-light);
}

.nav__right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav__user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.nav__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: #fff;
}

/* ── Buttons ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background var(--transition-fast);
}

.btn:hover::after {
  background: rgba(255, 255, 255, 0.08);
}

.btn:active {
  transform: scale(0.97);
}

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

.btn--primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.btn--primary:hover {
  box-shadow: 0 6px 30px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

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

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
}

.btn--ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn--danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn--danger:hover {
  background: rgba(239, 68, 68, 0.25);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

.btn--success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.btn--sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn--lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn--icon {
  padding: 8px;
  width: 36px;
  height: 36px;
}

.btn--google {
  background: #fff;
  color: #3c4043;
  font-weight: 500;
  border: 1px solid #dadce0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  padding: 10px 24px;
}

.btn--google:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn--google::after { display: none; }

.btn--google svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ── Badge ─────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge--success {
  background: var(--success-bg);
  color: var(--success);
}

.badge--error {
  background: var(--error-bg);
  color: var(--error);
}

.badge--info {
  background: var(--info-bg);
  color: var(--accent-light);
}

.badge--warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge--method {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.badge--get { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge--post { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge--put { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge--delete { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* ── Glassmorphism Card ────────────────────── */
.card {
  background: var(--bg-card-glass);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-light);
}

.card--interactive {
  cursor: pointer;
}

.card--interactive:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-glow);
  border-color: var(--border-accent);
}

.card--flat {
  backdrop-filter: none;
  background: var(--bg-card);
}

.card--highlight {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

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

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  outline: none;
}

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

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

.form-input:hover:not(:focus) {
  border-color: rgba(255, 255, 255, 0.18);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  margin-top: var(--space-xs);
  font-size: 0.8rem;
  color: var(--error);
}

.form-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

/* ── Modal ─────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-lg);
}

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

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

.modal__title {
  font-size: 1.25rem;
  font-weight: 700;
}

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

.modal__close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

/* ── Toast Notifications ───────────────────── */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  pointer-events: all;
  animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backdrop-filter: blur(16px);
  max-width: 400px;
}

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

.toast__icon {
  flex-shrink: 0;
  font-size: 1.1rem;
}

.toast--removing {
  animation: toastSlideOut 0.35s ease forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes toastSlideOut {
  to {
    opacity: 0;
    transform: translateX(100%) translateY(-10px);
  }
}

/* ── Loading Skeletons ─────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    rgba(255, 255, 255, 0.06) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton--text {
  height: 14px;
  width: 80%;
  margin-bottom: var(--space-sm);
}

.skeleton--text-sm {
  height: 12px;
  width: 60%;
}

.skeleton--heading {
  height: 24px;
  width: 50%;
  margin-bottom: var(--space-md);
}

.skeleton--card {
  height: 200px;
  border-radius: var(--radius-lg);
}

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

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── App Cards Grid ────────────────────────── */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}

.app-card {
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.app-card:hover::before {
  opacity: 1;
}

.app-card__name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.app-card__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-card__key {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-input);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.app-card__key code {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.app-card__date {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── API URL Display Boxes ─────────────────── */
.api-url-box {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: var(--space-sm);
  transition: border-color var(--transition-fast);
}

.api-url-box:hover {
  border-color: var(--border-light);
}

.api-url-box__method {
  flex-shrink: 0;
}

.api-url-box__url {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.api-url-box__label {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.api-url-box__copy {
  flex-shrink: 0;
}

/* ── Section Headers ───────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

/* ── Empty State ───────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state__title {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state__text {
  font-size: 0.9rem;
  margin-bottom: var(--space-lg);
}

/* ── Connect Banner ────────────────────────── */
.connect-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.connect-banner__text h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-xs);
}

.connect-banner__text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── Hero Section (Landing) ────────────────── */
.hero {
  position: relative;
  padding: 100px 0 80px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: 10%;
  right: 10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: heroFloat 8s ease-in-out infinite alternate;
}

@keyframes heroFloat {
  from { transform: translateY(0) translateX(0); }
  to { transform: translateY(-30px) translateX(20px); }
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 16px;
  background: var(--info-bg);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent-light);
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 1;
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: var(--space-md);
  position: relative;
  z-index: 1;
  line-height: 1.1;
}

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

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  position: relative;
  z-index: 1;
  line-height: 1.6;
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

/* ── Features Grid ─────────────────────────── */
.features {
  padding: var(--space-3xl) 0;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.feature-card {
  text-align: center;
  padding: var(--space-xl);
}

.feature-card__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-md);
  background: var(--gradient-accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.feature-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.feature-card__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Steps / How it Works ──────────────────── */
.steps {
  padding: var(--space-3xl) 0;
}

.steps__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
  counter-reset: step;
}

.step-item {
  text-align: center;
  padding: var(--space-lg);
  position: relative;
}

.step-item::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0 auto var(--space-md);
  background: var(--gradient-accent);
  border-radius: 50%;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.step-item__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.step-item__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── Auth Pages ────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  position: relative;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.auth-card__header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-card__logo {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.auth-card__logo span {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-card__subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-card__footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-card__footer a {
  color: var(--accent-light);
  font-weight: 500;
}

/* ── Dashboard Page ────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 70px);
  padding: var(--space-xl) 0 var(--space-3xl);
}

.page-header {
  margin-bottom: var(--space-xl);
}

.page-title {
  font-size: 1.8rem;
  font-weight: 800;
}

/* ── App Detail ────────────────────────────── */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.detail-header__left {
  flex: 1;
  min-width: 200px;
}

.detail-header__name {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.detail-header__desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.api-key-section {
  margin-bottom: var(--space-xl);
}

.api-key-display {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-light);
  word-break: break-all;
}

.api-key-display code {
  flex: 1;
  user-select: all;
}

.api-key-display .btn {
  flex-shrink: 0;
}

/* ── Linked Sheets / Drive Sections ────────── */
.linked-section {
  margin-bottom: var(--space-2xl);
}

.linked-card {
  margin-bottom: var(--space-lg);
  border-left: 3px solid var(--accent);
}

.linked-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.linked-card__name {
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.linked-card__name svg,
.linked-card__name .icon {
  color: var(--accent-light);
}

.tab-section {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
}

.tab-section__name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

/* ── Usage Stats ───────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
}

.stat-card {
  text-align: center;
  padding: var(--space-lg);
}

.stat-card__value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-xs);
}

.stat-card__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ── Docs Page ─────────────────────────────── */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-xl);
  align-items: flex-start;
}

.docs-sidebar {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: var(--space-md);
}

.docs-sidebar__nav {
  list-style: none;
}

.docs-sidebar__link {
  display: block;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.docs-sidebar__link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.docs-sidebar__link--active {
  color: var(--accent-light);
  border-left-color: var(--accent);
  background: var(--info-bg);
}

.docs-sidebar__heading {
  padding: 8px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: var(--space-md);
}

.docs-content {
  min-width: 0;
}

.docs-section {
  margin-bottom: var(--space-2xl);
  scroll-margin-top: 100px;
}

.endpoint-card {
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.endpoint-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.endpoint-card__path {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.endpoint-card__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.params-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-md);
  font-size: 0.85rem;
}

.params-table th {
  text-align: left;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.params-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.params-table td:first-child {
  font-family: var(--font-mono);
  color: var(--accent-light);
  font-size: 0.82rem;
}

.code-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0;
}

.code-tab {
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.code-tab:hover {
  color: var(--text-secondary);
}

.code-tab.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}

.code-block {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: var(--space-md);
  overflow-x: auto;
  position: relative;
}

.code-block pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
  white-space: pre;
}

.code-block__copy {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
}

.response-block {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-top: var(--space-md);
}

.response-block__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.response-block pre {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--success);
  white-space: pre;
  overflow-x: auto;
}

/* ── Browse Modal (File/Folder picker) ─────── */
.browse-list {
  max-height: 400px;
  overflow-y: auto;
}

.browse-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.browse-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
}

.browse-item__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.browse-item__info {
  flex: 1;
  min-width: 0;
}

.browse-item__name {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browse-item__id {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── Footer ────────────────────────────────── */
.footer {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer a {
  color: var(--text-secondary);
}

/* ── Inline Edit ───────────────────────────── */
.inline-edit {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.inline-edit__input {
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--border-light);
  color: var(--text-primary);
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  padding: 2px 4px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.inline-edit__input:focus {
  border-bottom-color: var(--accent);
}

/* ── Confirm Dialog ────────────────────────── */
.confirm-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-lg);
}

/* ── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }

  .nav__links {
    display: none;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }

  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-lg);
  }

  .hero {
    padding: 60px 0 50px;
  }

  .hero__actions {
    flex-direction: column;
  }

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

  .connect-banner {
    flex-direction: column;
    text-align: center;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .modal {
    padding: var(--space-lg);
  }

  .toast-container {
    top: var(--space-md);
    right: var(--space-md);
    left: var(--space-md);
  }

  .toast {
    max-width: 100%;
  }

  .api-key-display {
    flex-direction: column;
    align-items: flex-start;
  }

  .api-url-box {
    flex-wrap: wrap;
  }

  .api-url-box__url {
    width: 100%;
    order: 3;
  }
}

@media (max-width: 480px) {
  .steps__grid {
    grid-template-columns: 1fr;
  }

  .features__grid {
    grid-template-columns: 1fr;
  }
}

/* ── Animations ────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.animate-in {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }

/* ── Selection ─────────────────────────────── */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

/* ── Focus Visible ─────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Back button ───────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: var(--space-lg);
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--text-primary);
}

/* ── Spinner ───────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ── Loading overlay ───────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}

.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-dots {
  display: flex;
  gap: 8px;
}

.loader-dots span {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  animation: loaderBounce 1.4s ease-in-out infinite;
}

.loader-dots span:nth-child(2) { animation-delay: 0.16s; }
.loader-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes loaderBounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── Danger Zone ───────────────────────────── */
.danger-zone {
  margin-top: var(--space-2xl);
  padding: var(--space-lg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(239, 68, 68, 0.04);
}

.danger-zone__title {
  color: var(--error);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.danger-zone__text {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: var(--space-md);
}

/* ── Tabs (Docs) ───────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-xl);
}

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

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

.tab-btn.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

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

/* ── CTA Section ───────────────────────────── */
.cta-section {
  padding: var(--space-3xl) 0;
  text-align: center;
}

.cta-section__title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--space-md);
}

.cta-section__text {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: var(--space-xl);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   Light Theme
   ============================================ */
[data-theme="light"] {
  /* Backgrounds */
  --bg-primary: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.85);
  --bg-input: rgba(240, 242, 248, 0.9);
  --bg-hover: rgba(99, 102, 241, 0.06);

  /* Text */
  --text-primary: #1a1a2e;
  --text-secondary: #5a5a7a;
  --text-muted: #8a8aaa;
  --text-inverse: #ffffff;

  /* Borders */
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-light: rgba(0, 0, 0, 0.10);
  --border-accent: rgba(99, 102, 241, 0.3);

  /* Shadows - lighter for light theme */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --shadow-accent: 0 4px 24px rgba(99, 102, 241, 0.15);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.08);
}

/* ============================================
   Light Theme — Component Overrides
   ============================================ */
[data-theme="light"] .card {
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .nav {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="light"] .btn--google {
  background: #ffffff;
  border: 1px solid #dadce0;
  color: #3c4043;
}

[data-theme="light"] .btn--google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

[data-theme="light"] .hero {
  background: linear-gradient(135deg, #f0f0ff 0%, #e8e8ff 50%, #f5f0ff 100%);
}

[data-theme="light"] .form-input {
  background: var(--bg-input);
  border-color: var(--border-light);
  color: var(--text-primary);
}

[data-theme="light"] .modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .footer {
  background: #e8e8f0;
  color: var(--text-secondary);
}

[data-theme="light"] .api-url {
  background: #f0f2f8;
  border-color: var(--border-subtle);
}

[data-theme="light"] .code-block {
  background: #f5f5fa;
}

[data-theme="light"] .step-item::before {
  color: var(--accent);
  opacity: 0.3;
}

/* ============================================
   RTL Support
   ============================================ */

/* Base RTL direction — this makes flexbox auto-reverse */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* ── Navigation RTL ────────────────────────── */
[dir="rtl"] .nav__logo { flex-direction: row-reverse; }
[dir="rtl"] .nav__logo-icon { margin-left: 8px; margin-right: 0; }
[dir="rtl"] .back-link { flex-direction: row-reverse; }
[dir="rtl"] .back-link svg { transform: rotate(180deg); }

/* ── Hero Section RTL ──────────────────────── */
[dir="rtl"] .hero { text-align: right; }
[dir="rtl"] .hero__badge { direction: rtl; }
[dir="rtl"] .hero__title { text-align: right; }
[dir="rtl"] .hero__subtitle { text-align: right; }
[dir="rtl"] .hero__actions { justify-content: flex-start; }

/* ── Feature Cards RTL ─────────────────────── */
[dir="rtl"] .feature-card { text-align: right; }
[dir="rtl"] .feature-card__icon { margin-left: auto; margin-right: 0; }

/* ── Steps Section RTL ─────────────────────── */
[dir="rtl"] .step-item { text-align: right; }
[dir="rtl"] .step-item::before { left: auto; right: 0; }

/* ── Dashboard RTL ─────────────────────────── */
[dir="rtl"] .section-header { text-align: right; }
[dir="rtl"] .app-card { text-align: right; }
[dir="rtl"] .app-card__meta { justify-content: flex-start; }
[dir="rtl"] .connect-banner { text-align: right; }

/* ── Detail Page RTL ───────────────────────── */
[dir="rtl"] .detail-header { text-align: right; }
[dir="rtl"] .linked-card { text-align: right; }
[dir="rtl"] .linked-card__header { flex-direction: row-reverse; }
[dir="rtl"] .api-url-box { flex-direction: row-reverse; }
[dir="rtl"] .danger-zone { text-align: right; }
[dir="rtl"] .stat-card { text-align: right; }

/* ── Auth Pages RTL ────────────────────────── */
[dir="rtl"] .auth-card { text-align: right; }
[dir="rtl"] .auth-card__footer { text-align: center; }
[dir="rtl"] .form-group { text-align: right; }
[dir="rtl"] .form-input { text-align: right; }
[dir="rtl"] .form-input[type="email"] { direction: ltr; text-align: right; }

/* ── Buttons RTL ───────────────────────────── */
[dir="rtl"] .btn svg { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .btn--google { flex-direction: row-reverse; }

/* ── Modals RTL ────────────────────────────── */
[dir="rtl"] .modal { text-align: right; }
[dir="rtl"] .modal__header { flex-direction: row-reverse; }
[dir="rtl"] .modal__close { left: 16px; right: auto; }
[dir="rtl"] .confirm-actions { flex-direction: row-reverse; }

/* ── Toast RTL ─────────────────────────────── */
[dir="rtl"] .toast-container { left: var(--space-lg); right: auto; }
[dir="rtl"] .toast { flex-direction: row-reverse; text-align: right; }

/* ── Browse List RTL ───────────────────────── */
[dir="rtl"] .browse-item { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .browse-item__info { text-align: right; }

/* ── CTA Section RTL ───────────────────────── */
[dir="rtl"] .cta-section { text-align: right; }

/* ── Footer RTL ────────────────────────────── */
[dir="rtl"] .footer { text-align: right; }

/* ── Keep code/URLs always LTR ─────────────── */
[dir="rtl"] .api-url-box__url,
[dir="rtl"] .api-key-display code,
[dir="rtl"] .app-card__key code,
[dir="rtl"] code,
[dir="rtl"] pre { direction: ltr; text-align: left; }

/* ── RTL Arabic Font ──────────────────────── */
[dir="rtl"] body,
[dir="rtl"] * {
  font-family: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 {
  font-family: 'IBM Plex Sans Arabic', 'Outfit', system-ui, sans-serif;
}

/* ── Settings Controls ─────────────────────── */
.settings-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card-glass);
  backdrop-filter: blur(12px);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 1.1rem;
  padding: 0;
}

.settings-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
  background: var(--bg-hover);
  transform: scale(1.05);
}

.lang-toggle-btn {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  width: auto;
  padding: 0 10px;
}

/* ── Docs RTL ──────────────────────────────── */
[dir="rtl"] .docs-layout { flex-direction: row-reverse; }
[dir="rtl"] .docs-sidebar { border-left: 1px solid var(--border-subtle); border-right: none; }
[dir="rtl"] .docs-sidebar__link--active { border-left-color: var(--accent); border-right-color: transparent; }
[dir="rtl"] .docs-content { text-align: right; }
[dir="rtl"] .endpoint-card__header { flex-direction: row-reverse; }
[dir="rtl"] .params-table { text-align: right; }
[dir="rtl"] .params-table th, [dir="rtl"] .params-table td { text-align: right; }
[dir="rtl"] .code-tabs { flex-direction: row-reverse; }
[dir="rtl"] .code-block { direction: ltr; text-align: left; }
[dir="rtl"] .response-block { direction: ltr; text-align: left; }
[dir="rtl"] .response-block__label { direction: rtl; text-align: right; }
[dir="rtl"] .api-url-box { flex-direction: row-reverse; }
