/* ==========================================================================
   Portal Dashboard, Chapter Grid, & Search Styling
   ========================================================================== */

.portal-container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  width: 100%;
}

/* Hero Section */
.portal-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: center;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(99, 102, 241, 0.08));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.portal-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  background-color: var(--accent-cyan-subtle);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.75rem;
  max-width: 600px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(6, 182, 212, 0.45);
}

.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-hero-secondary:hover {
  background-color: var(--bg-surface);
  border-color: var(--accent-cyan);
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.stat-card {
  background-color: var(--bg-surface-translucent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
}

.stat-val {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.stat-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Catalog Control Bar (Tabs & Search) */
.catalog-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.subject-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--bg-surface);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  max-width: 100%;
}

.filter-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.tab-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-base);
  color: var(--text-muted);
}

.search-box-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
  min-width: 260px;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.catalog-search-input {
  width: 100%;
  padding: 0.65rem 2.5rem 0.65rem 2.6rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.catalog-search-input:focus {
  border-color: var(--accent-cyan);
}

.btn-clear-search {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--text-muted);
  line-height: 1;
}

/* Chapters Grid */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.chapter-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.chapter-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-bright);
  box-shadow: var(--shadow-md);
}

/* Subject Theme accents */
.card-physics {
  border-top: 3px solid var(--accent-cyan);
}
.card-chemistry {
  border-top: 3px solid var(--accent-emerald);
}
.card-mathematics {
  border-top: 3px solid var(--accent-purple);
}
.card-full-tests {
  border-top: 3px solid #f59e0b;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.04) 0%, var(--bg-surface) 35%);
}

.card-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.subject-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.tag-physics {
  background-color: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

.tag-chemistry {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.tag-mathematics {
  background-color: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
}

.tag-full-tests {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.chapter-num-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--bg-surface-elevated);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.score-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}
.badge-high { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-mid { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge-low { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.chapter-card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.chapter-syllabus-snippet {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.card-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px dashed var(--border-subtle);
  border-bottom: 1px dashed var(--border-subtle);
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-metric {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-link-syllabus {
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.card-bottom {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 0.65rem;
}

.btn-start-exam {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.3);
  transition: all var(--transition-fast);
}

.btn-start-exam:hover {
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.45);
  transform: translateY(-1px);
}

.btn-start-practice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-start-practice:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 580px;
  padding: 2rem;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.syllabus-card {
  max-width: 650px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.subject-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
}

.btn-modal-close {
  font-size: 1.5rem;
  color: var(--text-muted);
  line-height: 1;
}

.syllabus-heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.syllabus-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.syllabus-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.syllabus-meta-pills .pill {
  font-size: 0.78rem;
  background-color: var(--bg-surface-elevated);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
}

.btn-modal-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-md);
}

/* Mock Loader Modal */
.mock-loader-card {
  text-align: center;
  max-width: 440px;
  padding: 3rem 2rem;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.loader-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  gap: 0.75rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .portal-hero {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
    gap: 2rem;
  }
  .hero-title {
    font-size: 2.1rem;
  }
}

@media (max-width: 640px) {
  .portal-container {
    padding: 1.25rem 1rem 3rem;
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }
  .chapters-grid {
    grid-template-columns: 1fr;
  }
  .card-bottom {
    grid-template-columns: 1fr;
  }
  .catalog-control-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box-wrap {
    max-width: 100%;
  }
}

/* ==========================================================================
   Test of the Day, Load More, & Social Share Additions
   ========================================================================== */

/* Daily Test Callout in Dashboard */
.daily-callout-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(239, 68, 68, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.6rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.callout-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.callout-star {
  font-size: 1.6rem;
}

.callout-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.btn-callout-launch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
  white-space: nowrap;
}

.btn-hero-daily {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #000;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
  transition: transform var(--transition-fast);
}

.btn-hero-daily:hover {
  transform: translateY(-2px);
}

/* Card Share Button */
.btn-card-share {
  margin-left: auto;
  color: var(--text-muted);
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.btn-card-share:hover {
  color: var(--accent-cyan);
}

/* Load More Button Container */
.load-more-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2.5rem;
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.btn-load-more:hover {
  background-color: var(--bg-surface);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-2px);
}

.load-more-indicator {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Test of the Day Dedicated Page */
.daily-test-hero {
  text-align: center;
  max-width: 780px;
  margin: 1rem auto 2.5rem;
}

.daily-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-amber);
  background-color: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

.daily-heading {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.daily-subtext {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.daily-featured-card {
  max-width: 820px;
  margin: 0 auto 2.5rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.card-full-mock {
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.15);
}

.daily-card-badge-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.badge-daily-tag {
  background-color: rgba(245, 158, 11, 0.18);
  color: var(--accent-amber);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.badge-exam-type {
  background-color: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.badge-full-paper {
  background-color: rgba(139, 92, 246, 0.18);
  color: var(--accent-purple);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.daily-card-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.daily-card-syllabus {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.75rem;
}

.daily-card-meta-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-top: 1px dashed var(--border-subtle);
  border-bottom: 1px dashed var(--border-subtle);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.meta-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.daily-card-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-daily-exam {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.btn-daily-practice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-medium);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
}

.btn-daily-practice:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.btn-daily-share {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
}

.btn-daily-share:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.daily-admin-hint-box {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}

.hint-icon {
  color: var(--accent-cyan);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.hint-text h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.hint-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.hint-text code {
  background-color: var(--bg-surface-elevated);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

/* Toast Notification for Social Share */
.share-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #0f172a;
  color: #f8fafc;
  border: 1px solid var(--accent-cyan);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.share-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

