/* ══════════════════════════════════════════════════════════════
   APTITUDE.CSS — CAT-Level & Placement Aptitude Test Module
   ══════════════════════════════════════════════════════════════ */

.apt-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #311b92 100%);
  color: #ffffff;
  padding: 80px 24px 60px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.apt-hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

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

.apt-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.4);
  color: #a5b4fc;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 14px;
  border-radius: 30px;
  margin-bottom: 18px;
}

.apt-hero-h1 {
  font-family: var(--fh);
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 30%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.apt-hero-sub {
  font-size: 1.05rem;
  color: #cbd5e1;
  max-width: 720px;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* Category Filter Tabs */
.apt-filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.apt-filter-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #e2e8f0;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.apt-filter-btn:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

.apt-filter-btn.active {
  background: #4f46e5;
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

/* Section Grid & Test Cards */
.apt-section-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.apt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.apt-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03), 0 2px 4px -1px rgba(0,0,0,0.02);
  position: relative;
  overflow: hidden;
}

.apt-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.apt-card:hover {
  transform: translateY(-4px);
  border-color: #cbd5e1;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);
}

.apt-card:hover::before {
  opacity: 1;
}

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

.apt-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #e0e7ff;
  color: #4338ca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.apt-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
}

.apt-card-title {
  font-family: var(--fh);
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.apt-card-desc {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.55;
  margin-bottom: 20px;
}

.apt-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 24px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.apt-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.apt-btn-start {
  width: 100%;
  padding: 12px 20px;
  border-radius: 12px;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.apt-btn-start:hover {
  background: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

/* Modal Workspace Interface */
.apt-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.apt-modal-overlay.active,
.apt-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.apt-workspace-card {
  background: #ffffff;
  width: 100%;
  max-width: 860px;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.apt-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.apt-ws-title {
  font-family: var(--fh);
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
}

.apt-ws-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fee2e2;
  color: #991b1b;
  font-family: var(--fm);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 20px;
}

.apt-ws-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.apt-ws-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.apt-workspace-body {
  padding: 32px 28px;
  overflow-y: auto;
  flex: 1;
}

.apt-q-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: #4f46e5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.apt-q-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.5;
  margin-bottom: 24px;
}

.apt-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.apt-opt-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.apt-opt-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.apt-opt-btn.selected {
  background: #e0e7ff;
  border-color: #6366f1;
  color: #3730a3;
}

.apt-opt-btn.correct {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  color: #15803d !important;
}

.apt-opt-btn.incorrect {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
}

.apt-opt-lbl {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.apt-workspace-footer {
  padding: 20px 28px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.apt-explanation-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 16px 20px;
  margin-top: 20px;
  color: #166534;
  font-size: 0.9rem;
  line-height: 1.5;
  display: none;
}

.apt-explanation-box.active {
  display: block;
}

@media (max-width: 640px) {
  .apt-hero { padding: 60px 16px 40px; }
  .apt-grid { grid-template-columns: 1fr; }
  .apt-workspace-card { max-height: 95vh; border-radius: 16px; }
}
