/* ---------- STUDY PAGE STYLES ---------- */

.study-page-main {
  max-width: 1280px;
  margin: 80px auto 0; /* Clear header */
  padding: 24px 16px;
  width: 100%;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 120px);
}

/* ---------- HOME VIEW ---------- */
.home-view {
  width: 100%;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.home-view.view-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  position: absolute;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--gx-font-display), sans-serif !important;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--gx-heading, #111936);
  white-space: nowrap;
}

/* Search Wrapper */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.search-input {
  width: 100%;
  padding: 14px 20px;
  background: var(--gx-surface, rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(93, 115, 124, 0.26);
  border-radius: 14px;
  color: var(--gx-text, #1e293b);
  font-size: 0.95rem;
  font-family: var(--gx-font-body), sans-serif;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.search-input::placeholder {
  color: #94a3b8;
}

.search-input:focus {
  border-color: var(--gx-primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  box-shadow: var(--gx-shadow, 0 14px 30px rgba(0, 0, 0, 0.1));
  z-index: 50;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s ease;
  pointer-events: none;
}

.search-suggestions.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.suggestion-item {
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  transition: background 0.15s;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: rgba(37, 99, 235, 0.05);
}

.suggestion-icon {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
}

.suggestion-name {
  font-weight: 600;
}

.no-results {
  padding: 14px 20px;
  color: #94a3b8;
  font-size: 0.85rem;
  text-align: center;
}

.section-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--gx-moss, #475569);
  margin-bottom: 12px;
  font-weight: 700;
}

/* Course Grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
}

.course-card {
  text-align: left;
  font: inherit;
  background: var(--gx-surface, rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(226, 230, 255, 0.8);
  border-radius: 20px;
  padding: 28px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 220px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02);
}

.empty-inline {
  grid-column: 1 / -1;
  margin: 0;
  padding: 22px;
  border: 1px dashed #dbe3f4;
  border-radius: 12px;
  color: #64748b;
  text-align: center;
}

.course-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-5px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.08);
}

.card-icon {
  font-size: 2.2rem;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.07);
  border-radius: 16px;
  color: var(--gx-primary, #2563eb);
}

.card-title {
  font-family: var(--gx-font-display), sans-serif !important;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--gx-heading, #111936);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--gx-moss, #475569);
  flex-grow: 1;
  line-height: 1.5;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  color: #64748b;
  border-top: 1px solid rgba(226, 230, 255, 0.8);
  padding-top: 16px;
  font-weight: 500;
}

.card-meta i {
  color: var(--gx-primary, #2563eb);
}

.course-mock-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 0.78rem;
  font-weight: 800;
}

/* ---------- DETAIL VIEW ---------- */
.detail-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f8fafc;
  z-index: 100;
  overflow-y: auto;
  transform: translateX(105%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 90px 24px 60px; /* Header spacing */
}

.detail-view.view-active {
  transform: translateX(0);
}

.detail-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.detail-top {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
  position: sticky;
  top: 0;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(8px);
  padding: 12px 0 20px;
  z-index: 10;
  border-bottom: 1px solid #e2e8f0;
}

.btn-back {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e293b;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btn-back:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.detail-course-title {
  font-family: var(--gx-font-display), sans-serif !important;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gx-heading, #111936);
}

/* Sub-course Section */
.subcourse-section {
  background: #ffffff;
  border: 1px solid rgba(226, 230, 255, 0.84);
  border-radius: 18px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
  animation: fadeSlide 0.4s ease both;
}

.subcourse-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-family: var(--gx-font-display), sans-serif !important;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gx-heading, #111936);
}

.subcourse-header span {
  font-size: 1.6rem;
}

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

/* Mock test CTA */
.mock-cta {
  border-top: 1px solid #f1f5f9;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.mock-cta p {
  font-size: 0.95rem;
  color: var(--gx-moss, #475569);
  font-weight: 600;
  margin: 0;
}

.btn-mock {
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid var(--gx-primary, #2563eb);
  color: var(--gx-primary, #2563eb);
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-mock:hover {
  background: var(--gx-primary, #2563eb);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
}

/* 3D PDF Cards */
.pdf-card {
  width: 100%;
  min-height: 220px;
  background: #ffffff;
  border: 1px solid #dce3f4;
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: default;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.pdf-card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.1);
}

.pdf-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #2563eb, #8b5cf6);
}

.pdf-card.accent-2::after {
  background: linear-gradient(90deg, #f59e0b, #c4b5fd);
}

.pdf-card.accent-3::after {
  background: linear-gradient(90deg, #0f766e, #60a5fa);
}

.pdf-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pdf-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  color: #dc2626;
  background: #fee2e2;
  font-size: 0.76rem;
  font-weight: 850;
}

.pdf-card h3 {
  min-height: 42px;
  margin: 4px 0 0;
  color: #19223d;
  font-family: var(--gx-font-display), sans-serif !important;
  font-size: 1rem;
  line-height: 1.28;
}

.pdf-card p {
  margin: 0;
  color: #53617f;
  font-size: 0.88rem;
  line-height: 1.58;
}

.lang-tag {
  font-size: 0.72rem;
  padding: 4px 12px;
  border-radius: 30px;
  font-weight: 600;
}

.lang-tag.both {
  background: #e0f2fe;
  color: #0369a1;
}

.lang-tag.english-only {
  background: #f1f5f9;
  color: #475569;
}

.lang-tag.coming-soon {
  background: #fee2e2;
  color: #991b1b;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.btn-sm {
  flex: 1;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
  cursor: pointer;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  transition: all 0.2s;
  text-align: center;
}

.btn-sm.btn-view:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-sm.btn-download {
  background: #7b5cff;
  border-color: #7b5cff;
  color: #ffffff;
}

.btn-sm.btn-download:hover {
  background: #6a4df7;
  border-color: #6a4df7;
}

/* Language modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

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

.modal-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 32px 28px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.15);
}

.modal-box h3 {
  font-family: var(--gx-font-display), sans-serif !important;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gx-heading, #111936);
}

.lang-options {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
}

.btn-lang {
  padding: 14px 28px;
  border-radius: 40px;
  font-weight: 700;
  border: 1px solid;
  cursor: pointer;
  transition: 0.2s;
  font-size: 0.95rem;
}

.btn-lang.hindi {
  background: #fff7ed;
  border-color: #f97316;
  color: #c2410c;
}

.btn-lang.english {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.btn-lang:hover {
  filter: brightness(0.95);
  transform: translateY(-2px);
}

.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #334155;
  padding: 14px 28px;
  border-radius: 40px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 900px) {
  .study-page-main {
    margin-top: 70px;
  }
}

@media (max-width: 640px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .brand {
    font-size: 1.8rem;
  }
  .search-wrapper {
    max-width: 100%;
  }
  .course-grid {
    grid-template-columns: 1fr;
  }
  .pdf-grid {
    grid-template-columns: 1fr;
  }
  .mock-cta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .btn-mock {
    width: 100%;
    justify-content: center;
  }
  .detail-view {
    padding-top: 80px;
  }
}

/* Detail Search Styles */
.detail-search-wrapper {
  margin: 0 0 24px;
  width: 100%;
}

.detail-search-wrapper .search-box {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 480px;
  width: 100%;
}

.detail-search-wrapper .search-icon-inline {
  position: absolute;
  left: 18px;
  color: #94a3b8;
  font-size: 1rem;
  pointer-events: none;
}

.detail-search-wrapper .search-input {
  padding-left: 48px;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.02);
}

.highlight-section {
  border-color: rgba(37, 99, 235, 0.6) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15) !important;
  transform: translateY(-2px);
  transition: all 0.3s ease;
}
