/* ==========================================================================
   AL AMEEN ONLINE ACADEMY - DESIGN SYSTEM & STYLESHEET
   Supports: LTR & RTL (English, Urdu, Arabic), Multi-Theme & Responsive UI
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600;700;800&family=Noto+Naskh+Arabic:wght@400;600;700&family=Noto+Nastaliq+Urdu:wght@400;700&display=swap');

:root {
  /* Brand Palette */
  --primary-dark: #0f172a;
  --primary-navy: #0a192f;
  --primary-blue: #1e40af;
  --primary-royal: #2563eb;
  --accent-gold: #f59e0b;
  --accent-amber: #d97706;
  --accent-emerald: #10b981;
  --accent-rose: #ef4444;
  --accent-purple: #8b5cf6;

  /* Neutral Spectrum */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --border-color: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.2);

  /* Spacing & Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* RTL Typography Overrides */
[dir="rtl"] body {
  font-family: 'Noto Naskh Arabic', 'Noto Nastaliq Urdu', 'Amiri', serif;
}

/* Layout Container */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Quick Role Switcher Bar */
.role-switcher-bar {
  background: linear-gradient(90deg, #0a192f 0%, #1e3a8a 100%);
  color: white;
  padding: 8px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  z-index: 1000;
  position: relative;
}

.role-switcher-bar .brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #fbbf24;
}

.role-switcher-bar .brand-badge img {
  height: 28px;
  border-radius: 4px;
}

.role-btn-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.role-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.role-pill:hover, .role-pill.active {
  background: var(--primary-royal);
  color: white;
  border-color: var(--primary-royal);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

.lang-selector-select {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
}

.lang-selector-select option {
  background: var(--primary-dark);
  color: white;
}

/* Application Header / Navbar for Public Site */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 1.25rem;
}

.nav-brand img {
  height: 42px;
  object-fit: contain;
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-fast);
  cursor: pointer;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary-royal);
}

/* Main Dashboard Shell */
.app-container {
  display: flex;
  flex: 1;
}

.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 8px;
  transition: var(--transition-normal);
  flex-shrink: 0;
}

.sidebar-header {
  padding: 0 12px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 12px;
}

.sidebar-header .user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-royal), var(--accent-gold));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.user-info .name {
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
}

.user-info .role {
  font-size: 0.75rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.sidebar-link.active {
  background: var(--primary-royal);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sidebar-link i {
  font-size: 1.2rem;
  width: 22px;
  text-align: center;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  background-color: var(--bg-main);
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

/* Grid & Cards */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.2);
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-blue { background: rgba(37, 99, 235, 0.1); color: var(--primary-royal); }
.stat-gold { background: rgba(245, 158, 11, 0.1); color: var(--accent-gold); }
.stat-emerald { background: rgba(16, 185, 129, 0.1); color: var(--accent-emerald); }
.stat-purple { background: rgba(139, 92, 246, 0.1); color: var(--accent-purple); }
.stat-rose { background: rgba(239, 68, 68, 0.1); color: var(--accent-rose); }

.stat-info .value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
}

.stat-info .label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

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

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-royal);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-blue);
  box-shadow: var(--shadow-glow);
}

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

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

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-main);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--accent-rose);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Form Controls */
.form-group {
  margin-bottom: 16px;
}

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background-color: var(--bg-card);
  color: var(--text-main);
  outline: none;
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary-royal);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

[dir="rtl"] .data-table {
  text-align: right;
}

.data-table th {
  background: var(--bg-main);
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: rgba(248, 250, 252, 0.8);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #047857; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #b91c1c; }
.badge-info { background: rgba(37, 99, 235, 0.15); color: #1d4ed8; }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-fast);
}

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

.modal-card {
  background: var(--bg-card);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  transform: translateY(20px);
  transition: var(--transition-normal);
}

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

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

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* Hero Section for Public Home */
.hero-section {
  background: linear-gradient(135deg, #0a192f 0%, #1e3a8a 60%, #0f172a 100%);
  color: white;
  padding: 80px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  color: white;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: #cbd5e1;
  max-width: 760px;
  margin: 0 auto 32px auto;
}

/* Certificate View Component */
.certificate-frame {
  background: #ffffff;
  border: 12px solid var(--primary-navy);
  padding: 40px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  max-width: 800px;
  margin: 0 auto;
}

.certificate-inner {
  border: 2px solid var(--accent-gold);
  padding: 30px;
  position: relative;
}

.certificate-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: 2px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.certificate-recipient {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-blue);
  border-bottom: 2px solid var(--border-color);
  display: inline-block;
  padding: 4px 30px;
  margin: 20px 0;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

[dir="rtl"] .toast-container {
  right: auto;
  left: 24px;
}

.toast {
  background: var(--primary-dark);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideUp 0.3s ease;
}

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

/* Hero Section with Islamic Banner Background */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, rgba(10, 25, 47, 0.88) 0%, rgba(15, 23, 42, 0.92) 100%), url('../images/islamic_hero_banner.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  padding: 80px 24px;
  text-align: center;
  border-bottom: 4px solid var(--accent-gold);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.hero-title {
  font-size: 3rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 4px 12px rgba(0,0,0,0.5);
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: #e2e8f0;
  max-width: 800px;
  margin: 0 auto 24px auto;
  line-height: 1.7;
}

.banner-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  border: 2px solid var(--border-color);
}

/* Responsive Utilities */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
  .hero-title {
    font-size: 2rem;
  }
  .hero-section {
    padding: 50px 16px;
  }
  .navbar {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
  }
  .main-content {
    padding: 16px;
  }
}

