:root {
  --bg-body: #F9F9F9;
  --bg-container: rgba(255, 255, 255);
  --bg-card: #ffffff;
  --bg-error: rgba(255, 107, 107, 0.1);
  --bg-card-hover: rgba(239, 240, 164, 0.25);

  --text-primary: #333333;
  --text-secondary: #8B8B8B;
  --text-title: #121212;
  --text-error: #e53e3e;
  --text-white: #ffffff;
  --color-accent-yellow: #EFF0A4;
  --color-accent-blue: #E2E8F0;

  --border-error: rgba(255, 107, 107, 0.3);
  --shadow-card: rgba(0, 0, 0, 0.1);
}

/*
@media (prefers-color-scheme: dark) {
  :root {
    --bg-body: #1a1a1a;
    --bg-container: rgba(45, 45, 45, 0.9);
    --bg-card: #2d2d2d;
    --bg-error: rgba(255, 107, 107, 0.2);
    --bg-card-hover: rgba(239, 240, 164, 0.25);

    --text-primary: #333333;
    --text-secondary: #cbd5e0;
    --text-title: #f7fafc;
    --text-error: #fc8181;
    --text-white: #ffffff;
    --color-accent-yellow: #F3F7B4;
    --color-accent-blue: #E2E8F0;

    --border-error: rgba(255, 107, 107, 0.4);
    --shadow-card: rgba(0, 0, 0, 0.3);
  }
}
*/

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

body {
  font-family: 'Arial', sans-serif;
  min-height: 100vh;
  background-color: var(--bg-body);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header-section {
  padding: 32px 0;
}

.header-section h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-title);
  margin: 0 0 4px 0;
  line-height: 1.25;
}

.header-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--bg-container);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
  margin-bottom: 0;
}

.header-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Progress bar styles for card view */
.progress-container {
  height: 5px;
  margin: 0 20px;
  background: var(--bg-body);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--color-accent-yellow);
  transform-origin: 0 50%;
  border-radius: 2px;
  transition: width 0.1s ease;
}

@supports (animation-timeline: scroll()) {
  .progress-bar {
    width: 100%;
    animation: scroll-progress linear;
    animation-timeline: scroll(root);
  }

  @keyframes scroll-progress {
    from {
      transform: scaleX(0);
    }

    to {
      transform: scaleX(1);
    }
  }
}

h1 {
  font-size: 2.5em;
  font-weight: bold;
}

.cards-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

.card {
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.error {
  text-align: center;
  padding: 40px;
  border-radius: 15px;
  margin: 20px 0;
  font-size: 18px;
  background: var(--bg-error);
  color: var(--text-error);
  border: 2px solid var(--border-error);
}

.hidden {
  display: none;
}

@media (max-width: 768px) {
  .header-content {
    padding: 12px 20px;
    justify-content: center;
  }

  .header-section {
    padding: 24px 0;
  }

  .header-section h1 {
    font-size: 1.5rem;
  }

  .progress-container {
    margin: 0 20px;
  }

  .cards-container {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 15px;
  }

  main {
    padding-top: 0;
  }

  .fullscreen-card {
    min-height: calc(100vh - 80px);
  }
}

.preview-card {
  cursor: pointer;
}

.preview-card:hover {
  background-color: var(--bg-card-hover);
}

.card-preview-content {
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 16px;
  gap: 16px;
}

.card-image {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--color-accent-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.card-preview-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.card-preview-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-title);
  margin: 0 0 4px 0;
  line-height: 1.25;
}

.card-preview-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 4px 0 0 0;
  line-height: 1.43;
}

.card-preview-arrow {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.card-preview-arrow .material-symbols-outlined {
  font-size: 18px;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.preview-card:hover .card-preview-arrow {
  transform: scale(1.1);
}

.fullscreen-card {
  display: none;
  width: 100%;
  min-height: calc(100vh - 100px);
  background: var(--bg-card);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  padding-top: 75px;
}

.fullscreen-card.active {
  display: block;
  animation: slideInUp 0.3s ease forwards;
}

.fullscreen-card-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--bg-container);
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.fullscreen-card-header .header-top {
  display: flex;
  justify-content: flex-end;
  padding: 12px 120px;
  width: 100%;
}

.back-button {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
}

.back-button::before {
  content: '‹';
  margin-right: 5px;
  font-size: 18px;
}

.lesson-button {
  background: var(--color-accent-yellow);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
}

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fullscreen-card-content {
  width: 100%;
  padding: 0;
}

.cards-container.hidden-for-fullscreen {
  display: none;
}

@media (max-width: 768px) {
  .card-preview-title {
    font-size: 1.2em;
  }

  .fullscreen-card-header .header-top {
    padding: 12px 20px;
  }
}

/* Disabled card styles */
.preview-card.disabled {
  filter: grayscale(100%);
  opacity: 0.6;
  cursor: pointer; /* Still clickable to show modal */
}

.preview-card.disabled:hover {
  background-color: var(--bg-card); /* No hover effect for disabled cards */
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 32px;
  border-radius: 24px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #000;
  margin-bottom: 16px;
  line-height: 1.2;
}

.modal-text {
  font-size: 1rem;
  color: #666;
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-button {
  background: #000;
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.modal-button:hover {
  transform: scale(1.05);
}

.modal-button:active {
  transform: scale(0.95);
}
