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

:root {
  --background: #101922;
  --background-dark: #0d1419;
  --foreground: #e2e8f0;
  --primary: #0d7ff2;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-900: #0f172a;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: "Lexend", sans-serif;
  line-height: 1.5;
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }
}
.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  padding: 2rem;
  gap: 2rem;
  overflow: hidden;
}
header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
h1 {
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: white;
}
.btn {
  padding: 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid var(--slate-600);
  color: var(--slate-300);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover {
  background: var(--slate-700);
  border-color: var(--slate-500);
}
.btn-back {
  width: 2.5rem;
  height: 2.5rem;
}
.progress-bar {
  width: 100%;
  height: 2rem;
  background: var(--slate-800);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}
.progress-bar-fill {
  height: 100%;
  background: #0d7ff2;
  transition: width 0.3s ease;
  min-width: 0;
  border-radius: 9999px;
}
.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  z-index: 10;
}
main {
  display: flex;
  flex: 1;
  gap: 2rem;
  overflow: hidden;
}
.sidebar {
  width: 20rem;
  background: var(--background-dark);
  border-radius: 0.75rem;
  border: 1px solid var(--slate-800);
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--slate-800);
}
.sidebar-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: white;
}
.module-list {
  list-style: none;
}
.module-item {
  padding: 1rem;
  border-bottom: 1px solid var(--slate-800);
  cursor: pointer;
  transition: background 0.2s;
}
.module-item:hover {
  background: var(--slate-900);
}
.module-item.active {
  background: var(--primary);
  color: white;
}
.content {
  flex: 1;
  background: var(--background-dark);
  border-radius: 0.75rem;
  border: 1px solid var(--slate-800);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.content-header {
  padding: 1rem;
  border-bottom: 1px solid var(--slate-800);
}
.content-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: white;
}
.content-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
}
details {
  border-radius: 0.5rem;
  border: 1px solid var(--slate-800);
  margin-bottom: 0.75rem;
  overflow: visible;
}
summary {
  padding: 0.75rem;
  background: var(--slate-800);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
summary::-webkit-details-marker {
  display: none;
}
summary:hover {
  background: var(--slate-700);
}
summary .tooltip-container {
  flex-shrink: 0;
}
summary .tooltip {
  top: 0;
  transform: translateY(0);
}
summary .tooltip::after {
  top: 12px;
}
.details-content {
  padding: 0.75rem;
  background: var(--slate-900);
}
.lesson {
  margin-bottom: 0.5rem;
}
.lesson-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--slate-300);
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: background 0.2s;
  cursor: pointer;
  position: relative;
}
.lesson-label:hover {
  background: rgba(30, 41, 59, 0.5);
}
.custom-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.25rem;
  border: 1px solid var(--slate-600);
  background: transparent;
  cursor: pointer;
  margin-top: 0.125rem;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
}
.custom-checkbox:checked {
  background-color: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}
.lesson-content {
  flex: 1;
  min-width: 0;
}
.lesson-title {
  display: block;
  margin-bottom: 0.25rem;
}
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--slate-800);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  margin-top: 0.375rem;
  width: 100%;
}
.badge-label {
  font-weight: 600;
  color: var(--primary);
  margin-right: 0.375rem;
}
.badge-text {
  color: var(--slate-300);
}
.icon-button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0.25rem;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s;
  margin-left: 0.5rem;
  flex-shrink: 0;
}
.icon-button.lesson-info {
  margin-left: auto;
  margin-right: 0;
}
.icon-button:hover {
  color: #0b6fd1;
}
.icon-button svg {
  width: 1rem;
  height: 1rem;
}
.tooltip-container {
  position: relative;
  display: inline-flex;
  z-index: 10000;
}
.tooltip {
  position: absolute;
  right: 100%;
  top: 0;
  margin-right: 0.5rem;
  background: #1e293b;
  color: white;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  border: 1px solid var(--slate-700);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
  z-index: 10001;
  max-width: 400px;
  min-width: 280px;
  white-space: normal;
  word-wrap: break-word;
  display: none;
  line-height: 1.5;
  backdrop-filter: none;
}
.tooltip-container:hover {
  z-index: 10002;
}
.lesson-label .tooltip-container {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
}
.lesson-label .tooltip {
  top: 0;
  transform: translateY(0);
  background: #1e293b;
  z-index: 10001;
}
.tooltip-container:hover .tooltip {
  display: block;
}
.tooltip::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 8px;
  width: 8px;
  height: 8px;
  background: #1e293b;
  border-right: 1px solid var(--slate-700);
  border-bottom: 1px solid var(--slate-700);
  transform: rotate(-45deg);
  z-index: 10001;
}
.landing-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, #101922 0%, #0d1419 50%, #0a0f14 100%);
  position: relative;
  overflow: hidden;
}

.landing-page::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(13, 127, 242, 0.05) 0%,
    transparent 50%
  );
  animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.landing-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
}

.landing-header {
  text-align: center;
  margin-bottom: 3rem;
}

.landing-page h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  text-align: center;
  background: linear-gradient(135deg, #ffffff 0%, #0d7ff2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.landing-subtitle {
  font-size: 1.125rem;
  color: var(--slate-300);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

.landing-features {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
  padding: 2rem 0;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--slate-300);
  font-size: 0.95rem;
  font-weight: 500;
}

.feature-item svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--primary);
  stroke-width: 1.5;
}

.select-group-title {
  font-size: 1.75rem;
  color: white;
  margin-bottom: 2.5rem;
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.group-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  width: 100%;
}

.group-card {
  background: rgba(13, 17, 25, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 2rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.group-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(100, 116, 139, 0.3),
    rgba(100, 116, 139, 0.1)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: all 0.4s ease;
}

.group-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(13, 127, 242, 0.05) 0%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: 1rem;
}

.group-card:hover::before {
  background: linear-gradient(
    135deg,
    rgba(13, 127, 242, 0.8),
    rgba(147, 51, 234, 0.6),
    rgba(13, 127, 242, 0.8)
  );
}

.group-card:hover::after {
  opacity: 1;
}

.group-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(13, 127, 242, 0.3),
    0 0 0 1px rgba(13, 127, 242, 0.1);
}

.card-badge {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: rgba(13, 127, 242, 0.15);
  color: var(--primary);
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
  align-self: flex-start;
  position: relative;
  z-index: 1;
}

.group-card h3 {
  font-size: 1.875rem;
  font-weight: 700;
  color: white;
  position: relative;
  z-index: 1;
  letter-spacing: -0.01em;
  margin: 0;
}

.card-description {
  color: var(--slate-300);
  font-size: 0.95rem;
  line-height: 1.6;
  position: relative;
  z-index: 1;
  margin: 0;
  flex: 1;
}

.card-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.card-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.group-card:hover .card-link {
  transform: translateX(4px);
  display: inline-block;
}

@media (max-width: 768px) {
  .landing-page {
    padding: 2rem 1.25rem;
  }

  .landing-page h1 {
    font-size: 2.25rem;
    line-height: 1.2;
  }

  .landing-subtitle {
    font-size: 1rem;
  }

  .landing-features {
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 1.5rem 0;
  }

  .feature-item {
    font-size: 0.875rem;
  }

  .feature-item svg {
    width: 2rem;
    height: 2rem;
  }

  .select-group-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
  }

  .group-cards {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .group-card {
    padding: 1.75rem 1.5rem;
  }

  .group-card h3 {
    font-size: 1.5rem;
  }

  .card-description {
    font-size: 0.9rem;
  }
}
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 40;
  display: none;
}
#overlay.active {
  display: block;
}
.menu-btn {
  display: none;
}

@media (max-width: 1024px) {
  .container {
    padding: 1rem;
    gap: 1rem;
  }
  h1 {
    font-size: 1.5rem;
    text-align: left;
    width: auto;
  }
  .header-left {
    flex: 1;
    justify-content: flex-start;
  }
  .header-top {
    gap: 0.5rem;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 75%;
    max-width: 300px;
    height: 100vh;
    z-index: 50;
    transition: left 0.3s ease;
  }
  .sidebar.active {
    left: 0;
  }
  .menu-btn {
    display: inline-flex;
  }
  main {
    flex-direction: column;
  }
  .btn-back,
  .menu-btn {
    width: 2.25rem;
    height: 2.25rem;
  }
  .btn-back svg,
  .menu-btn svg {
    width: 1.25rem;
    height: 1.25rem;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 0.75rem;
    overflow: hidden;
  }
  
  main {
    overflow: hidden;
    height: calc(100vh - 6rem);
  }

  h1 {
    font-size: 1.25rem;
  }

  .progress-bar {
    height: 1.75rem;
  }

  .progress-text {
    font-size: 0.75rem;
  }

  .content-header h3 {
    font-size: 1rem;
  }

  .content-header {
    padding: 0.75rem;
  }

  .lesson-label {
    flex-wrap: nowrap;
    padding: 0.5rem;
    gap: 0.5rem;
    position: relative;
  }

  .lesson-content {
    flex: 1;
    min-width: 0;
    padding-right: 2.5rem;
  }

  .lesson-label .tooltip-container {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
  }

  summary {
    padding: 0.625rem;
    font-size: 0.9rem;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  summary > span {
    flex: 1;
    min-width: 0;
  }

  summary .tooltip-container {
    flex-shrink: 0;
  }

  .icon-button {
    padding: 0.25rem;
  }

  .icon-button svg {
    width: 0.875rem;
    height: 0.875rem;
  }

  .tooltip {
    position: absolute;
    right: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
    max-width: 200px;
    min-width: 200px;
    width: 200px;
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10001;
    padding: 0.75rem;
    background: #1e293b;
    backdrop-filter: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--slate-600);
  }

  .tooltip::after {
    right: -4px;
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
    background: #1e293b;
    z-index: 10001;
    border-right: 1px solid var(--slate-600);
    border-bottom: 1px solid var(--slate-600);
    border-left: none;
    border-top: none;
  }

  .custom-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
  }

  .lesson-title {
    font-size: 0.875rem;
    line-height: 1.4;
    word-break: break-word;
  }

  .details-content {
    padding: 0.5rem;
  }

  .chapter-details {
    margin-bottom: 0.5rem;
  }

  .btn-back,
  .menu-btn {
    width: 2.25rem !important;
    height: 2.25rem !important;
  }

  .btn-back svg,
  .menu-btn svg {
    width: 1.125rem !important;
    height: 1.125rem !important;
  }
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--slate-400);
}
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--slate-900);
}
::-webkit-scrollbar-thumb {
  background: var(--slate-700);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--slate-600);
}
