/* ==========================================================================
   modern-enhancements.css — Afaq Platform Master UI/UX Enhancement Stylesheet
   Identity: Deep Navy (#07345A), Vibrant Wave Teal (#0D9A9B), Sun Amber (#FDB833)
   ========================================================================== */

/* 1. Design Tokens & CSS Custom Properties */
:root {
  /* Core Brand Colors */
  --afaq-brand: #07345A;
  --afaq-brand-dark: #052740;
  --afaq-brand-light: #0A4E85;
  --afaq-brand-soft: #E7EDF3;
  --afaq-brand-surface: #F0F4F8;

  /* Accent Colors */
  --afaq-teal: #0D9A9B;
  --afaq-teal-dark: #087E83;
  --afaq-teal-light: #14B8A6;
  --afaq-teal-soft: #E2F3F3;
  --afaq-teal-glaze: rgba(13, 154, 155, 0.08);

  --afaq-amber: #FDB833;
  --afaq-amber-dark: #D97706;
  --afaq-amber-soft: #FEF3C7;

  --afaq-rose: #D64545;
  --afaq-rose-dark: #B91C1C;
  --afaq-rose-soft: #FBEDED;

  --afaq-emerald: #10B981;
  --afaq-emerald-soft: #ECFDF5;

  /* Neutrals & Surfaces */
  --afaq-canvas: #F8FAFC;
  --afaq-surface: #FFFFFF;
  --afaq-surface-raised: #FFFFFF;
  --afaq-border: #E2E8F0;
  --afaq-border-subtle: #EDF2F7;
  --afaq-border-hover: #CBD5E1;
  --afaq-border-focus: #0D9A9B;

  /* Text & Ink */
  --afaq-ink: #0F172A;
  --afaq-ink-secondary: #334155;
  --afaq-ink-soft: #64748B;
  --afaq-ink-subtle: #94A3B8;

  /* Transitions & Timing */
  --transition-instant: 0.1s ease;
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Elevation Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(7, 52, 90, 0.03);
  --shadow-sm: 0 1px 3px 0 rgba(7, 52, 90, 0.05), 0 1px 2px -1px rgba(7, 52, 90, 0.03);
  --shadow-card: 0 1px 3px 0 rgba(7, 52, 90, 0.03), 0 8px 24px -4px rgba(7, 52, 90, 0.04);
  --shadow-card-hover: 0 8px 12px -2px rgba(7, 52, 90, 0.05), 0 18px 32px -6px rgba(7, 52, 90, 0.09);
  --shadow-button: 0 2px 8px 0 rgba(7, 52, 90, 0.16);
  --shadow-button-hover: 0 4px 14px 0 rgba(7, 52, 90, 0.24);
  --shadow-teal-glow: 0 0 0 3px rgba(13, 154, 155, 0.18);
  --shadow-glass: 0 8px 32px 0 rgba(7, 52, 90, 0.06);
  --shadow-modal: 0 25px 50px -12px rgba(7, 52, 90, 0.25);

  /* Border Radii */
  --radius-xs: 0.375rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.125rem;
  --radius-2xl: 1.5rem;
  --radius-pill: 9999px;
}

/* 2. Global Typography & Arabic Text Rendering */
html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--afaq-canvas);
  color: var(--afaq-ink);
  line-height: 1.65;
}

/* Tabular figures for numbers, counters, dates, and tables */
table, .stat-value, [class*="text-3xl"], [class*="text-2xl font-bold"], .activity-score, .activity-rank {
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-feature-settings: 'tnum' 1, 'lnum' 1;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.015em;
  font-weight: 700;
  line-height: 1.35;
}

h1:not([class*="text-"]),
h2:not([class*="text-"]),
h3:not([class*="text-"]),
h4:not([class*="text-"]),
h5:not([class*="text-"]),
h6:not([class*="text-"]) {
  color: var(--afaq-brand);
}

/* Headings inside white text or dark gradient containers must be white */
.text-white :is(h1, h2, h3, h4, h5, h6),
[class*="text-white"] :is(h1, h2, h3, h4, h5, h6),
[class*="bg-brand"] :is(h1, h2, h3, h4, h5, h6),
[class*="from-brand"] :is(h1, h2, h3, h4, h5, h6),
[class*="bg-teal"] :is(h1, h2, h3, h4, h5, h6),
.activity-hero :is(h1, h2, h3, h4, h5, h6),
.site-footer :is(h1, h2, h3, h4, h5, h6) {
  color: #FFFFFF !important;
}

h1 { font-size: clamp(1.5rem, 2.8vw, 2.25rem); font-weight: 800; }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.75rem); }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.35rem); }

p {
  line-height: 1.75;
  color: inherit;
}

::selection {
  background-color: #CDE9E9;
  color: var(--afaq-brand-dark);
}

/* 3. Ultra-Thin Modern Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: var(--radius-pill);
  transition: background var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* 4. Smooth Animations & Keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

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

@keyframes bounceSubtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.animate-fade-in { animation: fadeIn var(--transition-normal) forwards; }
.animate-slide-up { animation: slideUp var(--transition-normal) forwards; }
.pulse-glow { animation: pulseGlow 2.5s infinite ease-in-out; }

/* 5. Enhanced Cards & Panels (.card, .simple-panel, etc.) */
.card,
.simple-panel,
div[class*="rounded-2xl border"],
section[class*="rounded-2xl border"] {
  background-color: var(--afaq-surface);
  border: 1px solid var(--afaq-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

@media (hover: hover) {
  .card:hover,
  .simple-panel:hover,
  a[class*="rounded-2xl border"]:hover,
  div[class*="card"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--afaq-border-hover);
  }
}

.card:active,
a[class*="card"]:active {
  transform: translateY(0);
}

.card-hover-effect {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.card-hover-effect:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--afaq-teal);
}

/* Glassmorphism Surface */
.glass-effect,
.glass-surface {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow-glass);
}

/* 6. Dashboard KPI Metric Cards */
.grid a[class*="card"],
.grid div[class*="card"],
.grid a[class*="rounded-2xl border"] {
  position: relative;
  overflow: hidden;
}

.grid a[class*="card"] span[class*="text-3xl"],
.grid div[class*="card"] span[class*="text-3xl"],
.grid a[class*="rounded-2xl border"] p[class*="text-3xl"],
.grid div[class*="rounded-2xl border"] p[class*="text-3xl"] {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--afaq-brand);
}

/* KPI Card icon badge hover micro-interaction */
.grid a[class*="card"] span[class*="rounded-2xl"],
.grid div[class*="card"] span[class*="rounded-2xl"],
.grid a[class*="rounded-2xl border"] span[class*="rounded-xl"] {
  transition: transform var(--transition-spring), box-shadow var(--transition-fast);
}

.grid a[class*="card"]:hover span[class*="rounded-2xl"],
.grid div[class*="card"]:hover span[class*="rounded-2xl"],
.grid a[class*="rounded-2xl border"]:hover span[class*="rounded-xl"] {
  transform: scale(1.08);
}

/* 7. Modern Button System (.btn, .btn-primary, .act, etc.) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}

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

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Button */
.btn-primary,
button.btn-primary,
a.btn-primary,
.simple-editor .btn-primary {
  background: linear-gradient(135deg, var(--afaq-brand) 0%, var(--afaq-brand-light) 100%);
  color: #FFFFFF !important;
  box-shadow: var(--shadow-button);
  border-color: transparent;
}

.btn-primary:hover,
button.btn-primary:hover,
a.btn-primary:hover,
.simple-editor .btn-primary:hover {
  background: linear-gradient(135deg, var(--afaq-brand-dark) 0%, var(--afaq-brand) 100%);
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-1px);
}

.btn-primary:active,
button.btn-primary:active,
a.btn-primary:active {
  transform: translateY(0) scale(0.975);
}

/* Outline Button */
.btn-outline,
button.btn-outline,
a.btn-outline,
.simple-editor .btn-outline {
  background: var(--afaq-surface);
  border-color: var(--afaq-border);
  color: var(--afaq-ink-secondary);
}

.btn-outline:hover,
button.btn-outline:hover,
a.btn-outline:hover,
.simple-editor .btn-outline:hover {
  border-color: var(--afaq-brand);
  color: var(--afaq-brand);
  background-color: var(--afaq-brand-soft);
  transform: translateY(-1px);
}

/* Ghost Button */
.btn-ghost,
button.btn-ghost,
a.btn-ghost {
  background: transparent;
  color: var(--afaq-ink-soft);
  border-color: transparent;
}

.btn-ghost:hover,
button.btn-ghost:hover,
a.btn-ghost:hover {
  background: var(--afaq-brand-soft);
  color: var(--afaq-brand);
}

/* Danger Button */
.btn-danger,
button.btn-danger,
a.btn-danger {
  background: linear-gradient(135deg, var(--afaq-rose) 0%, var(--afaq-rose-dark) 100%);
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(214, 69, 69, 0.25);
}

.btn-danger:hover,
button.btn-danger:hover,
a.btn-danger:hover {
  filter: brightness(0.93);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(214, 69, 69, 0.35);
}

/* Action Icon Buttons (.act) */
.act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border-radius: var(--radius-md);
  color: var(--afaq-ink-soft);
  background-color: transparent;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.act:hover {
  background-color: #F1F5F9;
  color: var(--afaq-brand);
  transform: scale(1.06);
}

.act:active {
  transform: scale(0.94);
}

.act-danger:hover {
  background-color: var(--afaq-rose-soft);
  color: var(--afaq-rose);
}

/* 8. Form Inputs, Selects & Controls */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="color"]):not([type="range"]),
select,
textarea,
.field,
input.nu-field {
  width: 100%;
  font-size: 0.875rem;
  color: var(--afaq-ink);
  background-color: #FAFCFE;
  border: 1.5px solid var(--afaq-border);
  border-radius: var(--radius-lg);
  padding: 0.6rem 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover,
.field:hover {
  border-color: var(--afaq-border-hover);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus,
.field:focus,
input.nu-field:focus {
  background-color: #FFFFFF;
  border-color: var(--afaq-teal) !important;
  box-shadow: var(--shadow-teal-glow) !important;
  outline: none !important;
}

input::placeholder,
textarea::placeholder {
  color: var(--afaq-ink-subtle);
  font-weight: 400;
}

/* Search input in header and filters */
header input[type="search"],
form input[type="search"] {
  background-color: #F1F5F9;
  border-radius: var(--radius-pill);
  border-color: transparent;
  transition: all var(--transition-fast);
}

header input[type="search"]:focus,
form input[type="search"]:focus {
  background-color: #FFFFFF;
  border-color: var(--afaq-teal) !important;
  box-shadow: 0 0 0 3px rgba(13, 154, 155, 0.16) !important;
}

/* Custom Checkbox & Radio */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--afaq-teal);
  width: 1.15rem;
  height: 1.15rem;
  cursor: pointer;
  border-radius: 4px;
  vertical-align: middle;
  transition: transform var(--transition-fast);
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
  transform: scale(1.08);
}

/* Select Dropdown Polish */
select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: left 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-left: 2.25rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

[dir="ltr"] select {
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  padding-left: 0.95rem;
}

/* Form validation error lists */
.errorlist,
.text-rose {
  color: var(--afaq-rose);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* 9. Modern Tables & Responsive Data Displays */
.overflow-x-auto,
.table-responsive-wrapper {
  border-radius: var(--radius-xl);
  border: 1px solid var(--afaq-border);
  background-color: var(--afaq-surface);
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.5rem;
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Overflow shadow cue on scrollable tables */
.table-responsive-wrapper.can-scroll-left::before,
.table-responsive-wrapper.can-scroll-right::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
  z-index: 15;
  transition: opacity var(--transition-fast);
}

.table-responsive-wrapper.can-scroll-left::before {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.08), transparent);
}

.table-responsive-wrapper.can-scroll-right::after {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.08), transparent);
}

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

table th,
.table-modern th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #F8FAFC;
  color: var(--afaq-ink-secondary);
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 0.85rem 1rem;
  text-align: right;
  border-bottom: 1.5px solid var(--afaq-border);
  white-space: nowrap;
}

[dir="ltr"] table th,
[dir="ltr"] .table-modern th {
  text-align: left;
}

table td,
.table-modern td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #F1F5F9;
  color: var(--afaq-ink);
  vertical-align: middle;
  transition: background-color var(--transition-instant);
}

table tbody tr:last-child td,
.table-modern tbody tr:last-child td {
  border-bottom: none;
}

table tbody tr:hover td,
.table-modern tbody tr:hover td {
  background-color: var(--afaq-teal-glaze);
}

/* 10. Sticky Glass Header & Navbar */
header.sticky {
  background-color: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85) !important;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

/* Notification badge indicator */
header a[title="الإشعارات"] span,
nav a[title*="الإشعارات"] span.bg-rose {
  box-shadow: 0 0 0 2px #FFFFFF, 0 2px 6px rgba(214, 69, 69, 0.4);
  font-weight: 700;
}

/* 11. Modern Sidebar Navigation */
#sidebar {
  background-color: var(--afaq-surface);
  border-left: 1px solid var(--afaq-border);
  box-shadow: -2px 0 12px rgba(7, 52, 90, 0.02);
}

.nav-item {
  color: var(--afaq-ink-soft);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-item:hover {
  background-color: #F1F5F9;
  color: var(--afaq-brand);
  transform: translateX(-2px);
}

[dir="ltr"] .nav-item:hover {
  transform: translateX(2px);
}

.nav-item.active,
.nav-item[aria-current="page"] {
  background: linear-gradient(135deg, rgba(7, 52, 90, 0.08) 0%, rgba(13, 154, 155, 0.08) 100%);
  color: var(--afaq-brand) !important;
  font-weight: 700;
  box-shadow: inset -3px 0 0 var(--afaq-teal);
}

[dir="ltr"] .nav-item.active,
[dir="ltr"] .nav-item[aria-current="page"] {
  box-shadow: inset 3px 0 0 var(--afaq-teal);
}

.nav-item.active i,
.nav-item[aria-current="page"] i {
  color: var(--afaq-teal);
}

/* 12. Public Website Styling (Hero, Features, Footer) */
/* Rotating word animation enhancement */
.word-swap {
  display: inline-block;
  background: linear-gradient(135deg, var(--afaq-brand) 0%, var(--afaq-teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-bottom: 2px;
}

/* Feature cards */
#features .grid > div {
  background-color: var(--afaq-surface);
  border: 1px solid var(--afaq-border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  transition: all var(--transition-fast);
}

#features .grid > div:hover {
  transform: translateY(-4px);
  border-color: var(--afaq-teal);
  box-shadow: 0 16px 32px -4px rgba(7, 52, 90, 0.08);
}

/* Public Footer Polish */
.site-footer {
  background: linear-gradient(170deg, #07345A 0%, #052740 100%) !important;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--afaq-teal), var(--afaq-amber), transparent);
}

.footer-social-link,
.site-footer a[href*="twitter"],
.site-footer a[href*="instagram"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.1);
  transition: all var(--transition-fast);
}

.footer-social-link:hover,
.site-footer a[href*="twitter"]:hover,
.site-footer a[href*="instagram"]:hover {
  background-color: var(--afaq-amber);
  color: var(--afaq-brand-dark) !important;
  transform: translateY(-3px) scale(1.05);
}

/* 13. Login & Authentication Flow */
.auth-card {
  background: #F1F4F8;
  border-radius: var(--radius-2xl);
  box-shadow: 0 32px 64px -24px rgba(7, 52, 90, 0.28), 0 12px 28px -18px rgba(7, 52, 90, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.auth-art {
  background: linear-gradient(155deg, #0A3F6B 0%, #07345A 45%, #052740 100%);
  position: relative;
  overflow: hidden;
}

.auth-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 80%, rgba(13, 154, 155, 0.25) 0%, transparent 60%);
  pointer-events: none;
}

/* Neumorphic / Glassmorphic field & button in Login */
input.nu-field {
  background: #EDF1F6;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.85rem 1.35rem;
  font-size: 1rem;
  box-shadow: inset 3px 3px 6px rgba(7, 52, 90, 0.08), inset -3px -3px 6px #FFFFFF;
  transition: all var(--transition-fast);
}

input.nu-field:focus {
  background: #FFFFFF;
  border-color: var(--afaq-teal);
  box-shadow: 0 0 0 3px rgba(13, 154, 155, 0.2), inset 1px 1px 3px rgba(7, 52, 90, 0.04);
}

.nu-btn {
  background: linear-gradient(135deg, #F8FAFC 0%, #EDF1F6 100%);
  color: var(--afaq-brand);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 4px 6px 14px rgba(7, 52, 90, 0.12), -4px -6px 14px #FFFFFF;
  transition: all var(--transition-fast);
}

.nu-btn:hover {
  background: linear-gradient(135deg, var(--afaq-brand) 0%, var(--afaq-brand-light) 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(7, 52, 90, 0.25);
  transform: translateY(-2px);
}

.nu-btn:active {
  transform: translateY(0) scale(0.98);
}

/* 14. Toast Notifications & System Messages */
.space-y-2.mb-5 > div,
div[class*="bg-rose/10"],
div[class*="bg-amber/10"],
div[class*="bg-brand-soft"] {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

div[class*="bg-rose/10"] {
  border-color: rgba(214, 69, 69, 0.2);
}
div[class*="bg-amber/10"] {
  border-color: rgba(253, 184, 51, 0.3);
}
div[class*="bg-brand-soft"] {
  border-color: rgba(7, 52, 90, 0.12);
}

/* Toast close button */
.toast-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.6;
  border-radius: 6px;
  transition: all var(--transition-fast);
}
.toast-close-btn:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.05);
}

/* 15. Educational Activities & Interactive Games Polish */
.activity-hero {
  background: linear-gradient(135deg, #07345A 0%, #087E83 50%, #0D9A9B 100%) !important;
  box-shadow: 0 12px 36px -6px rgba(7, 52, 90, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.game-card {
  background-color: var(--afaq-surface);
  border: 1.5px solid var(--afaq-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-fast);
}

.game-option {
  border: 2px solid var(--afaq-border) !important;
  border-radius: var(--radius-lg) !important;
  transition: all var(--transition-fast) !important;
}

.game-option:hover {
  border-color: var(--afaq-teal) !important;
  background-color: #F8FAFC !important;
  transform: translateY(-1px);
}

.game-option:has(input:checked) {
  border-color: var(--afaq-teal) !important;
  background: linear-gradient(135deg, #F0FDFA 0%, #E6F6F6 100%) !important;
  box-shadow: 0 4px 12px rgba(13, 154, 155, 0.12) !important;
  transform: translateY(-1px);
}

.activity-progress {
  height: 9px !important;
  border-radius: var(--radius-pill) !important;
  background: #E2E8F0 !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.activity-progress span {
  background: linear-gradient(90deg, #087E83, #0D9A9B, #2DD4BF) !important;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 10px rgba(13, 154, 155, 0.5);
}

/* Rank Medals on Leaderboard */
.activity-rank {
  border-radius: var(--radius-md) !important;
  font-weight: 800 !important;
}
li:nth-child(1) .activity-rank {
  background: linear-gradient(135deg, #FDB833 0%, #D97706 100%) !important;
  color: #FFFFFF !important;
}
li:nth-child(2) .activity-rank {
  background: linear-gradient(135deg, #E2E8F0 0%, #94A3B8 100%) !important;
  color: #FFFFFF !important;
}
li:nth-child(3) .activity-rank {
  background: linear-gradient(135deg, #FDBA74 0%, #C2410C 100%) !important;
  color: #FFFFFF !important;
}

/* 16. Stepper & Lesson Studio */
.lesson-steps a {
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.lesson-steps a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.lesson-steps a[aria-current="step"] {
  background: linear-gradient(135deg, var(--afaq-brand) 0%, var(--afaq-brand-light) 100%) !important;
  box-shadow: var(--shadow-button) !important;
}

/* 17. Accessibility Focus States */
:focus-visible {
  outline: 3px solid rgba(13, 154, 155, 0.45) !important;
  outline-offset: 2px !important;
}

/* Skip to content link */
.skip-link {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 100;
  transform: translateY(-180%);
  background: var(--afaq-brand);
  color: #FFFFFF;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: var(--shadow-dropdown);
  transition: transform var(--transition-fast);
}
.skip-link:focus {
  transform: translateY(0);
}

/* 18. Print Media Optimizations */
@media print {
  #sidebar,
  #overlay,
  #sidebar-close,
  header,
  .site-footer,
  .no-print,
  button:not([type="submit"]),
  .btn:not([href]) {
    display: none !important;
  }

  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }

  main {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .card, .simple-panel {
    box-shadow: none !important;
    border: 1px solid #CCCCCC !important;
    page-break-inside: avoid;
  }

  table {
    border-collapse: collapse !important;
  }

  th, td {
    border: 1px solid #DDDDDD !important;
  }
}

/* 19. Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
