/**
 * ZEN Learning Management System - Theme Configuration
 * 
 * This file contains all reusable CSS variables and component styles
 * for consistent theming across the application.
 * 
 * Usage: Include this file in your layout or import in SCSS
 */

:root {
  /* ===== PRIMARY COLORS ===== */
  --zen-primary: #1FA2C4;
  --zen-primary-dark: #167d99;
  --zen-primary-light: #e8f6f9;
  
  /* ===== TEXT COLORS ===== */
  --zen-text: #1e293b;
  --zen-text-light: #64748b;
  --zen-text-muted: #94a3b8;
  
  /* ===== BACKGROUND COLORS ===== */
  --zen-bg: #f1f5f9;
  --zen-bg-light: #f8fafc;
  --zen-bg-white: #ffffff;
  
  /* ===== BORDER COLORS ===== */
  --zen-border: #e2e8f0;
  --zen-border-light: #f1f5f9;
  
  /* ===== STATUS COLORS ===== */
  --zen-success: #22c55e;
  --zen-success-light: #dcfce7;
  --zen-success-dark: #166534;
  
  --zen-danger: #ef4444;
  --zen-danger-light: #fee2e2;
  --zen-danger-dark: #991b1b;
  
  --zen-warning: #f59e0b;
  --zen-warning-light: #fef3c7;
  --zen-warning-dark: #92400e;
  
  --zen-info: #3b82f6;
  --zen-info-light: #dbeafe;
  --zen-info-dark: #1e40af;
  
  /* ===== SPACING ===== */
  --zen-spacing-xs: 4px;
  --zen-spacing-sm: 8px;
  --zen-spacing-md: 16px;
  --zen-spacing-lg: 24px;
  --zen-spacing-xl: 32px;
  
  /* ===== BORDER RADIUS ===== */
  --zen-radius-sm: 4px;
  --zen-radius-md: 6px;
  --zen-radius-lg: 8px;
  --zen-radius-xl: 12px;
  
  /* ===== TYPOGRAPHY ===== */
  --zen-font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --zen-font-size-xs: 11px;
  --zen-font-size-sm: 12px;
  --zen-font-size-base: 13px;
  --zen-font-size-md: 14px;
  --zen-font-size-lg: 16px;
  --zen-font-size-xl: 20px;
  --zen-font-weight-normal: 400;
  --zen-font-weight-medium: 500;
  --zen-font-weight-semibold: 600;
  --zen-font-weight-bold: 700;
  
  /* ===== LAYOUT ===== */
  --zen-sidebar-width: 300px;
  --zen-navbar-height: 60px;
  --zen-footer-height: 48px;
  
  /* ===== SHADOWS ===== */
  --zen-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --zen-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --zen-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
  
  /* ===== TRANSITIONS ===== */
  --zen-transition: all 0.3s ease;
  --zen-transition-fast: all 0.2s ease;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--zen-primary) !important;
  border: none !important;
  border-radius: var(--zen-radius-md);
  padding: var(--zen-spacing-sm) var(--zen-spacing-md);
  font-weight: var(--zen-font-weight-medium);
  font-size: var(--zen-font-size-base);
  color: #ffffff;
  transition: var(--zen-transition-fast);
}

.btn-primary:hover {
  background: var(--zen-primary-dark) !important;
  color: #ffffff;
}

.btn-success {
  background: var(--zen-success) !important;
  border: none !important;
  border-radius: var(--zen-radius-md);
  padding: var(--zen-spacing-sm) var(--zen-spacing-md);
  font-weight: var(--zen-font-weight-medium);
  font-size: var(--zen-font-size-base);
  color: #ffffff;
  transition: var(--zen-transition-fast);
}

.btn-success:hover {
  background: #16a34a !important;
  color: #ffffff;
}

.btn-outline-primary {
  border: 1px solid var(--zen-primary) !important;
  border-radius: var(--zen-radius-md);
  padding: var(--zen-spacing-sm) var(--zen-spacing-md);
  font-weight: var(--zen-font-weight-medium);
  font-size: var(--zen-font-size-base);
  color: var(--zen-primary);
  background: transparent;
  transition: var(--zen-transition-fast);
}

.btn-outline-primary:hover {
  background: var(--zen-primary) !important;
  color: #ffffff;
}

/* Button Sizes */
.btn-sm {
  padding: 6px 12px;
  font-size: var(--zen-font-size-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: var(--zen-font-size-md);
}

/* ===== PANELS ===== */
.panel {
  background: var(--zen-bg-white);
  border: none;
  border-radius: var(--zen-radius-lg);
  box-shadow: var(--zen-shadow-sm);
  margin-bottom: var(--zen-spacing-lg);
}

.panel-heading {
  background: transparent;
  border-bottom: 1px solid var(--zen-border);
  padding: var(--zen-spacing-md) var(--zen-spacing-lg);
}

.panel-title {
  color: var(--zen-text);
  font-weight: var(--zen-font-weight-semibold);
  font-size: var(--zen-font-size-md);
  margin: 0;
}

.panel-body {
  padding: var(--zen-spacing-lg);
}

/* ===== CARDS ===== */
.card {
  border-radius: var(--zen-radius-lg);
  box-shadow: var(--zen-shadow-sm);
  border: none;
  transition: var(--zen-transition);
}

.card:hover {
  box-shadow: var(--zen-shadow-md);
}

.card-block {
  padding: var(--zen-spacing-lg) !important;
  border-radius: var(--zen-radius-lg);
}

/* ===== BADGES ===== */
.badge {
  padding: var(--zen-spacing-xs) 10px;
  border-radius: var(--zen-radius-xl);
  font-size: var(--zen-font-size-xs);
  font-weight: var(--zen-font-weight-semibold);
}

.badge-success {
  background: var(--zen-success-light);
  color: var(--zen-success-dark);
}

.badge-danger {
  background: var(--zen-danger-light);
  color: var(--zen-danger-dark);
}

.badge-warning {
  background: var(--zen-warning-light);
  color: var(--zen-warning-dark);
}

.badge-info {
  background: var(--zen-info-light);
  color: var(--zen-info-dark);
}

.badge-primary {
  background: var(--zen-primary);
  color: #ffffff;
}

/* ===== PROGRESS BARS ===== */
.progress {
  border-radius: var(--zen-radius-md);
  background: var(--zen-bg-light);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  border-radius: var(--zen-radius-md);
  font-weight: var(--zen-font-weight-semibold);
  transition: width 0.6s ease;
}

.bg-primary {
  background: var(--zen-primary) !important;
}

.bg-success {
  background: var(--zen-success) !important;
}

.bg-warning {
  background: var(--zen-warning) !important;
}

.bg-danger {
  background: var(--zen-danger) !important;
}

.bg-info {
  background: var(--zen-info) !important;
}

/* ===== STATS CARDS ===== */
.bg-red-600 {
  background: var(--zen-primary) !important;
}

.bg-blue-600 {
  background: var(--zen-info) !important;
}

.bg-green-600 {
  background: var(--zen-success) !important;
}

/* ===== TABLES ===== */
.table thead th {
  background: var(--zen-bg-light);
  color: var(--zen-text-light);
  font-weight: var(--zen-font-weight-semibold);
  border: none;
  border-bottom: 1px solid var(--zen-border);
  padding: 12px var(--zen-spacing-md);
  font-size: var(--zen-font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody td {
  padding: 14px var(--zen-spacing-md);
  vertical-align: middle;
  font-size: var(--zen-font-size-base);
  border-bottom: 1px solid var(--zen-border-light);
  color: var(--zen-text);
}

.table tbody tr:hover {
  background: var(--zen-bg-light);
}

/* ===== ALERTS ===== */
.alert {
  border-radius: var(--zen-radius-lg);
  border: none;
  border-left: 4px solid;
  padding: var(--zen-spacing-md) var(--zen-spacing-lg);
}

.alert-success {
  background: var(--zen-success-light);
  border-left-color: var(--zen-success);
  color: var(--zen-success-dark);
}

.alert-danger {
  background: var(--zen-danger-light);
  border-left-color: var(--zen-danger);
  color: var(--zen-danger-dark);
}

.alert-warning {
  background: var(--zen-warning-light);
  border-left-color: var(--zen-warning);
  color: var(--zen-warning-dark);
}

.alert-info {
  background: var(--zen-info-light);
  border-left-color: var(--zen-info);
  color: var(--zen-info-dark);
}

/* ===== UTILITY CLASSES ===== */
.text-zen-primary {
  color: var(--zen-primary) !important;
}

.bg-zen-primary {
  background: var(--zen-primary) !important;
}

.border-zen-primary {
  border-color: var(--zen-primary) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root {
    --zen-spacing-lg: 16px;
    --zen-spacing-xl: 24px;
  }
  
  .panel-body {
    padding: var(--zen-spacing-md);
  }
}


/* ============================================================================
 * 2026-08-14 (SVN r836) — Page-header consistency pass (P0)
 * Purely additive. Extends the existing .page-header + .page-title rules that
 * live in layouts/backend/index.blade.php with tighter spacing, a colored
 * icon slot, breadcrumb baseline, and a .page-description utility so every
 * page reads the same across admin/manager/instructor/student surfaces.
 * ============================================================================ */
.page-header {
  padding: 18px 24px 16px 24px;
  margin: 0 0 20px 0;
  background: var(--zen-bg-white);
  border-bottom: 1px solid var(--zen-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.page-header .breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0 0 6px 0;
  font-size: 12px;
  color: var(--zen-text-light);
}
.page-header .breadcrumb-item + .breadcrumb-item::before {
  color: var(--zen-text-muted);
}
.page-header .breadcrumb-item a {
  color: var(--zen-text-light);
  text-decoration: none;
}
.page-header .breadcrumb-item a:hover {
  color: var(--zen-primary);
  text-decoration: underline;
}
.page-header .breadcrumb-item.active {
  color: var(--zen-text);
  font-weight: 500;
}
.page-header .page-title {
  color: var(--zen-text) !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  line-height: 1.2;
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-header .page-title i,
.page-header .page-title .fas,
.page-header .page-title .far,
.page-header .page-title .fa {
  color: var(--zen-primary);
  font-size: 20px;
  flex-shrink: 0;
}
.page-header .page-description,
.page-header p.text-muted {
  color: var(--zen-text-light);
  font-size: 13px;
  margin: 6px 0 0 0;
  line-height: 1.45;
}
/* Long-label handling for the sidebar. Keeps items on a single line, adds
 * an ellipsis when they overflow, and surfaces the full label via native
 * tooltip on hover (title attribute already present on most rows). */
.site-menu > .site-menu-item > a,
.site-menu-sub .site-menu-item > a {
  white-space: nowrap;
  overflow: hidden;
}
.site-menu > .site-menu-item > a .site-menu-title,
.site-menu-sub .site-menu-item > a .site-menu-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

/* ============================================================================
 * WCAG 2.4.7 — Focus Visible (2026-08-24, r1035).
 * Several components across the LMS set `outline: none` on :focus so their
 * custom box-shadow ring is the only indicator. That is fine for mouse
 * clicks but keyboard users (Tab navigation) lose the visible focus cue on
 * dark backgrounds and on button/link elements that don't have a
 * box-shadow ring at all — a WCAG AA fail.
 *
 * Fix: target :focus-visible (fires ONLY for keyboard/tab focus, not mouse
 * clicks) and force a Zen blue outline on every focusable element. Mouse
 * users see exactly what they saw before; keyboard users always see a
 * clear focus ring. `!important` beats any existing `outline: none`.
 * ========================================================================= */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
[contenteditable="true"]:focus-visible {
  outline: 2px solid #1C59A8 !important;
  outline-offset: 2px !important;
  border-radius: 2px;
}
