/**
 * EC IELTS Portal Design System
 * Centralized styles for consistent UI across all admin, partner, and provider portals
 * 
 * Usage: Include this file in templates that need consistent portal styling
 * Already includes Material Symbols font import
 */

/* ============================================
   MATERIAL SYMBOLS FONT
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0');


/* ============================================
   PAGE HEADER STYLES
   ============================================ */

/* Standard page header with icon and title */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.page-header-title {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.page-header-title h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.page-header-title h1 .material-symbols-outlined {
  font-size: 40px;
  color: var(--accent);
}

.page-header-title p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.page-header-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}


/* ============================================
   BUTTON STYLES
   ============================================ */

.portal-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.portal-btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

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

.portal-btn-ghost {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-subtle);
}

.portal-btn-ghost:hover {
  background: var(--surface);
  border-color: var(--border);
}

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

.portal-btn-danger:hover {
  filter: brightness(1.1);
}

.portal-btn-success {
  background: var(--success);
  color: white;
}

.portal-btn-success:hover {
  filter: brightness(1.1);
}


/* ============================================
   STAT CARD STYLES
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon .material-symbols-outlined {
  font-size: 22px;
  color: var(--accent);
}

.stat-icon.total { background: rgba(99, 102, 241, 0.15); }
.stat-icon.total .material-symbols-outlined { color: #6366f1; }
.stat-icon.completed { background: rgba(34, 197, 94, 0.15); }
.stat-icon.completed .material-symbols-outlined { color: #22c55e; }
.stat-icon.pending { background: rgba(59, 130, 246, 0.15); }
.stat-icon.pending .material-symbols-outlined { color: #3b82f6; }
.stat-icon.active { background: rgba(34, 197, 94, 0.15); }
.stat-icon.active .material-symbols-outlined { color: #22c55e; }
.stat-icon.draft { background: rgba(245, 158, 11, 0.15); }
.stat-icon.draft .material-symbols-outlined { color: #f59e0b; }
.stat-icon.warning { background: rgba(239, 68, 68, 0.15); }
.stat-icon.warning .material-symbols-outlined { color: #ef4444; }
.stat-icon.info { background: rgba(59, 130, 246, 0.15); }
.stat-icon.info .material-symbols-outlined { color: #3b82f6; }

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 2px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}


/* ============================================
   SECTION CARD STYLES
   ============================================ */

.section-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-bottom: var(--space-6);
  overflow: hidden;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}

.section-title .material-symbols-outlined {
  font-size: 24px;
  color: var(--accent);
}

.section-body {
  padding: var(--space-5);
}

.section-body.empty {
  padding: var(--space-8);
  text-align: center;
  color: var(--muted);
}


/* ============================================
   FILTERS SECTION STYLES
   ============================================ */

.filters-section {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-bottom: var(--space-6);
  overflow: hidden;
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
}

.filters-header:hover {
  background: var(--bg);
}

.filters-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}

.filters-title .material-symbols-outlined {
  font-size: 24px;
  color: var(--accent);
}

.filters-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.filters-section.collapsed .filters-toggle {
  transform: rotate(-90deg);
}

.filters-body {
  padding: var(--space-5);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  transition: all 0.3s ease;
}

.filters-section.collapsed .filters-body {
  display: none;
}

@media (max-width: 1200px) {
  .filters-body { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .filters-body { grid-template-columns: repeat(2, 1fr); }
}

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

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s ease;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-input::placeholder {
  color: var(--text-dim);
}

.filters-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg);
}


/* ============================================
   LIST SECTION STYLES
   ============================================ */

.list-section {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.list-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}

.list-title .material-symbols-outlined {
  font-size: 24px;
  color: var(--accent);
}

.list-body {
  padding: 0;
}

.quick-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}


/* ============================================
   BADGE STYLES
   ============================================ */

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

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

.badge-count.danger {
  background: var(--danger);
}

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


/* ============================================
   EMPTY STATE STYLES
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-8);
  text-align: center;
  color: var(--muted);
}

.empty-state .material-symbols-outlined {
  font-size: 48px;
  opacity: 0.5;
  color: var(--muted);
}

.empty-state-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-1);
}

.empty-state-subtext {
  font-size: 13px;
  color: var(--muted);
}


/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-title h1 {
    font-size: 1.5rem;
  }

  .page-header-title h1 .material-symbols-outlined {
    font-size: 32px;
  }

  .page-header-title p {
    font-size: 14px;
  }

  .page-header-actions {
    width: 100%;
  }

  .page-header-actions .portal-btn {
    flex: 1;
    justify-content: center;
  }

  .stat-card {
    padding: var(--space-4);
  }

  .stat-icon {
    width: 40px;
    height: 40px;
  }

  .stat-icon .material-symbols-outlined {
    font-size: 18px;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-label {
    font-size: 12px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-3) var(--space-4);
  }

  .section-body {
    padding: var(--space-4);
  }

  .filters-header {
    padding: var(--space-3) var(--space-4);
  }

  .filters-body {
    padding: var(--space-4);
  }

  .filters-footer {
    flex-direction: column;
    padding: var(--space-3) var(--space-4);
  }

  .filters-footer .portal-btn {
    width: 100%;
    justify-content: center;
  }

  .list-header {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-3) var(--space-4);
  }

  .quick-actions {
    width: 100%;
  }

  .quick-actions .portal-btn {
    flex: 1;
    justify-content: center;
  }
}
