/* Design System Tokens */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Light Theme Variables */
  --primary-h: 160;
  --primary-s: 85%;
  --primary-l: 36%;
  --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-hover: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 5%));
  --primary-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.15);
  
  --secondary: hsl(220, 60%, 45%);
  --secondary-hover: hsl(220, 60%, 38%);
  
  --bg-app: hsl(220, 30%, 96%);
  --bg-surface: hsl(0, 0%, 100%);
  --border-color: hsl(220, 20%, 88%);
  --text-main: hsl(220, 40%, 12%);
  --text-muted: hsl(220, 15%, 45%);
  --text-inverse: hsl(0, 0%, 100%);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 12px 30px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.15);

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: 12px;
}

[data-theme="dark"] {
  /* Dark Theme Variables */
  --primary-l: 45%;
  --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-hover: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) + 6%));
  --primary-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.25);
  
  --secondary: hsl(220, 70%, 60%);
  --secondary-hover: hsl(220, 70%, 68%);
  
  --bg-app: hsl(220, 30%, 6%);
  --bg-surface: hsl(220, 25%, 11%);
  --border-color: hsl(220, 20%, 18%);
  --text-main: hsl(220, 20%, 92%);
  --text-muted: hsl(220, 10%, 65%);
  --text-inverse: hsl(220, 30%, 6%);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 12px 30px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.25);

  --glass-bg: rgba(24, 28, 41, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
}

/* Global resets & styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-hover);
}

/* Layout container */
.app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: 2.5rem 1.5rem;
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  border-radius: 1.25rem;
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
  border-color: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.25);
}

/* Custom Nav Header */
.custom-header {
  background: var(--primary-glow);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-img {
  height: 48px;
  width: auto;
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Theme Switcher Toggle */
.theme-switch-btn {
  background: var(--border-color);
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  font-size: 1.25rem;
  transition: background-color 0.2s, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-switch-btn:hover {
  transform: scale(1.08);
  background: var(--primary-glow);
  color: var(--primary);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 6%)));
  color: var(--text-inverse);
  border: none;
  font-weight: 600;
  padding: 0.8rem 1.75rem;
  border-radius: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-glow);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.3);
  opacity: 0.95;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--border-color);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-weight: 600;
  padding: 0.8rem 1.75rem;
  border-radius: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
}

.btn-secondary:hover {
  background: var(--bg-app);
  border-color: var(--text-muted);
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  color: var(--text-main);
  transition: all 0.25s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  background-color: var(--bg-surface);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.25rem center;
  background-size: 1.2rem;
  padding-right: 2.75rem;
}

/* Wizard step tracking bar */
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 3.5rem;
}

.wizard-steps::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border-color);
  z-index: 1;
  transform: translateY(-50%);
}

.wizard-step {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 3px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  position: relative;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wizard-step.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-glow);
}

.wizard-step.completed {
  border-color: var(--primary);
  background: var(--bg-surface);
  color: var(--primary);
}

/* Dashboard Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--primary-glow);
  color: var(--primary);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Subject Grid list selector */
.subjects-container {
  margin: 1.5rem 0;
}

.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.subject-item {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s, background-color 0.2s;
}

.subject-item:hover {
  border-color: var(--primary);
}

.subject-item.selected {
  background: var(--primary-glow);
  border-color: var(--primary);
}

.subject-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 4px;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.subject-item.selected .subject-checkbox {
  background: var(--primary);
  border-color: var(--primary);
}

.subject-checkbox::after {
  content: '✓';
  color: var(--text-inverse);
  font-size: 0.8rem;
  font-weight: bold;
  opacity: 0;
}

.subject-item.selected .subject-checkbox::after {
  opacity: 1;
}

.subject-label {
  font-size: 0.95rem;
  font-weight: 600;
}

/* Alert styles */
.custom-alert {
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  border-left: 5px solid transparent;
  font-weight: 500;
}

.custom-alert-error {
  background: hsla(0, 80%, 40%, 0.1);
  border-color: hsl(0, 80%, 40%);
  color: hsl(0, 85%, 45%);
}

.custom-alert-success {
  background: hsla(160, 80%, 35%, 0.1);
  border-color: hsl(160, 80%, 35%);
  color: hsl(160, 80%, 30%);
}

/* Micro-animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* Premium Site Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 100%;
}

.site-footer a {
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--primary) !important;
}

/* Full-Screen Website Sections */
.main-content {
  flex: 1;
  padding: 0; /* Remove default padding since homepage controls spacing */
}

/* Base style for subpages to add padding back inside container */
.subpage-container {
  padding: 3rem 1.5rem;
}

.section-full {
  padding: 5.5rem 0;
  position: relative;
  width: 100%;
}

.section-alt {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-dark-green {
  background: linear-gradient(135deg, #064e3b 0%, #022c22 100%);
  color: #ffffff !important;
}

/* Impact stats strip */
.stats-strip {
  padding: 3.5rem 0;
  background: linear-gradient(135deg, #047857 0%, #064e3b 100%);
  color: #ffffff;
  border-top: 4px solid #10b981;
}

.stat-strip-card {
  text-align: center;
}

.stat-strip-val {
  font-size: 3rem;
  font-weight: 800;
  color: #10b981;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.stat-strip-lbl {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.5rem;
}

/* Website features cards */
.feature-web-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: 100%;
}

.feature-web-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg), 0 10px 20px rgba(16, 185, 129, 0.05);
  border-color: var(--primary);
}

.feature-web-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

/* Academic Trades Section */
.trade-tab-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s ease;
}

.trade-tab-card:hover {
  border-color: var(--primary);
}

.trade-icon-pill {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Testimonial slider cards */
.testimonial-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 1.25rem;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  max-width: 600px;
  margin: 0 auto;
}

.testimonial-avatar {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: var(--primary-glow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
}

/* Theme Toggle Transitions */
body, .glass-card, .custom-header, .form-control, .theme-switch-btn, .stat-card, .site-footer, .feature-web-card, .trade-tab-card {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* ── Button Loading State ───────────────────────────────────────────────── */
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.btn-loading {
  pointer-events: none !important;
  opacity: 0.78 !important;
  position: relative;
}

.btn-loading .btn-text { visibility: hidden; }

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1em;
  height: 1em;
  margin: -0.5em 0 0 -0.5em;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-right-color: currentColor;
  border-radius: 50%;
  animation: btn-spin 0.65s linear infinite;
}

/* Top progress bar that slides across the page on navigation */
#nav-progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #34d399);
  z-index: 99999;
  transition: width 0.25s ease;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  pointer-events: none;
}

/* ── DataTables Overrides ───────────────────────────────────────────────── */
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  color: var(--text-main);
  background: var(--bg-surface);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  margin-left: 0.4rem;
}

.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  color: var(--text-main);
  background: var(--bg-surface);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  margin: 0 0.3rem;
}

.dataTables_wrapper .dataTables_info {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 0.6rem;
}

.dataTables_wrapper .dataTables_paginate {
  padding-top: 0.4rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 6px !important;
  padding: 0.25rem 0.6rem !important;
  font-size: 0.83rem !important;
  border: 1px solid transparent !important;
  color: var(--text-muted) !important;
  cursor: pointer;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current) {
  background: var(--primary-glow) !important;
  border-color: var(--border-color) !important;
  color: var(--primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  color: var(--text-muted) !important;
  cursor: default;
}

table.dataTable thead th {
  border-bottom: 1px solid var(--border-color) !important;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

table.dataTable tbody td {
  border-top: 1px solid var(--border-color) !important;
  vertical-align: middle;
}

table.dataTable.no-footer {
  border-bottom: 1px solid var(--border-color) !important;
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length {
  margin-bottom: 0.75rem;
}

/* Modal Popups Redesign Override (White, Curved, Premium Shadows) */
.modal-content, .modal-card {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.16) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    color: #334155 !important;
}

.modal-content h1, .modal-content h2, .modal-content h3, .modal-content h4, .modal-content h5, .modal-content h6,
.modal-card h1, .modal-card h2, .modal-card h3, .modal-card h4, .modal-card h5, .modal-card h6 {
    color: #0f172a !important;
    font-weight: 700 !important;
}

.modal-content p, .modal-content label, .modal-content span:not(.badge),
.modal-card p, .modal-card label, .modal-card span:not(.badge) {
    color: #475569 !important;
}

.modal-content input:not([type="checkbox"]):not([type="radio"]), .modal-content select, .modal-content textarea,
.modal-card input:not([type="checkbox"]):not([type="radio"]), .modal-card select, .modal-card textarea {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

.modal-content input:not([type="checkbox"]):not([type="radio"]):focus, .modal-content select:focus,
.modal-card input:not([type="checkbox"]):not([type="radio"]):focus, .modal-card select:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.modal-content input:not([type="checkbox"]):not([type="radio"])::placeholder,
.modal-card input:not([type="checkbox"]):not([type="radio"])::placeholder {
    color: #94a3b8 !important;
}

/* ── Flashy PIN Purchase Button Styles ─────────────────────────────────── */
.btn-flashy-purchase {
    background: linear-gradient(135deg, #eab308 0%, #ea580c 100%) !important;
    color: #ffffff !important;
    padding: 0.85rem 1.85rem;
    font-weight: 800;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    animation: button-pulse-glow 2s infinite;
}

.btn-flashy-purchase:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(234, 88, 12, 0.6);
    color: #ffffff !important;
}

.btn-flashy-purchase::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    animation: shimmers 3s infinite;
}

@keyframes shimmers {
    0% { left: -150%; }
    50% { left: 150%; }
    100% { left: 150%; }
}

@keyframes button-pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(234, 88, 12, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0);
    }
}