/* Easy2Siksha - Test Your Skills (Live Test Paper Arena) Mobile-First CSS */

:root {
  --primary: #19C8A1;
  --primary-dark: #0f9f7f;
  --primary-light: #67e8c9;
  --primary-glow: rgba(25, 200, 161, 0.35);
  --dark-bg: #071224;
  --dark-card: #0e1e38;
  --dark-surface: #142747;
  --light-bg: #f0f4f9;
  --light-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --warning: #f59e0b;
  --success: #10b981;
  --info: #3b82f6;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px var(--primary-glow);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--light-bg);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: 90px; /* Space for floating mobile bar */
}

/* Header Navbar */
.test-header {
  background: rgba(7, 18, 36, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.test-header-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.test-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
}

.test-brand-logo {
  background: linear-gradient(135deg, #19C8A1, #0f9f7f);
  color: var(--dark-bg);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  box-shadow: 0 0 15px var(--primary-glow);
}

.test-brand span small {
  display: block;
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.test-nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.test-nav-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.test-nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile Hero Banner */
.test-hero {
  background: linear-gradient(135deg, #071224 0%, #0d2142 50%, #071224 100%);
  color: #fff;
  padding: 40px 16px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.test-hero::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.test-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.test-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(25, 200, 161, 0.15);
  color: var(--primary);
  border: 1px solid var(--primary-glow);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  box-shadow: 0 0 15px rgba(25, 200, 161, 0.15);
}

.test-hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  font-weight: 900;
  margin-bottom: 10px;
  line-height: 1.25;
  letter-spacing: -0.5px;
}

.test-hero h1 span {
  background: linear-gradient(135deg, #19C8A1, #67e8c9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.test-hero p {
  color: #94a3b8;
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  max-width: 680px;
  margin: 0 auto 10px;
}

/* Selector Card - Touch Optimized */
.selector-card {
  background: var(--light-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  max-width: 1100px;
  margin: -35px auto 30px;
  position: relative;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid #e2e8f0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  background-color: #f8fafc;
  transition: all 0.2s ease;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2319C8A1' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-select:focus {
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.btn-generate {
  background: linear-gradient(135deg, #19C8A1, #0f9f7f);
  color: var(--dark-bg);
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25 ease;
  height: 48px;
  box-shadow: 0 6px 18px var(--primary-glow);
}

.btn-generate:active {
  transform: scale(0.97);
}

.btn-generate:hover {
  background: linear-gradient(135deg, #16b894, #0d8a6e);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-glow);
}

/* Container */
.test-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Gradient Cards & Badges */
.bg-teal-gradient {
  background: linear-gradient(135deg, #071224 0%, #0c2538 50%, #0d3832 100%) !important;
  border: 1px solid rgba(25, 200, 161, 0.3) !important;
}

.bg-teal { background-color: #19C8A1 !important; }
.text-teal { color: #19C8A1 !important; }
.bg-teal-subtle { background-color: #e6f9f5 !important; }

.bg-indigo { background-color: #4f46e5 !important; }
.text-indigo { color: #4f46e5 !important; }
.bg-indigo-subtle { background-color: #e0e7ff !important; }

.bg-amber { background-color: #f59e0b !important; }
.text-amber { color: #f59e0b !important; }
.bg-amber-subtle { background-color: #fef3c7 !important; }

.btn-teal-action {
  background: linear-gradient(135deg, #19C8A1, #0f9f7f);
  color: #071224;
  border: none;
  font-weight: 800;
  transition: all 0.2s ease;
}

.btn-teal-action:hover {
  background: #0f9f7f;
  color: #ffffff;
}

.cursor-pointer { cursor: pointer; }

/* Smartphone MCQ Cards - Touch Large Tap Targets */
.question-card {
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.question-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

.custom-option-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 14px 16px !important;
  margin-bottom: 10px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  min-height: 52px; /* Touch friendly tap height */
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.custom-option-card:active {
  transform: scale(0.98);
}

.custom-option-card:hover {
  border-color: #19C8A1;
  background-color: #f0fdf4;
}

.custom-option-card.selected-option {
  border-color: #19C8A1 !important;
  background-color: #e6f9f5 !important;
  box-shadow: 0 0 0 3px rgba(25, 200, 161, 0.25) !important;
}

.custom-option-card input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: #19C8A1;
  cursor: pointer;
  flex-shrink: 0;
}

.custom-option-card label {
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 0;
  flex-grow: 1;
}

/* Written Answer Phase 3 Textarea */
.written-answer-box {
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  font-size: 0.95rem;
  padding: 14px;
  line-height: 1.6;
  transition: all 0.2s ease;
  background-color: #f8fafc;
}

.written-answer-box:focus {
  background-color: #ffffff;
  border-color: #19C8A1;
  box-shadow: 0 0 0 4px rgba(25, 200, 161, 0.25);
  outline: none;
}

/* Keyword Chips for Phase 3 Written Answers */
.keyword-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.keyword-chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.keyword-chip:hover {
  background: #19C8A1;
  color: #071224;
  border-color: #19C8A1;
}

/* Floating Mobile Progress Bar */
.mobile-floating-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(7, 18, 36, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  padding: 12px 16px;
  z-index: 999;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.mobile-floating-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
}

.progress-text {
  font-size: 0.78rem;
  font-weight: 800;
  color: #cbd5e1;
  display: flex;
  justify-content: space-between;
}

.progress-text strong {
  color: #19C8A1;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #19C8A1, #67e8c9);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 10px;
}

.btn-mobile-submit {
  background: #19C8A1;
  color: #071224;
  font-weight: 900;
  font-size: 0.85rem;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(25, 200, 161, 0.4);
}

/* Options Grid Layout */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

/* Mobile Media Queries */
@media (max-width: 768px) {
  .test-nav-links {
    display: none; /* Hide top links on phone screen to avoid clutter */
  }
  .test-hero {
    padding: 30px 14px 50px;
  }
  .selector-card {
    padding: 16px;
    margin-top: -30px;
    border-radius: 16px;
  }
  .selector-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .options-grid {
    grid-template-columns: 1fr;
  }
  .question-card {
    border-radius: 14px;
  }
  .card-body {
    padding: 16px !important;
  }
}
