/**
 * Everest School Theme - Education Friendly Style
 * Import: design-tokens.css, base.css, components.css before this file
 */

/* Google Fonts - Modern Professional pairing for education */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Open+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Everest Brand Colors */
  --everest-primary: #1565C0;          /* Strong Education Blue */
  --everest-primary-dark: #0d47a1;     /* Darker Blue for hover */
  --everest-primary-light: #E3F2FD;    /* Light Blue for backgrounds */
  --everest-accent: #F57C00;           /* Energetic Orange */

  /* Theme-specific overrides */
  --primary-color: var(--everest-primary);
  --primary-dark: var(--everest-primary-dark);
  --primary-light: var(--everest-primary-light);
  --accent-color: var(--everest-accent);

  /* Backgrounds */
  --bg-color: #F5F7FA;
  --card-bg: var(--white);

  /* Text - Improved contrast */
  --text-color: #0F172A;              /* Better contrast for readability */
  --text-sub: #475569;                /* Improved from #546E7A */
  --heading-color: #0F172A;

  /* Borders */
  --border-color: #E2E8F0;            /* Better visibility */

  /* Semantic */
  --link-color: var(--everest-primary);
  --link-hover-color: var(--everest-primary-dark);

  /* Typography */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================
   THEME APPLICATION
   ============================================ */

body.everest-theme {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
}

/* Apply heading font */
body.everest-theme h1,
body.everest-theme h2,
body.everest-theme h3,
body.everest-theme h4,
body.everest-theme h5,
body.everest-theme h6,
body.everest-theme .everest-title,
body.everest-theme .school-name {
  font-family: var(--font-heading);
}

/* ============================================
   HEADER - Modern, Friendly
   ============================================ */

.everest-header {
  background-color: var(--everest-primary);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: 0 4px 12px rgba(21, 101, 192, 0.2);
}

.everest-header .title-container {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.everest-header .logo-placeholder {
  width: 32px;
  height: 32px;
  background-color: var(--white);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--everest-primary);
}

.everest-header .logo-placeholder svg {
  width: 20px;
  height: 20px;
}

.everest-header .title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--white);
}

.everest-header .back-btn {
  color: var(--white);
  cursor: pointer;
  width: 36px;
  height: 36px;
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  margin-right: var(--space-sm);
  transition: background-color var(--transition-fast);
}

.everest-header .back-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.everest-header .back-btn svg {
  width: 24px;
  height: 24px;
}

/* ============================================
   BRAND HEADER (Home Screen)
   ============================================ */

.everest-brand-header {
  background-color: var(--white);
  padding: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-lg);
}

.everest-brand-header .brand-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.everest-brand-header .brand-logo {
  width: 48px;
  height: 48px;
  background-color: var(--everest-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  box-shadow: 0 4px 8px rgba(21, 101, 192, 0.3);
}

.everest-brand-header .brand-logo svg {
  width: 24px;
  height: 24px;
}

.everest-brand-header .brand-info {
  display: flex;
  flex-direction: column;
}

.everest-brand-header .school-name {
  font-size: var(--text-xl);
  font-weight: var(--font-extrabold);
  color: var(--everest-primary);
  line-height: var(--leading-tight);
}

.everest-brand-header .school-slogan {
  font-size: var(--text-sm);
  color: var(--text-sub);
  font-weight: var(--font-medium);
}

/* ============================================
   CONTENT AREA
   ============================================ */

.everest-content {
  padding: var(--space-lg);
  overflow-y: auto;
  flex-grow: 1;
}

.everest-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  color: var(--text-color);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.everest-subtitle {
  font-size: var(--text-base);
  color: var(--text-sub);
  text-align: center;
  margin-bottom: var(--space-xl);
  line-height: var(--leading-relaxed);
}

/* ============================================
   VNeID BUTTON - Special CTA
   ============================================ */

.everest-btn-vneid {
  background: linear-gradient(135deg, #b71c1c 0%, #8e0000 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  gap: var(--space-md);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(183, 28, 28, 0.2);
  transition: transform 200ms ease, box-shadow 200ms ease;
  min-height: var(--touch-target-min);
  position: relative;
}

.everest-btn-vneid:hover:not(.loading) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(183, 28, 28, 0.3);
}

.everest-btn-vneid:active:not(.loading) {
  transform: translateY(0);
}

/* Loading state */
.everest-btn-vneid.loading {
  pointer-events: none;
}

.everest-btn-vneid.loading svg:not(.spinner) {
  opacity: 0;
}

.everest-btn-vneid.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: white;
  border-right-color: white;
  border-radius: 50%;
  animation: spinButton 0.6s linear infinite;
}

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

.everest-btn-vneid svg {
  width: 24px;
  height: 24px;
}

/* ============================================
   DIVIDER
   ============================================ */

.everest-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: var(--space-lg) 0;
  color: var(--text-sub);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

.everest-divider::before,
.everest-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.everest-divider span {
  padding: 0 var(--space-md);
}

/* ============================================
   FORMS
   ============================================ */

.everest-form-group {
  margin-bottom: var(--space-lg);
}

.everest-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-sm);
  color: var(--text-sub);
}

.everest-input {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  background-color: var(--card-bg);
  box-sizing: border-box;
  min-height: var(--touch-target-min);
  transition: all var(--transition-base);
}

.everest-input:focus {
  outline: none;
  border-color: var(--everest-primary);
  box-shadow: 0 0 0 3px var(--everest-primary-light);
}

.everest-input::placeholder {
  color: var(--gray-400);
}

/* Verified Input State */
.everest-input-verified {
  background-color: var(--success-50);
  border-color: var(--success-600);
  color: var(--success-700);
  padding-right: 48px;
}

.everest-verified-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--success-600);
  animation: checkmark 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   BUTTONS
   ============================================ */

.everest-btn-primary {
  background-color: var(--everest-primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  width: 100%;
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: background-color 200ms ease, box-shadow 200ms ease;
  min-height: var(--touch-target-min);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.everest-btn-primary:hover:not(:disabled):not(.loading) {
  background-color: var(--everest-primary-dark);
  box-shadow: var(--shadow-md);
}

/* Loading state */
.everest-btn-primary.loading {
  color: transparent;
  pointer-events: none;
}

.everest-btn-primary.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: white;
  border-right-color: white;
  border-radius: 50%;
  animation: spinButton 0.6s linear infinite;
}

.everest-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   FILE UPLOAD
   ============================================ */

.everest-file-upload {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  text-align: center;
  cursor: pointer;
  background-color: var(--bg-color);
  transition: all var(--transition-base);
}

.everest-file-upload:hover {
  border-color: var(--everest-primary);
  background-color: var(--everest-primary-light);
}

.everest-file-upload .upload-icon {
  font-size: 24px;
  color: var(--text-sub);
  margin-bottom: var(--space-sm);
}

.everest-file-upload .upload-text {
  font-size: var(--text-sm);
  color: var(--text-color);
  font-weight: var(--font-medium);
}

.everest-file-upload .upload-sub {
  font-size: var(--text-xs);
  color: var(--text-sub);
}

/* ============================================
   SUCCESS BANNER
   ============================================ */

.success-banner {
  background-color: var(--success-50);
  border: 1px solid var(--success-200, var(--success-100));
  color: var(--success-700);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: var(--text-sm);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  animation: slideDown 0.5s ease;
}

.success-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ============================================
   SUCCESS SCREEN
   ============================================ */

.success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl);
  min-height: 500px;
}

.success-screen .confetti-svg {
  width: 120px;
  height: 120px;
  margin-bottom: var(--space-lg);
  color: var(--everest-primary);
  animation: bounce 1s ease infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

.success-screen .success-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  color: var(--everest-primary);
  margin-bottom: var(--space-md);
}

.success-screen .success-message {
  font-size: var(--text-base);
  color: var(--text-sub);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-xl);
}

.success-screen .ref-box {
  background-color: var(--bg-color);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  width: 100%;
  margin-bottom: var(--space-2xl);
}

.success-screen .ref-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  color: var(--text-sub);
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-sm);
  display: block;
}

.success-screen .ref-code {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-color);
  letter-spacing: var(--tracking-wide);
}

/* ============================================
   MOBILE SCREEN CONTAINER
   ============================================ */

.mobile-screen.everest {
  width: var(--mobile-width);
  height: var(--mobile-height);
  background-color: var(--bg-color);
  border-radius: 40px;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

.everest-theme .skip-link {
  background-color: var(--everest-primary);
  color: var(--white);
}

.everest-theme *:focus-visible {
  outline-color: var(--everest-primary);
}

/* ============================================
   REDUCED MOTION SUPPORT
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
