/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 2rem;
  color: #333;
  line-height: 1.6;
}

/* Topic Container */
.topic-container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  padding: 3rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.8s ease-out;
}

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

/* Header */
.topic-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 3px solid #667eea;
}

.topic-header h1 {
  color: #667eea;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topic-subtitle {
  color: #666;
  font-size: 1.2rem;
  font-style: italic;
}

/* Navigation Buttons */
.topic-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.nav-btn {
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-back {
  background: #6c757d;
  color: white;
}

.btn-back:hover {
  background: #5a6268;
  transform: translateX(-5px);
  box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.btn-next {
  background: #667eea;
  color: white;
}

.btn-next:hover {
  background: #5568d3;
  transform: translateX(5px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Content Sections */
.content-section {
  margin-bottom: 3rem;
  animation: fadeInUp 0.6s ease-out backwards;
}

.content-section:nth-child(2) {
  animation-delay: 0.1s;
}
.content-section:nth-child(3) {
  animation-delay: 0.2s;
}
.content-section:nth-child(4) {
  animation-delay: 0.3s;
}

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

.content-section h2 {
  color: #667eea;
  font-size: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e0e0e0;
}

.content-section h3 {
  color: #764ba2;
  font-size: 1.5rem;
  margin: 1.5rem 0 1rem 0;
}

.content-section p {
  margin-bottom: 1rem;
  color: #555;
}

.content-section ul,
.content-section ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.content-section li {
  margin-bottom: 0.5rem;
  color: #555;
}

/* Info Box */
.info-box {
  background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
  border-left: 5px solid #667eea;
  padding: 1.5rem;
  border-radius: 10px;
  margin: 1.5rem 0;
}

.info-box h3 {
  color: #667eea;
  margin-bottom: 1rem;
}

/* Code Block */
.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 1.5rem;
  border-radius: 10px;
  overflow-x: auto;
  margin: 1rem 0;
  position: relative;
}

.code-block pre {
  margin: 0;
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.6;
}

.code-block code {
  color: #d4d4d4;
}

/* Example Box */
.example-box {
  background: #f8f9fa;
  border: 2px solid #667eea;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.example-box h3 {
  color: #667eea;
  margin-bottom: 1rem;
}

/* Live Demo */
.live-demo {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 2rem;
  margin: 1.5rem 0;
}

.demo-output {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* MCQ Container */
.mcq-container {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 10px;
  margin: 1.5rem 0;
}

.mcq-question {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.mcq-question p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.mcq-options {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.mcq-options label {
  display: flex;
  align-items: center;
  padding: 0.8rem;
  background: #f8f9fa;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mcq-options label:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.mcq-options input[type="radio"] {
  margin-right: 0.8rem;
  cursor: pointer;
}

.check-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.check-btn:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.feedback {
  margin-top: 1rem;
}

.feedback .correct {
  color: #28a745;
  font-weight: 600;
  padding: 0.5rem;
  background: #d4edda;
  border-radius: 5px;
}

.feedback .incorrect {
  color: #dc3545;
  font-weight: 600;
  padding: 0.5rem;
  background: #f8d7da;
  border-radius: 5px;
}

.feedback .warning {
  color: #856404;
  font-weight: 600;
  padding: 0.5rem;
  background: #fff3cd;
  border-radius: 5px;
}

/* Practice Box */
.practice-box {
  background: #fff3cd;
  border-left: 5px solid #ffc107;
  padding: 1.5rem;
  border-radius: 10px;
  margin: 1.5rem 0;
}

.practice-box ol {
  margin-left: 1.5rem;
}

.practice-box li {
  margin-bottom: 1rem;
  color: #333;
  font-weight: 500;
}

/* Summary Section */
.summary-section {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 2rem;
  border-radius: 15px;
  margin-top: 3rem;
}

.summary-section h2 {
  color: white;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.summary-box ul {
  list-style: none;
  margin-left: 0;
}

.summary-box li {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  position: relative;
  color: white;
}

.summary-box li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #ffc107;
  font-weight: bold;
}

.summary-box code {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-family: "Courier New", monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  .topic-container {
    padding: 1.5rem;
  }

  .topic-header h1 {
    font-size: 1.8rem;
  }

  .topic-nav {
    flex-direction: column;
  }

  .nav-btn {
    width: 100%;
    justify-content: center;
  }

  .content-section h2 {
    font-size: 1.5rem;
  }
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}
.back-btn {
  display: inline-block;
  background: white;
  color: #667eea;
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  margin-top: 2rem;
}

.back-btn:hover {
  background: #667eea;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Disable text selection for code blocks */
.code-block,
.code-block pre,
.code-block code {
  user-select: none;
  -webkit-user-select: none; /* Chrome, Safari */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* Edge */
}
