/* Ahaana's GCSE Master Study Portal — Apple-Inspired Studio Design */
:root {
  --bg: #090d16;
  --bg-gradient: radial-gradient(circle at 50% 0%, #172136 0%, #090d16 80%);
  --panel: rgba(22, 30, 46, 0.7);
  --panel-hover: rgba(30, 41, 64, 0.85);
  --border: rgba(255, 255, 255, 0.09);
  --border-active: rgba(255, 255, 255, 0.22);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;
  
  --col-sci: #10b981;
  --col-fr: #3b82f6;
  --col-latv: #e11d48;
  --col-latg: #8b5cf6;
  --col-mus: #ec4899;
  --col-math: #f59e0b;
  
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 20px 35px -5px rgba(0, 0, 0, 0.6), 0 12px 16px -8px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 24px);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px;
  width: 100%;
}

/* Header */
.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.badge-streak {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-sync {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-parent-pill {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-parent-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* Hero Summary */
.hero-banner {
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px 28px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.hero-left h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.hero-left p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hero-stats {
  display: flex;
  gap: 24px;
}

.stat-box {
  text-align: right;
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.stat-lbl {
  font-size: 0.76rem;
  color: var(--text-sub);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Subject Grid */
.section-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 22px;
  margin-bottom: 40px;
}

.subject-card {
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.subject-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-color, #3b82f6);
}

.subject-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
  box-shadow: var(--shadow-hover);
  background: var(--panel-hover);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.card-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
  color: #fff;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.4;
}

.card-details {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.card-details-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-details-num {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.card-details-lbl {
  font-size: 0.72rem;
  color: var(--text-sub);
  text-transform: uppercase;
  font-weight: 600;
}

.card-btn {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: var(--card-color, #3b82f6);
  transition: opacity 0.2s ease;
}

.subject-card:hover .card-btn {
  opacity: 0.92;
}

/* Colors */
.card-sciences { --card-color: var(--col-sci); }
.card-french { --card-color: var(--col-fr); }
.card-latin-vocab { --card-color: var(--col-latv); }
.card-latin-grammar { --card-color: var(--col-latg); }
.card-music { --card-color: var(--col-mus); }
.card-maths { --card-color: var(--col-math); }

/* Footer */
.portal-footer {
  margin-top: auto;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-sub);
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover {
  color: #fff;
}

/* Responsive */
@media (max-width: 640px) {
  .hero-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .stat-box {
    text-align: left;
  }
  .subject-grid {
    grid-template-columns: 1fr;
  }
}
