/**
 * School Kalamina — App Layout Styles
 * وابسته به design-system.css
 */

/* ── Landing Header ── */
.site-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-height);
}
.site-header .nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
}
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.logo-icon {
  width: 44px; height: 44px;
  background: var(--gradient-accent);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  box-shadow: var(--shadow-accent);
}
.logo-text h1 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}
.logo-text span {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}
.nav-menu {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}
.nav-menu a {
  color: var(--color-text);
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
  transition: var(--transition);
}
.nav-menu a:hover,
.nav-menu a.active { color: var(--color-accent-start); }
.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 0; height: 2px;
  background: var(--gradient-accent);
  transition: width 0.3s ease;
}
.nav-menu a:hover::after,
.nav-menu a.active::after { width: 100%; }

.mobile-menu-btn {
  display: none;
  background: none; border: none;
  font-size: 24px; cursor: pointer; color: var(--color-text);
}

/* ── Hero ── */
.hero {
  background: var(--gradient-primary);
  padding: 140px 0 100px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: var(--space-4);
  text-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.hero p {
  font-size: var(--font-size-xl);
  opacity: 0.9;
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-left: auto; margin-right: auto;
}
.hero-buttons {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Features section ── */
.section {
  display: none;
  padding: var(--space-12) 0;
}
.section.active { display: block; }

.section-title {
  text-align: center;
  margin-bottom: var(--space-10);
}
.section-title h2 {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.section-title p {
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
}

.feature-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.feature-icon {
  width: 72px; height: 72px;
  margin: 0 auto var(--space-4);
  background: var(--gradient-accent);
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #fff;
  box-shadow: var(--shadow-accent);
}
.feature-card h3 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.feature-card p { color: var(--color-text-muted); font-size: var(--font-size-sm); }

/* ── Landing body bg for non-dashboard ── */
body.landing-mode .main-content {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* ══════════════════════════════════════
   DASHBOARD LAYOUT
══════════════════════════════════════ */
body.dashboard-mode {
  background: var(--color-bg);
}
body.dashboard-mode .site-header,
body.dashboard-mode .section { display: none !important; }

.dashboard {
  display: none;
  min-height: 100vh;
}
.dashboard.active { display: flex; flex-direction: column; }

/* Dashboard top bar */
.dash-header {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  padding: 0 var(--space-6);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.dash-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.dash-user h3 {
  font-size: var(--font-size-base);
  font-weight: 600;
  margin: 0;
}
.dash-user p {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin: 0;
}
.dash-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Sidebar + Content */
.dash-body {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--header-height));
}

.dash-sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  padding: var(--space-4) 0;
  flex-shrink: 0;
  overflow-y: auto;
}
.dash-sidebar .side-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px var(--space-5);
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: var(--font-size-sm);
  transition: var(--transition);
  border-right: 3px solid transparent;
  cursor: pointer;
  background: none;
  border-left: none;
  border-top: none;
  border-bottom: none;
  width: 100%;
  text-align: right;
}
.dash-sidebar .side-link:hover {
  background: #f1f5f9;
  color: var(--color-accent-start);
}
.dash-sidebar .side-link.active {
  background: #fff7ed;
  color: var(--color-accent-start);
  border-right-color: var(--color-accent-start);
  font-weight: 600;
}
.side-link .side-icon { font-size: 18px; width: 24px; text-align: center; }

.dash-content {
  flex: 1;
  padding: var(--space-6);
  overflow-y: auto;
}

.dash-page-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
  color: var(--color-text);
}

/* Stats grid inside dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

/* ── Mobile responsive ── */
@media (max-width: 900px) {
  .nav-menu { display: none; }
  .nav-menu.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0; right: 0;
    background: var(--color-surface);
    padding: var(--space-4);
    box-shadow: var(--shadow-md);
    gap: var(--space-3);
  }
  .mobile-menu-btn { display: block; }

  .dash-sidebar {
    position: fixed;
    right: 0; top: var(--header-height);
    bottom: 0;
    z-index: 90;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
  }
  .dash-sidebar.open { transform: translateX(0); }
  .dash-content { padding: var(--space-4); }
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--color-text-muted);
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

/* ── Loading spinner ── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent-start);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: var(--space-8) auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
