/* KnowQuest Page Specific Styles */

/* Hero Section Enhancements */
.hero-illustration {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.code-window {
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid #333;
}

.window-header {
  background: #2d2d2d;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.window-controls {
  display: flex;
  gap: 8px;
}

.control {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.control.red {
  background: #ff5f56;
}

.control.yellow {
  background: #ffbd2e;
}

.control.green {
  background: #27ca3f;
}

.window-title {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
}

.window-content {
  padding: 20px;
  font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

.code-line {
  margin-bottom: 4px;
  color: #e6e6e6;
}

.indent {
  margin-left: 20px;
}

.indent-2 {
  margin-left: 40px;
}

.code-keyword {
  color: #ff7b72;
  font-weight: 600;
}

.code-function {
  color: #7ee787;
}

.code-variable {
  color: #79c0ff;
}

.code-string {
  color: #a5d6ff;
}

/* Language Cards */
.language-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  height: 100%;
  border: 1px solid var(--gray-200);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.language-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.python-card::before {
  background: linear-gradient(90deg, #3776ab, #ffd43b);
}

.html-card::before {
  background: linear-gradient(90deg, #e34c26, #f06529);
}

.css-card::before {
  background: linear-gradient(90deg, #1572b6, #33a9dc);
}

.js-card::before {
  background: linear-gradient(90deg, #f7df1e, #323330);
}

.language-card:hover::before {
  transform: scaleX(1);
}

.language-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
  border-color: transparent;
}

.language-header {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}

.language-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.python-card .language-icon {
  background: linear-gradient(135deg, #3776ab, #ffd43b);
  color: white;
}

.html-card .language-icon {
  background: linear-gradient(135deg, #e34c26, #f06529);
  color: white;
}

.css-card .language-icon {
  background: linear-gradient(135deg, #1572b6, #33a9dc);
  color: white;
}

.js-card .language-icon {
  background: linear-gradient(135deg, #f7df1e, #323330);
  color: #323330;
}

.language-info h3 {
  margin: 0 0 0.5rem 0;
  color: var(--gray-900);
  font-size: 1.5rem;
  font-weight: 700;
}

.language-duration {
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 500;
}

.language-progress {
  margin-bottom: 2rem;
}

.progress-section {
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.progress-section:last-child {
  border-bottom: none;
}

.progress-section h5 {
  color: var(--primary);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.progress-section p {
  color: var(--gray-600);
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.language-cta {
  margin-top: auto;
}

/* Curriculum Section */
.curriculum-section {
  margin: 3rem 0;
  padding: 2rem;
  background: white;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
}

.curriculum-header {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}

.curriculum-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  margin-right: 1rem;
}

.curriculum-header h3 {
  color: var(--gray-900);
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
}

.curriculum-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
}

.curriculum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.curriculum-table th {
  background: var(--gray-100);
  color: var(--gray-900);
  font-weight: 600;
  padding: 1rem;
  text-align: left;
  border-bottom: 2px solid var(--gray-200);
}

.curriculum-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
}

.curriculum-table tr:hover {
  background: var(--gray-50);
}

.curriculum-table td:first-child {
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  width: 60px;
}

.curriculum-table td:nth-child(2) {
  font-weight: 600;
  color: var(--gray-900);
  min-width: 200px;
}

.curriculum-table td:last-child {
  color: var(--gray-600);
  line-height: 1.5;
}

.curriculum-toggle-section {
  text-align: center;
  margin-top: 3rem;
}

.curriculum-toggle {
  margin: 0.5rem;
}



/* Reward Structure */
.reward-structure {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.reward-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--gray-200);
  transition: all 0.3s ease;
}

.reward-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
  border-color: var(--primary);
}

.reward-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.75rem;
  margin: 0 auto 1.5rem;
}

.reward-card h4 {
  color: var(--gray-900);
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.reward-card p {
  color: var(--gray-600);
  line-height: 1.6;
  margin: 0;
}

/* Tips Section */
.tip-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--gray-200);
  transition: all 0.3s ease;
  height: 100%;
}

.tip-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
  border-color: var(--primary);
}

.tip-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.tip-card h5 {
  color: var(--gray-900);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.tip-card p {
  color: var(--gray-600);
  line-height: 1.6;
  margin: 0;
  font-size: 0.95rem;
}

/* CTA Section Enhancements */
.cta-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.feature-item {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  font-weight: 500;
}

.feature-item i {
  color: rgba(255, 255, 255, 0.8);
  margin-right: 0.5rem;
}

/* Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.curriculum-section {
  animation: slideInUp 0.6s ease-out;
}

/* Code highlighting animation */
@keyframes typeWriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.code-line {
  overflow: hidden;
  white-space: nowrap;
  animation: typeWriter 3s steps(40, end) infinite;
}

.code-line:nth-child(2) {
  animation-delay: 0.5s;
}

.code-line:nth-child(3) {
  animation-delay: 1s;
}

.code-line:nth-child(4) {
  animation-delay: 1.5s;
}

.code-line:nth-child(5) {
  animation-delay: 2s;
}

.code-line:nth-child(6) {
  animation-delay: 2.5s;
}

/* Responsive Design */
@media (max-width: 992px) {
  .language-header {
    flex-direction: column;
    text-align: center;
  }

  .language-icon {
    margin-right: 0;
    margin-bottom: 1rem;
  }

  .curriculum-table {
    font-size: 0.8rem;
  }

  .curriculum-table th,
  .curriculum-table td {
    padding: 0.5rem;
  }
}

@media (max-width: 768px) {
  .code-window {
    margin: 0 1rem;
  }

  .window-content {
    padding: 15px;
    font-size: 0.8rem;
  }

  .language-card {
    padding: 1.5rem;
  }

  .curriculum-section {
    padding: 1.5rem;
    margin: 2rem 0;
  }

  .curriculum-header {
    flex-direction: column;
    text-align: center;
  }

  .curriculum-icon {
    margin-right: 0;
    margin-bottom: 1rem;
  }

  .curriculum-header h3 {
    font-size: 1.5rem;
  }

  .reward-structure {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .reward-card,
  .tip-card {
    padding: 1.5rem;
  }

  .cta-features {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (max-width: 576px) {
  .hero-illustration {
    max-width: 100%;
    padding: 0 1rem;
  }

  .curriculum-table-wrapper {
    border-radius: 8px;
  }

  .curriculum-table th,
  .curriculum-table td {
    padding: 0.4rem 0.6rem;
  }

  .curriculum-table td:nth-child(2) {
    min-width: 150px;
  }

  .language-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .reward-icon,
  .tip-icon {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }

  .code-line {
    animation: none;
    white-space: normal;
    overflow: visible;
  }
}

/* Print Styles */
@media print {
  .curriculum-table {
    break-inside: avoid;
  }
  
  .language-card,
  .reward-card,
  .tip-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .code-window {
    border: 2px solid #000;
  }
  
  .curriculum-table th {
    background: #000;
    color: #fff;
  }
  
  .language-card:hover,
  .reward-card:hover,
  .tip-card:hover {
    border-color: #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .language-card,
  .reward-card,
  .tip-card,
  .curriculum-section {
    transition: none;
    animation: none;
  }
  
  .code-line {
    animation: none;
  }
  
  .language-card:hover,
  .reward-card:hover,
  .tip-card:hover {
    transform: none;
  }
}
