@import url("https://fonts.googleapis.com/css2?family=Alexandria:wght@300;400;500;600;700&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --text-primary-color: #4f46e5;
  --text-secondary-color: #00a693;
  --bg-primary-color: #e0defe;
}

body {
  font-family: "Alexandria";
  margin: 0;
  padding: 0;
  background-color: #ffffff;
}

/* Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
}

.header-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-section svg {
  width: 28px;
  height: 28px;
}

.header-section svg:hover {
  background-color: #ededed;
  border-radius: 5px;
}

.header-greeting h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.header-greeting h2 .highlight {
  color: var(--text-primary-color);
}

.header-greeting p {
  font-size: 0.78rem;
  margin-top: 2px;
  margin-bottom: 0;
}

.header-icons {
  display: flex;
  gap: 10px;
}

.icon-btn {
  background: transparent;
  border: 1px solid #ccc;
  width: 38px;
  height: 38px;
  color: #000000d1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: #ccc;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Countdown Section */
.countdown-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background-color: #e9e8e8;
}

.countdown-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.countdown-left svg {
  width: 26px;
  height: 26px;
  color: var(--text-primary-color);
  border: 1px solid var(--text-primary-color);
  border-radius: 50%;
  padding: 5px;
}

.countdown-left svg:hover {
  background-color: var(--text-primary-color);
  color: #fff;
}

.countdown-left .label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.countdown-left .date {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.countdown-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.time-block {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.time-block .num {
  font-size: 1.15rem;
  font-weight: 700;
  min-width: 28px;
  text-align: right;
}

.time-block.accent .num,
.time-block.accent .unit {
  color: var(--text-primary-color);
}

.time-block .unit {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.close-btn {
  background: none;
  border: none;
  color: #00000093;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  transition: color 0.2s;
}

.close-btn:hover {
  color: #000;
}

.close-btn svg {
  width: 18px;
  height: 18px;
}

/* Hero Section */
.hero-banner {
  position: relative;
  height: 240px;
  margin: 20px 20px 0;
  border-radius: 16px;
  overflow: hidden;
}

.hero-physics {
  background:
    linear-gradient(135deg, rgba(0, 30, 60, 0.85) 0%, rgba(0, 80, 100, 0.6) 100%),
    url('https://images.unsplash.com/photo-1635070041078-e363dbe005cb?w=1200&q=80') center/cover no-repeat;
}

.hero-chemistry {
  background:
    linear-gradient(135deg, rgba(0, 30, 60, 0.85) 0%, rgba(0, 80, 100, 0.6) 100%),
    url('https://images.unsplash.com/photo-1532187863486-abf9dbad1b69?w=1200&q=80') center/cover no-repeat;
}

.hero-biology {
  background:
    linear-gradient(135deg, rgba(0, 30, 60, 0.85) 0%, rgba(0, 80, 100, 0.6) 100%),
    url('https://images.unsplash.com/photo-1576086213369-97a306d36557?w=1200&q=80') center/cover no-repeat;
}

.hero-mock-test {
  background:
    linear-gradient(135deg, rgba(0, 30, 60, 0.85) 0%, rgba(0, 80, 100, 0.6) 100%),
    url('https://images.unsplash.com/photo-1434030216411-0b793f4b4173?w=1200&q=80') center/cover no-repeat;
}

.hero-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
}

.practice-hub-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: "Alexandria", sans-serif;
  transition: background 0.2s;
}

.practice-hub-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.practice-hub-btn svg {
  width: 12px;
  height: 12px;
}

.hero-content {
  position: absolute;
  bottom: 28px;
  left: 24px;
  z-index: 2;
}

.hero-content h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.hero-content p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 6px;
  line-height: 1.5;
}

.hero-stats {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 12px;
  z-index: 2;
}

.stat-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 18px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 110px;
}

.stat-card svg {
  margin-bottom: 4px;
}

.stat-card:first-child svg {
  color: #818cf8;
}

.stat-card:last-child svg {
  color: #34d399;
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.stat-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* Search Bar */
.search-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px 8px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 9px 16px;
  width: 220px;
}

.search-input-wrap svg {
  color: #717171;
  width: 18px;
  height: 18px;
}

.search-input-wrap input {
  background: none;
  border: none;
  outline: none;
  font-size: 0.82rem;
  width: 100%;
  color: #ccc;
}

.view-toggle {
  display: flex;
  gap: 4px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.toggle-btn-wrap {
  position: relative;
  display: inline-flex;
}

.toggle-btn-wrap .btn-tooltip {
  border: 1px solid #ccc;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: "Alexandria", sans-serif;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 100;
}

.toggle-btn-wrap .btn-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #fff;
  border: 1px solid #ccc;
}

.toggle-btn-wrap:hover .btn-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.gridView svg,
.listView svg {
  width: 16px;
  height: 16px;
}

.toggle-btn {
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 8px;
}

.toggle-btn.active,
.toggle-btn:hover {
  color: var(--text-primary-color);
}

.live-count {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.6rem;
  color: var(--text-primary-color);
  letter-spacing: 0.04em;
  font-weight: 700;
  border: 1px solid var(--text-primary-color);
  padding: 5px 10px;
  border-radius: 8px;
}

.live-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-primary-color);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--text-primary-color);
  animation: ping 1.2s cubic-bezier(0, 0, .2, 1) infinite;
}

@keyframes ping {

  75%,
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* Chapter Card Grid */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 16px 24px;
}

.chapter-card {
  border: 1px solid #ccc;
  border-radius: 14px;
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subject-tag {
  background: var(--bg-primary-color);
  color: var(--text-primary-color);
  border: 1px solid var(--text-primary-color);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 20px;
}

.arrow-btn {
  background: var(--bg-primary-color);
  border: none;
  color: var(--text-primary-color);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arrow-btn:hover {
  transform: scale(1.1);
}

.chapter-card h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0;
  margin-top: 0;
  transition: color 0.2s;
}

.chapter-card:hover {
  border-color: var(--text-primary-color);
}

.chapter-card:hover h3 {
  color: var(--text-primary-color);
}

.q-count {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.77rem;
  margin-bottom: 0;
  color: #666;
}

.q-count svg {
  color: #787878;
  width: 14px;
  height: 14px;
}

.status {
  font-size: 0.72rem;
  font-weight: 600;
  color: #666;
}

.lock svg {
  width: 16px;
  height: 16px;
}

.list-icon,
.list-meta,
.list-arrow-btn {
  display: none;
}

.chapters-grid.list-view {
  grid-template-columns: 1fr;
  gap: 10px;
}

.chapters-grid.list-view .chapter-card {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border: 1px solid #ccc;
  border-radius: 14px;
}

.chapters-grid.list-view .chapter-card:hover {
  border-color: var(--text-primary-color);
}

.chapters-grid.list-view .list-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--bg-primary-color);
  flex-shrink: 0;
  color: var(--text-primary-color);
}

.chapters-grid.list-view .list-icon svg {
  width: 22px;
  height: 22px;
}

.chapters-grid.list-view .chapter-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chapters-grid.list-view .card-top {
  display: none;
}

.chapters-grid.list-view .q-count {
  display: none;
}

.chapters-grid.list-view .chapter-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapters-grid.list-view .chapter-card:hover h3 {
  color: var(--text-primary-color);
}

.chapters-grid.list-view .list-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-tag {
  background: var(--bg-primary-color);
  color: var(--text-primary-color);
  border: 1px solid var(--text-primary-color);
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 2px 7px;
  border-radius: 20px;
}

.list-q-count {
  font-size: 0.75rem;
  color: #5a607a;
}

.chapters-grid.list-view .status {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: #4a5070;
  white-space: nowrap;
  margin-left: auto;
  margin-right: 14px;
  flex-shrink: 0;
}

.chapters-grid.list-view .list-arrow-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-primary-color);
  color: var(--text-primary-color);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}

.chapters-grid.list-view .list-arrow-btn:hover {
  transform: scale(1.08);
}

.chapters-grid.list-view .list-arrow-btn svg {
  width: 18px;
  height: 18px;
}

.chapters-grid.list-view .arrow-btn {
  display: none;
}

/* Subject Overview */
.subject-overview {
  padding: 12px 24px 40px;
}

.subject-line {
  border-top: 1px solid #f3e8ff;
}

.overview-title {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 14px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.overview-card {
  border: 1px solid #ccc;
  border-radius: 14px;
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.ov-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.chapters-icon {
  background: #f3e8ff;
  color: #9333ea;
}

.questions-icon {
  background: rgb(204, 253, 224);
  color: #34d399;
}

.availability-icon {
  background: rgb(255, 234, 203);
  color: #f59e0b;
}

.ov-num {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.ov-label {
  font-size: 0.65rem;
  color: #666;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .chapters-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-stats {
    gap: 8px;
  }

  .stat-card {
    min-width: 90px;
    padding: 14px 16px;
  }
}

@media (max-width: 600px) {
  .chapters-grid {
    grid-template-columns: 1fr;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .hero-banner {
    height: 200px;
    margin: 12px 12px 0;
  }

  .hero-stats {
    flex-direction: column;
    gap: 6px;
    top: 16px;
    transform: none;
  }

  .hero-content h1 {
    font-size: 1.6rem;
  }

  .search-bar-row {
    flex-wrap: wrap;
  }

  .live-count {
    margin-left: 0;
  }

  .countdown-banner {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
}

.chapters-grid.list-view .chapter-info .status {
  display: none;
}


.list-status {
  display: none;
}

.chapters-grid.list-view .list-status {
  display: block;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: #4a5070;
  white-space: nowrap;
  margin-left: auto;
  margin-right: 14px;
  flex-shrink: 0;
}