/* ============================================ */
/* GLOBAL STYLES */
/* ============================================ */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

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

.main-title {
  text-align: center;
  color: white;
  font-size: 3rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.5rem;
  margin-bottom: 40px;
  font-weight: 300;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* ============================================ */
/* NOTICE BOX */
/* ============================================ */

.important-notice {
  background: linear-gradient(135deg, #fff3cd 0%, #ffe8a1 100%);
  border: 3px solid #ffc107;
  border-radius: 12px;
  padding: 25px 35px;
  margin-bottom: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.important-notice h2 {
  color: #856404;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.important-notice p {
  color: #856404;
  margin: 10px 0;
  font-size: 1.05rem;
  line-height: 1.6;
}

.important-notice ul {
  margin: 15px 0;
  padding-left: 25px;
}

.important-notice li {
  margin: 8px 0;
  color: #856404;
}

.important-notice code {
  background: rgba(255, 255, 255, 0.8);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #ffc107;
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
}

/* ============================================ */
/* VIDEO SECTION */
/* ============================================ */

.video-section {
  background: white;
  border-radius: 12px;
  padding: 35px;
  margin-bottom: 35px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.video-section h2 {
  color: #667eea;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.8rem;
}

.video-section p {
  color: #666;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.video-section video {
  display: block;
  margin: 0 auto;
  background: #000;
}

/* ============================================ */
/* QUESTION SECTIONS */
/* ============================================ */

.question {
  background: white;
  border-radius: 12px;
  padding: 35px;
  margin-bottom: 35px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.question:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.question-title {
  color: #667eea;
  border-bottom: 4px solid #667eea;
  padding-bottom: 12px;
  margin-bottom: 25px;
  font-size: 1.8rem;
}

.question-brief {
  line-height: 1.8;
  color: #333;
}

.question-brief h3 {
  color: #555;
  margin-top: 25px;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.question-brief ul {
  margin-left: 25px;
  margin-bottom: 20px;
}

.question-brief li {
  margin-bottom: 12px;
  line-height: 1.6;
}

.question-brief code {
  background: #f4f4f4;
  padding: 3px 8px;
  border-radius: 4px;
  color: #e83e8c;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
}

.hints {
  background: #e7f3ff;
  border-left: 4px solid #2196f3;
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 4px;
}

.hints li {
  color: #0d47a1;
  margin-bottom: 10px;
}

.demo-label {
  margin-top: 25px;
  margin-bottom: 15px;
  color: #666;
  font-size: 1.1rem;
  font-weight: 600;
}

/* ============================================ */
/* DEMO AREAS */
/* ============================================ */

.demo-area {
  background: #1a1a2e;
  padding: 30px;
  border-radius: 8px;
  margin-top: 20px;
  min-height: 200px;
}

.demo-fireworks {
  background: linear-gradient(to bottom, #0a0a1e 0%, #1a1a2e 50%, #2a1a3e 100%);
  padding: 20px;
}

/* Canvas Styles */
canvas {
  display: block;
  margin: 0 auto 20px auto;
  border-radius: 8px;
  background: linear-gradient(to bottom, #0a0a1e 0%, #1a1a2e 100%);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  cursor: crosshair;
}

/* Demo Controls */
.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 15px;
}

.demo-controls > div {
  flex: 1;
  min-width: 250px;
}

.demo-controls h3 {
  color: white;
  margin: 0 0 15px 0;
  font-size: 1.1rem;
  text-align: center;
}

.demo-controls button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  margin: 5px;
}

.demo-controls button:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.demo-controls button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Counter Display */
.counter-display {
  background: rgba(26, 26, 46, 0.8);
  color: #4fc3f7;
  padding: 15px;
  border-radius: 6px;
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 15px;
  border: 2px solid #4fc3f7;
  box-shadow: 0 0 20px rgba(79, 195, 247, 0.3);
}

/* Info Display */
.info-display {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  text-align: center;
  font-size: 1rem;
  margin-top: 10px;
}

/* ============================================ */
/* OUTPUT CONSOLE */
/* ============================================ */

.output-console {
  background: #0a0a0a;
  color: #00ff00;
  padding: 20px;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  border: 2px solid #333;
}

.log-entry {
  padding: 6px 0;
  border-bottom: 1px solid #1a1a1a;
  line-height: 1.5;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry.success {
  color: #4caf50;
}

.log-entry.error {
  color: #f44336;
}

.log-entry.info {
  color: #2196f3;
}

/* Scrollbar Styling */
.output-console::-webkit-scrollbar {
  width: 10px;
}

.output-console::-webkit-scrollbar-track {
  background: #0a0a0a;
}

.output-console::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 5px;
}

.output-console::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ============================================ */
/* GRADING SECTION */
/* ============================================ */

.grading {
  background: white;
  border-radius: 12px;
  padding: 35px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.grading h2 {
  color: #e74c3c;
  border-bottom: 4px solid #e74c3c;
  padding-bottom: 12px;
  margin-bottom: 25px;
  font-size: 1.8rem;
}

.grading h3 {
  color: #555;
  margin-top: 30px;
  margin-bottom: 15px;
  font-size: 1.4rem;
}

.grading table {
  width: 100%;
  border-collapse: collapse;
  margin: 25px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.grading th,
.grading td {
  border: 1px solid #ddd;
  padding: 15px;
  text-align: left;
}

.grading th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
}

.grading tr:nth-child(even) {
  background-color: #f8f9fa;
}

.grading tr:hover {
  background-color: #e9ecef;
}

.grading ul {
  margin-left: 25px;
  margin-top: 15px;
}

.grading li {
  margin-bottom: 10px;
  line-height: 1.6;
}

/* ============================================ */
/* RESPONSIVE DESIGN */
/* ============================================ */

@media (max-width: 768px) {
  .assignment-container {
    padding: 20px 10px;
  }

  .main-title {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1.2rem;
  }

  .question {
    padding: 20px;
  }

  .question-title {
    font-size: 1.4rem;
  }

  canvas {
    width: 100%;
    height: auto;
  }

  .demo-controls {
    flex-direction: column;
  }

  .demo-controls > div {
    width: 100%;
  }

  .demo-controls button {
    width: 100%;
    margin: 5px 0;
  }
}

/* ============================================ */
/* ANIMATIONS */
/* ============================================ */

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

.question {
  animation: fadeIn 0.5s ease-out;
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(79, 195, 247, 0.6);
  }
}

.counter-display {
  animation: glow 2s infinite;
}

/* ============================================ */
/* UTILITY CLASSES */
/* ============================================ */

.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}
