:root {
    --background-color: #2c3033;
    --accent-color: #3a8ce6;
    --accent-secondary: #2170c9;
    --accent-shadow: rgba(58, 140, 230, 0.3);
    --accent-shadow-light: rgba(74, 158, 255, 0.2);
    --accent-shadow-medium: rgba(74, 158, 255, 0.3);
    --accent-shadow-heavy: rgba(58, 140, 230, 0.5);
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--background-color);
    color: white;
    margin: 0;
    padding: 5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(180deg, #3a3f42 0%, var(--background-color) 50%, #1a1d20 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Prevent accidental horizontal scrolling on mobile due to oversized children */
* {
    box-sizing: border-box;
}

/* Clamp any element wider than the viewport */
@media (max-width: 768px) {
    body, .worksheet-box, .worksheet-section, .simulation-section, .simulation-container, .nav-container {
        max-width: 100vw;
        overflow-x: hidden;
    }
    img, canvas, video, table, .system-diagram img {
        max-width: 100% !important;
        height: auto !important;
    }
    /* Neutralize inline min-widths that force horizontal scroll */
    [style*="min-width"], [style*="width: 400px"], [style*="min-width: 400px"] {
        min-width: 0 !important;
        width: 100% !important;
    }
}

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px); /* Account for nav and padding */
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

@media screen and (display-mode: standalone) {
    body {
        height: 100vh;
        width: 100vw;
        overflow: auto;
        overflow-y: auto !important;
    }
    
    .main-container {
        height: calc(100vh - 80px);
        overflow-y: auto !important;
    }
    
    /* Ensure worksheet box works in standalone mode */
    .worksheet-box {
        overflow-y: auto !important;
        height: auto !important;
        min-height: calc(100vh - 100px);
    }
}

/* Theme Classes */
.theme-dark {
    --background-color: #2c3033;
    --accent-color: #3a8ce6;
    --accent-shadow: rgba(58, 140, 230, 0.3);
    --accent-shadow-light: rgba(74, 158, 255, 0.2);
    --accent-shadow-medium: rgba(74, 158, 255, 0.3);
    --accent-shadow-heavy: rgba(58, 140, 230, 0.5);
}

.theme-darker {
    --background-color: #1a1d20;
    --accent-color: #3a8ce6;
    --accent-shadow: rgba(58, 140, 230, 0.3);
    --accent-shadow-light: rgba(74, 158, 255, 0.2);
    --accent-shadow-medium: rgba(74, 158, 255, 0.3);
    --accent-shadow-heavy: rgba(58, 140, 230, 0.5);
}

.theme-blue-dark {
    --background-color: #1a2332;
    --accent-color: #3a8ce6;
    --accent-shadow: rgba(58, 140, 230, 0.3);
    --accent-shadow-light: rgba(74, 158, 255, 0.2);
    --accent-shadow-medium: rgba(74, 158, 255, 0.3);
    --accent-shadow-heavy: rgba(58, 140, 230, 0.5);
}

.theme-purple-dark {
    --background-color: #2a1a2f;
    --accent-color: #9b59b6;
    --accent-shadow: rgba(155, 89, 182, 0.4);
    --accent-shadow-light: rgba(155, 89, 182, 0.2);
    --accent-shadow-medium: rgba(155, 89, 182, 0.3);
    --accent-shadow-heavy: rgba(155, 89, 182, 0.5);
}

/* Matrix logo background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    background-image: url("data:image/svg+xml;utf8,<svg width='60' height='52' viewBox='0 0 60 52' fill='none' xmlns='http://www.w3.org/2000/svg'><polygon points='30,2 58,15 58,41 30,54 2,41 2,15' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='2'/></svg>");
    background-size: 60px 52px;
    background-repeat: repeat;
    opacity: 1;
    pointer-events: none;
}



@keyframes slideBackground {
    0% {
        transform: rotate(-45deg) translate(0, 0);
    }
    100% {
        transform: rotate(-45deg) translate(-150px, -150px);
    }
}

@keyframes flash {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0.3;
    }
}

@keyframes flashGreen {
    0%, 50% {
        background: #4CAF50;
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.6);
    }
    51%, 100% {
        background: #333;
        box-shadow: none;
    }
}

.flashing-green {
    animation: flashGreen 1s infinite;
}



h1 {
    color: #9da5b1;            /* Light gray color for headings */
    text-align: center;
    margin: 0;  /* Remove default margins */
}

/* Navigation Styles */
.main-navigation {
  background: rgba(26, 26, 26, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 10;
  width: 100%;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 0;
  min-width: 0;
  flex-shrink: 0;
}

.nav-logo img {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}

.nav-logo h1 {
  color: #FFFFFF;
  font-size: 18px;
  font-weight: bold;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 350px;
  transition: all 0.3s ease;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 5px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: 15px 20px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(51, 51, 51, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.nav-link:hover {
  background: rgba(74, 158, 255, 0.2);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
  border: 1px solid rgba(74, 158, 255, 0.3);
}

.nav-link.active {
  background: rgba(74, 158, 255, 0.25);
  color: #fff;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
  border: 1px solid rgba(74, 158, 255, 0.4);
}

.nav-link i {
  margin-right: 8px;
  font-size: 14px;
}

/* Responsive Navigation */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }
  
  .nav-logo {
    justify-content: center;
    padding: 10px 0;
  }
  
  .nav-logo h1 {
    font-size: 16px;
    max-width: 200px;
  }
  
  .nav-menu {
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
  }
  
  .nav-link {
    padding: 10px 15px;
    font-size: 12px;
  }
  
  .nav-link i {
    margin-right: 5px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 5px;
  }
  
  .nav-logo h1 {
    font-size: 14px;
    max-width: 160px;
  }
  
  .nav-link {
    padding: 8px 12px;
    font-size: 11px;
  }
  
  .nav-link i {
    font-size: 11px;
  }
}

@media (max-width: 1200px) {
  .nav-logo h1 {
    font-size: 16px;
    max-width: 280px;
  }
  .nav-link {
    padding: 12px 15px;
    font-size: 13px;
  }
}

@media (max-width: 900px) {
  .nav-logo h1 {
    font-size: 14px;
    max-width: 220px;
  }
  .nav-link {
    padding: 10px 12px;
    font-size: 12px;
  }
}

@media (max-width: 700px) {
  .nav-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 0 10px;
  }
  .nav-logo {
    justify-content: center;
    padding: 10px 0 0 0;
  }
  .nav-logo h1 {
    font-size: 13px;
    max-width: 180px;
  }
  .nav-menu {
    justify-content: center;
    gap: 3px;
  }
  .nav-link {
    padding: 8px 10px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 0 5px;
  }
  .nav-logo h1 {
    font-size: 12px;
    max-width: 140px;
  }
  .nav-link {
    padding: 6px 8px;
    font-size: 10px;
  }
}

@media (max-width: 360px) {
  .nav-logo h1 {
    font-size: 11px;
    max-width: 120px;
  }
  .nav-link {
    padding: 5px 6px;
    font-size: 9px;
  }
}

/* Worksheet Box Styling - Vertical Boxed Window Format */
.worksheet-box {
    max-width: 1400px;
    margin: 20px auto;
    background: #1a1a1a !important;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 2px solid #333;
    position: relative;
    z-index: 10;
    overflow: auto;
    display: block;
    /* Ensure proper scrolling behavior */
    height: auto;
    min-height: 100vh;
}

/* Additional solid background overrides */
.worksheet-container {
    background: transparent !important;
    position: relative;
    z-index: 1;
}

.loading-container {
    background: #2c3033 !important;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.loading-content {
    background: #1a1a1a !important;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #333;
}

.error-container {
    background: #2c3033 !important;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Ensure all content areas have solid backgrounds */
.worksheet-content,
#worksheet-content {
    background: transparent !important;
}

/* Override any remaining transparent backgrounds */
.scenario-info,
.scenario-introduction,
.scenario-content {
    background: #1a1a1a !important;
}

/* Make sure step cards are solid */
.step-card {
    background: #333 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.step-card:hover {
    background: #3a3a3a !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.step-card.step-completed {
    background: #2a2a2a !important;
    border-left-color: #666 !important;
    opacity: 0.7;
    cursor: default;
}

.step-card.step-completed:hover {
    background: #2a2a2a !important;
    transform: none;
    box-shadow: none;
}

.step-card.step-completed .step-number {
    background: #666 !important;
}

.step-card.step-completed .step-header h4,
.step-card.step-completed .step-content p {
    color: #999 !important;
}

/* Ensure question items are solid */
.question-item {
    background: #333 !important;
}

/* Navigation Buttons */
.worksheet-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #444;
    gap: 15px;
    flex-wrap: wrap;
}

/* Legacy nav-btn styles - only for old navigation, not worksheet navigation */
.worksheet-navigation .nav-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 160px;
    justify-content: center;
}

.worksheet-navigation .nav-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.nav-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.back-to-list-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.back-to-list-btn:hover {
    background: linear-gradient(135deg, #1976D2, #2196F3);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

/* Back to Worksheets Button Styling */
.back-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.back-btn:hover {
    background: linear-gradient(135deg, #1976D2, #2196F3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.5);
}

.back-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.back-btn i {
    font-size: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .worksheet-box {
        margin: 10px;
        padding: 20px;
    }
    
    .worksheet-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Improve content spacing within the box */
.worksheet-box .page-title {
    margin-top: 0;
    margin-bottom: 30px;
}

.worksheet-box .worksheet-section {
    margin-bottom: 30px;
}

.worksheet-box .so-what-section {
    margin-top: 30px;
    margin-bottom: 30px;
}

/* Hidden class for tab system */
.hidden {
    display: none !important;
}

/* Fallback styling for basic worksheets */
.worksheet-section {
    margin-bottom: 30px;
    margin-left: 30px;
    margin-right: 30px;
    background: #1a1a1a !important;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #333;
}

/* Add padding to the first section to account for removed container padding */
.worksheet-section:first-child {
    margin-top: 30px;
}

/* Center align worksheet content with proper padding */
.worksheet-section {
    margin-left: 30px;
    margin-right: 30px;
    margin-bottom: 30px;
}

/* Ensure the last section has proper bottom margin */
.worksheet-section:last-child {
    margin-bottom: 30px;
}

.section-header {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scenario-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* System Diagram Styling */
.system-diagram { 
    text-align: center; 
    margin: 20px 0; 
}

.system-diagram img { 
    width: 350px; 
    height: 250px; 
    object-fit: contain;
    border-radius: 8px; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); 
}

.system-diagram figcaption { 
    color: #FFFFFF; 
    margin-top: 10px; 
    font-style: italic; 
}

/* Introduction Section Two-Column Layout */
.introduction-content-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-top: 20px;
}

.introduction-text {
    flex: 0 0 60%;
    padding-right: 20px;
}

.introduction-text p {
    color: #FFFFFF;
    font-size: clamp(1rem, 1.2vw + 0.8rem, 1.4rem);
    line-height: 1.6;
    margin-bottom: 20px;
}

.introduction-image {
    flex: 0 0 40%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.introduction-image .system-diagram {
    margin: 0;
}

.introduction-image .system-diagram img {
    width: 100%;
    max-width: 300px;
    height: auto;
    max-height: 25vh;
    min-height: 200px;
    object-fit: contain;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .introduction-content-wrapper {
        flex-direction: column;
        gap: 20px;
    }
    
    .introduction-text,
    .introduction-image {
        flex: none;
        width: 100%;
    }
    
    .introduction-text {
        padding-right: 0;
    }
    
    .introduction-text p {
        font-size: clamp(1rem, 1vw + 0.9rem, 1.3rem);
    }
    
    .introduction-image .system-diagram img {
        max-height: 30vh;
        min-height: 150px;
    }
}

@media (max-width: 480px) {
    .introduction-text p {
        font-size: clamp(1rem, 0.8vw + 0.9rem, 1.2rem);
    }
}

/* CAD Models for Worksheet 1 */
.cad-models {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.cad-model img {
    width: 100%;
    max-width: 280px;
    height: auto;
    max-height: 20vh;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    object-fit: contain;
}

.cad-model figcaption {
    color: #FFFFFF;
    margin-top: 10px;
    font-style: italic;
    font-size: 14px;
}

/* Simulation Section Styling */
.simulation-section { 
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d); 
    border-radius: 12px; 
    padding: 30px; 
    margin: 40px 0; 
    border: 2px solid #FF5722; 
    box-shadow: 0 8px 20px rgba(255, 87, 34, 0.3); 
}

.simulation-container { 
    background: #333; 
    padding: 20px; 
    border-radius: 8px; 
    min-height: 400px; 
}

.simulation-loading { 
    text-align: center; 
    color: #FFFFFF; 
    padding: 50px; 
}

.simulation-loading i { 
    font-size: 24px; 
    margin-bottom: 15px; 
}

/* Question Item Styling */
.question-item { 
    background: #333; 
    padding: 20px; 
    margin-bottom: 20px; 
    border-radius: 8px; 
}

.question-item h4 { 
    color: #FFFFFF; 
    margin-bottom: 10px; 
}

.answer-input { 
    width: 100%; 
    height: 100px; 
    padding: 10px; 
    border: 1px solid #555; 
    border-radius: 4px; 
    background: #222; 
    color: #FFFFFF; 
    resize: vertical; 
}

.submit-question-btn { 
    background: #4CAF50; 
    color: white; 
    border: none; 
    padding: 10px 20px; 
    border-radius: 4px; 
    cursor: pointer; 
    transition: all 0.3s ease;
}

.submit-question-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.submit-question-btn.incorrect {
    background: #ff4444 !important;
    animation: buttonShake 0.5s ease-in-out;
}

@keyframes buttonShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

/* LED Display Styling for Status LED Worksheet */
.led-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.led-row {
    display: flex;
    gap: 40px;
    justify-content: center;
}

.led-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.led-indicator {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.led-indicator.green {
    background: radial-gradient(circle, #4CAF50, #2E7D32);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.led-indicator.yellow {
    background: radial-gradient(circle, #333, #222);
    box-shadow: none;
}

.led-indicator.yellow.active {
    background: radial-gradient(circle, #FF9800, #F57C00);
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.5);
}

.led-indicator.red {
    background: radial-gradient(circle, #333, #222);
    box-shadow: none;
}

.led-indicator.red.active {
    background: radial-gradient(circle, #F44336, #D32F2F);
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.5);
}

.led-indicator.blue {
    background: radial-gradient(circle, #333, #222);
    box-shadow: none;
}

.led-indicator.blue.active {
    background: radial-gradient(circle, #2196F3, #1976D2);
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.5);
}

.led-label {
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* Step Card Styling for Emergency Stop Worksheet */
.steps-container {
    margin-top: 20px;
}

.step-card {
    background: #333;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.step-number {
    background: #4CAF50;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.step-header h4 {
    color: #FFFFFF;
    margin: 0;
}

.step-content p {
    color: #FFFFFF;
    margin: 0;
}

/* Step checkbox styling */
.step-checkbox {
    position: relative;
    display: inline-block;
    cursor: pointer;
    user-select: none;
}

.step-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #444;
    border: 2px solid #666;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
}

.step-checkbox:hover input ~ .checkmark {
    background-color: #555;
    border-color: #777;
}

.step-checkbox input:checked ~ .checkmark {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.step-checkbox input:checked ~ .checkmark:after {
    display: block;
}

/* Emergency Stop Display Styling */
.estop-display {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.estop-button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.estop-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #333;
    background: radial-gradient(circle, #F44336, #D32F2F);
    box-shadow: 0 8px 16px rgba(244, 67, 54, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

.estop-button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(244, 67, 54, 0.6);
}

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

.estop-button.pressed {
    background: radial-gradient(circle, #D32F2F, #B71C1C);
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
}

.estop-status {
    text-align: center;
    color: #FFFFFF;
    font-weight: 600;
}

.estop-status.active {
    color: #4CAF50;
}

.estop-status.triggered {
    color: #F44336;
}

/* Status Display and Control Panel Styling */
.status-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #222;
    border-radius: 4px;
}

.status-label {
    color: #FFFFFF;
}

.status-value {
    color: #4CAF50;
    font-weight: bold;
}

.status-value.alarm {
    color: #FF0000;
}

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reset-button, .test-button {
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
}

.reset-button {
    background: #4CAF50;
    color: white;
}

.reset-button:disabled {
    background: #555;
    cursor: not-allowed;
}

.test-button {
    background: #FF9800;
    color: white;
}

/* Key Point Styling */
.key-point {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #333;
    border-radius: 8px;
}

.key-point i {
    color: #4CAF50;
    font-size: 20px;
    margin-top: 5px;
}

.key-point strong {
    color: #FFFFFF;
    display: block;
    margin-bottom: 5px;
}

.key-point p {
    color: #FFFFFF;
    margin: 0;
}

/* So What Section Card Styles - Simplified to match worksheet design */
.explanation-card {
  background: #333;
  border: 1px solid #555;
  border-radius: 8px;
  margin: 20px 0;
  overflow: hidden;
}

.card-header {
  background: #444;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid #555;
}

.card-header i {
  font-size: 20px;
  color: #4CAF50;
}

.card-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
}

.card-content {
  padding: 20px;
}

.card-content p {
  margin: 0;
  line-height: 1.6;
  color: #ffffff;
  font-size: 16px;
}

.key-points-card {
  background: #333;
  border: 1px solid #555;
  border-radius: 8px;
  margin: 20px 0;
  overflow: hidden;
}

.key-points-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  padding: 20px;
}

.key-point-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  background: #444;
  border: 1px solid #555;
  border-radius: 8px;
}

.key-point-icon {
  flex-shrink: 0;
  width: 35px;
  height: 35px;
  background: #4CAF50;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.key-point-icon i {
  font-size: 16px;
  color: #ffffff;
}

.key-point-content {
  flex: 1;
}

.key-point-content strong {
  color: #ffffff;
  font-size: 16px;
  line-height: 1.5;
  display: block;
}

/* Responsive design for the simplified cards */
@media (max-width: 768px) {
  .key-points-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px;
  }

  .card-header {
    padding: 12px 15px;
  }

  .card-header h3 {
    font-size: 16px;
  }

  .card-content {
    padding: 15px;
  }

  .key-point-item {
    padding: 12px;
  }

  .key-point-icon {
    width: 30px;
    height: 30px;
  }

  .key-point-icon i {
    font-size: 14px;
  }
}

/* CAD Model Styling */
.cad-models {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

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

.cad-model img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cad-model figcaption {
    color: #FFFFFF;
    margin-top: 10px;
    font-style: italic;
}

/* PID Simulation Section Styling */
#pid-tuning-container {
    margin-bottom: 40px;
}

#response-analysis-container {
    margin-bottom: 40px;
}

#challenges-container {
    margin-bottom: 20px;
}

#pid-tuning-container h3,
#response-analysis-container h3,
#challenges-container h3 {
    color: #FFFFFF;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

/* PID Control Styling */
.control-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.control-buttons button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.control-buttons button:hover {
    background: #45a049;
}

.pid-chart-container {
    background: linear-gradient(135deg, #2a2a2a, #3a3a3a);
    padding: 25px;
    border-radius: 12px;
    min-height: 450px;
    border: 2px solid #444;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.pid-chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, rgba(255, 255, 255, 0.02) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.02) 75%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.02) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.02) 75%);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    pointer-events: none;
    z-index: 0;
}

.pid-chart-container canvas {
    position: relative;
    z-index: 1;
    max-height: 400px !important;
    height: 400px !important;
}

.submit-note {
    color: #AAA;
    margin-left: 10px;
}

/* PID Controls Styling */
.pid-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    color: #FFFFFF;
    font-weight: bold;
}

.control-group input[type="range"] {
    width: 100%;
}

.control-group span {
    color: #4CAF50;
    font-weight: bold;
}

/* Control Button Styling */
.control-btn {
    background: #555;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.control-btn:hover {
    background: #666;
}

/* Response Metrics Styling */
.response-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.metric-card {
    background: #333;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #555;
}

.metric-card h4 {
    color: #4CAF50;
    margin-bottom: 10px;
    font-size: 16px;
}

.metric-card p {
    color: #FFFFFF;
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.response-tips {
    background: #333;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.response-tips h4 {
    color: #4CAF50;
    margin-bottom: 15px;
}

.response-tips ul {
    color: #FFFFFF;
    padding-left: 20px;
}

.response-tips li {
    margin-bottom: 8px;
}

/* Challenge Styling */
.challenge-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.challenge-item {
    background: #333;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #FF9800;
}

.challenge-item h4 {
    color: #FF9800;
    margin-bottom: 10px;
}

.challenge-item p {
    color: #FFFFFF;
    margin-bottom: 15px;
}

.challenge-btn {
    background: #FF9800;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.challenge-btn:hover {
    background: #F57C00;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

/* Force all dynamically created sections to have solid backgrounds */
.worksheet-box .introduction-section,
.worksheet-box .diagram-section,
.worksheet-box .steps-section,
.worksheet-box .educational-section,
.worksheet-box .questions-section,
.worksheet-box .simulation-section,
.worksheet-box .worksheet-section {
    background: #1a1a1a !important;
    position: relative;
    z-index: 11;
}

/* Distinct border styling for each section */
.worksheet-box .introduction-section {
    border: 2px solid #2196F3 !important;
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.3) !important;
}

.worksheet-box .over-to-you-section {
    border: 2px solid #4CAF50 !important;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3) !important;
}

.worksheet-box .so-what-section {
    border: 2px solid #9C27B0 !important;
    box-shadow: 0 0 15px rgba(156, 39, 176, 0.3) !important;
}

.worksheet-box .questions-section {
    border: 2px solid #FF9800 !important;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.3) !important;
}

/* Force all inner elements to have solid backgrounds */
.worksheet-box .key-point,
.worksheet-box .step-card,
.worksheet-box .question-item,
.worksheet-box #simulation-container {
    background: #333 !important;
    position: relative;
    z-index: 12;
}

/* Multiple Choice Question Styles */
.multiple-choice-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 15px 0;
    padding-left: 30px;
    position: relative;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #444;
    border: 2px solid #555;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.option-label:hover {
    background: #555 !important;
    border-color: var(--accent-color) !important;
    transform: translateX(5px);
}

.option-radio {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.option-text {
    color: #FFFFFF;
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

.option-label input[type="radio"]:checked + .option-text {
    color: var(--accent-color) !important;
    font-weight: bold;
}

.option-label input[type="radio"]:checked {
    accent-color: var(--accent-color);
}

.option-label:has(input[type="radio"]:checked) {
    background: #2a2a2a !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 10px rgba(74, 158, 255, 0.3);
}

/* Answer feedback styles */
.option-label.correct {
    background: linear-gradient(135deg, #1a3d1a 0%, #1a2f1a 100%) !important;
    border-color: #4CAF50 !important;
    border-width: 3px !important;
    color: #4CAF50 !important;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5), inset 0 0 10px rgba(76, 175, 80, 0.1);
    position: relative;
    animation: correctAnswerGlow 2s ease-in-out;
}

.option-label.correct::before {
    content: "✅";
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #4CAF50;
    animation: correctIconBounce 0.6s ease-in-out;
}

.option-label.correct .option-text {
    color: #4CAF50 !important;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.option-label.correct input[type="radio"] {
    accent-color: #4CAF50;
    transform: scale(1.2);
}

@keyframes correctAnswerGlow {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.5), inset 0 0 10px rgba(76, 175, 80, 0.1);
    }
    50% { 
        box-shadow: 0 0 25px rgba(76, 175, 80, 0.8), inset 0 0 15px rgba(76, 175, 80, 0.2);
    }
}

@keyframes correctIconBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(-50%) scale(1); }
    40% { transform: translateY(-50%) scale(1.3); }
    60% { transform: translateY(-50%) scale(1.1); }
}

.option-label.incorrect {
    background: linear-gradient(135deg, #3d1a1a 0%, #2a1818 100%) !important;
    border-color: #ff4444 !important;
    border-width: 3px !important;
    color: #ff4444 !important;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.5), inset 0 0 10px rgba(255, 68, 68, 0.1);
    position: relative;
    animation: wrongAnswerPulse 2s ease-in-out, wrongAnswerShake 0.5s ease-in-out 0.5s;
}

.option-label.incorrect::before {
    content: "❌";
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #ff4444;
    animation: wrongIconBounce 0.6s ease-in-out;
}

.option-label.incorrect .option-text {
    color: #ff4444 !important;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.3);
}

.option-label.incorrect input[type="radio"] {
    accent-color: #ff4444;
    transform: scale(1.2);
}

@keyframes wrongAnswerPulse {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(255, 68, 68, 0.5), inset 0 0 10px rgba(255, 68, 68, 0.1);
    }
    50% { 
        box-shadow: 0 0 25px rgba(255, 68, 68, 0.8), inset 0 0 15px rgba(255, 68, 68, 0.2);
    }
}

@keyframes wrongIconBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(-50%) scale(1); }
    40% { transform: translateY(-50%) scale(1.3); }
    60% { transform: translateY(-50%) scale(1.1); }
}

@keyframes wrongAnswerShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Disable interaction after submission */
.question-item.submitted .option-label {
    cursor: not-allowed;
    pointer-events: none;
}

.question-item.submitted .option-radio {
    cursor: not-allowed;
    pointer-events: none;
}

.answer-feedback {
    animation: slideDown 0.3s ease-out;
}

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

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    position: relative;
    z-index: 11;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
}

.nav-logo img {
    height: 40px;
    width: auto;
}

.nav-logo h1 {
    color: #FFFFFF;
    font-size: clamp(0.9rem, 1.2vw + 0.7rem, 1.3rem);
    font-weight: 600;
    margin: 0 0 0 18px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 15px 25px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #333333, #555555);
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.nav-link i {
    margin-right: 8px;
}

.nav-link:hover {
    background: linear-gradient(135deg, var(--accent-color), #3a8ce6);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--accent-shadow);
    border: 2px solid var(--accent-color);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--accent-color), #3a8ce6);
    color: #fff;
    font-weight: bold;
    box-shadow: 0 4px 15px var(--accent-shadow-heavy);
    border: 2px solid var(--accent-color);
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-logo h1 {
        font-size: 20px;
    }
    
    .nav-logo img {
        height: 30px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
    }
    
    .nav-item {
        flex: 1;
        min-width: 120px;
    }
    
    .nav-link {
        padding: 10px 15px;
        font-size: 14px;
        text-align: center;
    }
    
    .nav-link i {
        display: block;
        margin: 0 0 5px 0;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 10px;
    }
    
    .nav-logo img {
        height: 25px;
    }
    
    .nav-menu {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        padding: 12px;
        font-size: 12px;
    }
    
    .nav-link i {
        font-size: 14px;
    }
}

/* Offline Indicator */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ff5722;
  color: white;
  text-align: center;
  padding: 8px;
  z-index: 10000;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.offline .offline-indicator {
  transform: translateY(0);
}

/* PDF Opening Popup */
.pdf-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.5s ease;
    max-width: 350px;
    backdrop-filter: blur(10px);
}

.pdf-popup.show {
    opacity: 1;
    transform: translateX(0);
}

.pdf-popup-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pdf-popup-content i {
    font-size: 32px;
    color: var(--accent-color);
    flex-shrink: 0;
}

.pdf-popup-text h3 {
    color: #FFFFFF;
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: bold;
}

.pdf-popup-text p {
    color: #CCCCCC;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* Splash Screen */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

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

.splash-logo {
    width: 350px;
    height: auto;
    margin-bottom: 30px;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.loading-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 20px auto;
}

.loading-progress {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent-color), #3a8ce6);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.loading-text {
    color: #FFFFFF;
    font-size: 16px;
    margin-top: 20px;
    opacity: 0.8;
}

/* Main Content Layout */
.main-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 20px;
    background: rgba(45, 45, 45, 0.9);
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
    z-index: 5;
}

/* X/Hourglass pattern background for main content */
.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.03) 75%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 80px 80px;
    background-position: 0 0, 40px 40px;
    border-radius: 8px;
    pointer-events: none;
    z-index: -1;
}

/* Side Content */
.side-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 300px;
    margin: 0 20px;
}

/* X/Hourglass pattern for main container (worksheets page) */
.main-container {
    position: relative;
}

.main-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.03) 75%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 80px 80px;
    background-position: 0 0, 40px 40px;
    pointer-events: none;
    z-index: -1;
}

.side-header {
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 10px;
    border-bottom: 2px solid;
    margin-bottom: 15px;
}

.side-header.curriculum {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.side-header.documentation {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.cad-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    flex-shrink: 1;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.side-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #333333, #555555);
    border: 2px solid #666666;
    border-radius: 8px;
    color: #FFFFFF;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.side-button:hover {
    background: linear-gradient(135deg, var(--accent-color), #3a8ce6);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--accent-shadow);
    border: 2px solid var(--accent-color);
}

.side-button i {
    font-size: 24px;
    margin-bottom: 10px;
}

.button-text {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.side-button small {
    opacity: 0.7;
    font-size: 12px;
}

/* Center Content */
.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border-radius: 12px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 8px 25px var(--accent-shadow-light);
    max-width: 600px;
}

.center-title {
    color: #FFFFFF;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.center-subtitle {
    color: #CCCCCC;
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.curriculum-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    margin-top: 20px;
}

.curriculum-card {
    background: linear-gradient(135deg, #333333, #555555);
    border: 2px solid #666666;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.curriculum-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--accent-shadow);
  border: 2px solid var(--accent-color);
}

.curriculum-card i {
    font-size: 36px;
    margin-bottom: 15px;
    display: block;
    color: var(--accent-color);
}

.curriculum-card h3 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.curriculum-card p {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.4;
}

/* Worksheets Section */
.worksheets-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background: rgba(44, 48, 51, 0.85);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
}

.worksheets-section + .worksheets-section {
    margin-top: 60px; /* Add more space between sections */
}

.worksheets-header {
    color: #FFFFFF;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 30px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    position: relative;
    padding-bottom: 15px;
}

.worksheets-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--accent-color);
    opacity: 0.8;
}

.worksheets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.worksheet-card {
    background: linear-gradient(135deg, #333333, #444444);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.worksheet-card:hover {
    transform: translateY(-5px);
    background: linear-gradient(135deg, var(--accent-color), #3a8ce6);
    border-color: var(--accent-color);
    box-shadow: 0 8px 25px var(--accent-shadow-medium);
}

.worksheet-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
    opacity: 0.8;
}

/* Different colors for maintenance vs fault scenarios */
.worksheets-section:nth-child(1) .worksheet-card::before {
    background: var(--accent-color); /* Accent color for maintenance */
}

.worksheets-section:nth-child(2) .worksheet-card::before {
    background: var(--accent-color); /* Accent color for troubleshooting */
}

.worksheets-section:nth-child(2) .worksheet-card {
    background: linear-gradient(135deg, #333333, #444444);
}

.worksheets-section:nth-child(2) .worksheet-card:hover {
    background: linear-gradient(135deg, var(--accent-color), #3a8ce6);
}

.worksheet-title {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.worksheet-number {
    color: #FFFFFF;
    opacity: 0.7;
    font-size: 14px;
    margin-bottom: 5px;
}

.worksheet-description {
    color: #CCCCCC;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
    .worksheets-grid {
        grid-template-columns: 1fr;
    }
    
    .curriculum-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .side-content {
        width: 100%;
        margin: 0;
    }
}

/* Page Title */
.page-title { display: none !important; }
.page-title::before {
    content: none;
}
.page-title > * {
    position: relative;
    z-index: 1;
}

/* Scenario Popup Styles */
.scenario-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}

.scenario-content {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 30px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 2px solid #333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-button:hover {
    background: var(--accent-color);
    color: #000;
    transform: scale(1.1);
}

.scenario-content h2 {
    color: #FFFFFF;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.scenario-text {
    margin-bottom: 20px;
}

.scenario-text p {
    color: #CCCCCC;
    line-height: 1.6;
    margin-bottom: 15px;
}

.scenario-image {
    text-align: center;
    margin: 20px 0;
}

.scenario-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scenario-questions {
    margin-top: 30px;
}

.scenario-questions h3 {
    color: #FFFFFF;
    font-size: 20px;
    margin-bottom: 20px;
}

.question {
    margin-bottom: 20px;
}

.question label {
    display: block;
    color: #FFFFFF;
    font-weight: bold;
    margin-bottom: 10px;
}

.question textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #333;
    border-radius: 8px;
    background: #2d2d2d;
    color: #FFFFFF;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.question textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-shadow-medium);
}

.save-button {
    background: linear-gradient(135deg, var(--accent-color), #2d7dd2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.save-button:hover {
    background: linear-gradient(135deg, var(--accent-color), #3a8ce6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-shadow);
}

/* Scrollbar styling for scenario content */
.scenario-content::-webkit-scrollbar {
    width: 8px;
}

.scenario-content::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

.scenario-content::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

.scenario-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Inline Notification Styles */
.inline-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    max-width: 400px;
    border-left: 4px solid var(--accent-color);
    animation: slideInRight 0.3s ease-out;
}

.inline-notification.success {
    border-left-color: #4CAF50;
}

.inline-notification.error {
    border-left-color: #f44336;
}

.inline-notification.warning {
    border-left-color: #ff9800;
}

.inline-notification.info {
    border-left-color: var(--accent-color);
}

.inline-notification .notification-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.inline-notification .notification-message {
    font-size: 14px;
    line-height: 1.4;
}

.inline-notification .notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.inline-notification .notification-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.inline-notification.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

/* Field Error Styles */
.field-error {
    color: #f44336;
    font-size: 12px;
    margin-top: 5px;
    padding: 5px 10px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 4px;
    border-left: 3px solid #f44336;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.field-error.hidden {
    opacity: 0;
    pointer-events: none;
}

.main-content, .main-container, .worksheets-section, .center-content, .scenario-content {
    background: #23272b !important;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.main-content::before, .main-container::before {
    content: none !important;
}

/* Integrated Worksheet Header */
.worksheet-header {
  background: linear-gradient(135deg, #2a2a2a, #3a3a3a);
  border-radius: 12px 12px 0 0;
  border: 2px solid #444;
  border-bottom: none;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

.worksheet-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(45deg, rgba(255, 255, 255, 0.02) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.02) 75%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.02) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.02) 75%);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  pointer-events: none;
  z-index: 0;
}

.worksheet-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 30px;
  position: relative;
  z-index: 1;
}

.worksheet-header-left,
.worksheet-header-right {
  flex: 0 0 auto;
}

.worksheet-header-center {
  flex: 1;
  text-align: center;
  margin: 0 20px;
}

.worksheet-title {
  color: #FFFFFF;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.worksheet-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #2a2a2a, #404040) !important;
  color: #CCCCCC !important;
  border: 2px solid #555555 !important;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.worksheet-nav-btn:hover {
  background: linear-gradient(135deg, #404040, #555555) !important;
  border-color: #777777 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  color: #FFFFFF !important;
}

.worksheet-nav-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  background: linear-gradient(135deg, #1a1a1a, #333333);
}

.worksheet-nav-btn i {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.worksheet-back-btn:hover i {
  transform: translateX(-3px);
}

.worksheet-next-btn:hover i {
  transform: translateX(3px);
}

.worksheet-nav-btn span {
  font-weight: 600;
}

/* Update worksheet-box to connect with header */
.worksheet-box {
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  border-radius: 0 0 12px 12px;
  border: 2px solid #444;
  border-top: none;
  margin: 20px auto;
  max-width: 1400px;
  padding: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  position: relative;
}

.worksheet-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(45deg, rgba(255, 255, 255, 0.02) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.02) 75%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.02) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.02) 75%);
  background-size: 60px 52px;
  background-position: 0 0, 30px 26px;
  pointer-events: none;
  z-index: 0;
  border-radius: 0 0 12px 12px;
}

.worksheet-box > * {
  position: relative;
  z-index: 1;
}

/* Responsive design for worksheet header */
@media (max-width: 768px) {
  .worksheet-header-content {
    flex-direction: column;
    gap: 15px;
    padding: 15px 20px;
  }
  
  .worksheet-header-left,
  .worksheet-header-right {
    width: 100%;
  }
  
  .worksheet-header-center {
    margin: 0;
    order: -1;
  }
  
  .worksheet-title {
    font-size: 20px;
  }
  
  .worksheet-nav-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .worksheet-header-content {
    padding: 12px 15px;
  }
  
  .worksheet-title {
    font-size: 18px;
  }
  
  .worksheet-nav-btn {
    padding: 10px 15px;
    font-size: 12px;
  }
  
  .worksheet-nav-btn span {
    display: none;
  }
  
  .worksheet-nav-btn i {
    font-size: 18px;
  }
  
  /* Responsive system diagram images */
  .system-diagram img {
    width: 280px;
    height: 200px;
  }
}

@media (max-width: 768px) {
  .system-diagram img {
    width: 320px;
    height: 230px;
  }
}

/* 50/50 Column Layout for Background Section */
.background-section {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.background-text {
  flex: 0 0 50%;
}

.background-text .scenario-description {
  background: #333;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 0;
}

.background-text .scenario-description h3 {
  color: #4CAF50;
  margin-bottom: 15px;
}

.background-text .scenario-description p {
  color: #FFFFFF;
  margin-bottom: 15px;
  line-height: 1.6;
}

.background-image {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 500px;
}

.background-image img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
}

.background-image figcaption {
  text-align: center;
  font-size: 14px;
  color: #AAAAAA;
  font-style: italic;
}

/* Scenario Overview Styling */
.scenario-info {
  margin-bottom: 30px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.info-item {
  background: linear-gradient(135deg, #2a2a2a, #333333);
  border: 1px solid #444444;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  color: #CCCCCC;
}

.info-item strong {
  color: var(--accent-color);
  font-weight: 600;
}

/* Ensure these styles are applied to all fault scenarios */
.worksheet-section .scenario-info .info-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
  gap: 15px !important;
  margin-top: 15px !important;
}

.worksheet-section .scenario-info .info-item {
  background: linear-gradient(135deg, #2a2a2a, #333333) !important;
  border: 1px solid #444444 !important;
  border-radius: 8px !important;
  padding: 15px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  color: #CCCCCC !important;
}

.worksheet-section .scenario-info .info-item strong {
  color: var(--accent-color) !important;
  font-weight: 600 !important;
}

/* Status Grid - Responsive Grid Layout */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  background: #444;
  border-radius: 4px;
}

.status-label {
  color: #AAA;
  font-weight: bold;
}

.status-value {
  color: #FFFFFF;
  font-weight: bold;
}

.status-value.normal {
  color: #4CAF50;
}

.status-value.warning {
  color: #FF9800;
}

.status-value.error {
  color: #F44336;
}

/* Tools Grid Styling */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.tool-card {
  background: #333;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #2196F3;
}

.tool-card h4 {
  color: #2196F3;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-card p {
  color: #FFFFFF;
  margin-bottom: 15px;
}

.tool-btn {
  background: #2196F3;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.tool-btn:hover {
  background: #1976D2;
}

.tool-btn:disabled {
  background: #666;
  cursor: not-allowed;
}

/* System Overview Styling */
.system-overview {
  background: #333;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.system-overview h3 {
  color: #4CAF50;
  margin-bottom: 15px;
}

/* Investigation Results Styling */
.investigation-results {
  background: #333;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
  border-left: 4px solid var(--accent-color);
}

.investigation-results h3 {
  color: var(--accent-color);
  margin-bottom: 15px;
}

.result-item {
  background: #444;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 15px;
}

.result-item h4 {
  color: var(--accent-color);
  margin-bottom: 10px;
}

.result-item ul {
  color: #FFFFFF;
  margin-bottom: 10px;
}

.result-item li {
  margin-bottom: 5px;
}

.result-item p {
  color: #FFFFFF;
  margin-top: 10px;
  font-style: italic;
}

/* Responsive design for background section */
@media (max-width: 768px) {
  .background-section {
    flex-direction: column;
    gap: 20px;
  }
  
  .background-text,
  .background-image {
    flex: 1;
  }
  
  .background-image img {
    max-width: 100%;
    height: auto;
  }
}

/* Enhanced PID Simulation Styling */

/* Educational Introduction */
.pid-education {
    margin-bottom: 30px;
}

.education-card {
    background: linear-gradient(135deg, #2a2a2a, #3a3a3a);
    border-radius: 12px;
    padding: 25px;
    border: 2px solid #444;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.education-card h3 {
    color: var(--accent-color, #4a9eff);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.education-card p {
    color: #CCCCCC;
    line-height: 1.6;
    margin-bottom: 20px;
}

.pid-components {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.component {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color, #4a9eff);
}

.component h4 {
    color: var(--accent-color, #4a9eff);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.component p {
    color: #CCCCCC;
    font-size: 14px;
    margin: 0;
}

/* Parameter Display */
.parameter-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.parameter-card {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 2px solid #444;
    transition: all 0.3s ease;
}

.parameter-card:hover {
    border-color: var(--accent-color, #4a9eff);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.2);
}

.parameter-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #CCCCCC;
    font-size: 14px;
}

.parameter-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--accent-color, #4a9eff);
    margin-bottom: 5px;
}

.parameter-unit {
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
}

/* Enhanced PID Controls */
.pid-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.control-group {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #444;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.control-group:hover {
    border-color: var(--accent-color, #4a9eff);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.1);
}

.control-group label {
    color: #FFFFFF;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modern Slider Styling */
.slider-container {
    position: relative;
    margin-bottom: 15px;
    padding: 5px 0;
}

.modern-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.modern-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color, #4a9eff), #3a8ce6);
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.modern-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.5);
}

.modern-slider::-webkit-slider-thumb:active {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.6);
}

.modern-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color, #4a9eff), #3a8ce6);
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modern-slider::-moz-range-track {
    background: transparent;
    border: none;
}

.slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    background: #2a2a2a;
    border-radius: 4px;
    transform: translateY(-50%);
    pointer-events: none;
    border: 1px solid #444;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color, #4a9eff), #3a8ce6);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.1);
}

.control-group span {
    color: var(--accent-color, #4a9eff);
    font-weight: bold;
    font-size: 16px;
}

/* Enhanced Control Buttons */
.control-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-warning {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color, #4a9eff), #3a8ce6);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #666, #555);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #777, #666);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

/* Enhanced Chart Container */
.pid-chart-container {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #444;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    height: 500px;
    position: relative;
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #444;
}

.chart-header h4 {
    color: var(--accent-color, #4a9eff);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-legend {
    display: flex;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #CCCCCC;
    font-size: 14px;
}

.legend-color {
    width: 16px;
    height: 4px;
    border-radius: 2px;
}

.setpoint-color {
    background: #FF5722;
}

.process-color {
    background: #0066CC;
}

.error-color {
    background: #FFC107;
}

/* Enhanced Response Metrics */
.response-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.metric-card {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #444;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.metric-card:hover {
    border-color: var(--accent-color, #4a9eff);
    transform: translateY(-2px);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color, #4a9eff), #3a8ce6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.metric-content h4 {
    color: #FFFFFF;
    margin: 0 0 5px 0;
    font-size: 16px;
}

.metric-content p {
    color: var(--accent-color, #4a9eff);
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.metric-content small {
    color: #888;
    font-size: 12px;
}

/* Enhanced Tips Section */
.response-tips {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #444;
    margin-top: 25px;
}

.response-tips h4 {
    color: var(--accent-color, #4a9eff);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.tip-item {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color, #4a9eff);
    display: flex;
    gap: 15px;
}

.tip-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color, #4a9eff), #3a8ce6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.tip-content h5 {
    color: var(--accent-color, #4a9eff);
    margin: 0 0 10px 0;
    font-size: 16px;
}

.tip-content ul {
    color: #CCCCCC;
    padding-left: 20px;
    margin: 0;
}

.tip-content li {
    margin-bottom: 5px;
    font-size: 14px;
}

/* Enhanced Challenges */
.challenge-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.challenge-item {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border-radius: 12px;
    padding: 25px;
    border: 2px solid #444;
    transition: all 0.3s ease;
}

.challenge-item:hover {
    border-color: var(--accent-color, #4a9eff);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 158, 255, 0.2);
}

.challenge-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.challenge-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color, #4a9eff), #3a8ce6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.challenge-info h4 {
    color: #FFFFFF;
    margin: 0 0 8px 0;
    font-size: 18px;
}

.challenge-description {
    color: #CCCCCC;
    margin: 0;
    line-height: 1.5;
}

.challenge-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.challenge-params {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.challenge-params span {
    color: #CCCCCC;
    font-size: 14px;
}

.challenge-btn {
    background: linear-gradient(135deg, var(--accent-color, #4a9eff), #3a8ce6);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.challenge-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4);
}

/* Educational Note */
.educational-note {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
    border-radius: 12px;
    border: 2px solid rgba(255, 193, 7, 0.3);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.1);
}

.educational-note h5 {
    color: #FFC107;
    margin-bottom: 15px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.educational-note p {
    color: #CCCCCC;
    margin-bottom: 10px;
    line-height: 1.5;
}

.educational-note ul {
    margin: 10px 0;
    padding-left: 20px;
}

.educational-note li {
    color: #CCCCCC;
    margin-bottom: 8px;
    line-height: 1.4;
}

.educational-note strong {
    color: #FFC107;
}

.educational-note em {
    color: #888888;
    font-style: italic;
}

/* Error Info Dropdown */
.error-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
}

.error-info-header:hover {
    background: rgba(255, 193, 7, 0.1);
    border-radius: 8px;
    padding: 5px;
    margin: -5px;
}

.error-info-header h5 {
    margin: 0;
    cursor: pointer;
}

.error-info-header i {
    color: #FFC107;
    font-size: 14px;
    transition: transform 0.3s ease;
}

.error-info-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 15px;
}

.error-info-content.show {
    max-height: 500px;
}

/* PWA Install Button Styles */
.pwa-install-button {
    display: none; /* Hidden by default until browser confirms it can be installed */
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #4a9eff, #2d7cd1);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

.pwa-install-button:hover:not(.installed) {
    background: linear-gradient(135deg, #2d7cd1, #1a5a9e);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
}

.pwa-install-button.installed {
    background: linear-gradient(135deg, #45a845, #348834);
    cursor: default;
    opacity: 0.8;
}

.pwa-install-button i {
    font-size: 16px;
}

/* Fullscreen Exit Button */
.fullscreen-exit-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #4a9eff;
    color: #4a9eff;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: none;
}

.fullscreen-exit-btn:hover {
    background: rgba(74, 158, 255, 0.2);
    border-color: #3a8ce6;
    color: #ffffff;
    transform: scale(1.05);
}

.fullscreen-exit-btn i {
    margin-right: 8px;
}

/* Show exit button only in fullscreen mode */
@media screen and (display-mode: fullscreen) {
    .fullscreen-exit-btn {
        display: flex;
        align-items: center;
    }
    
    body {
        overflow-y: auto;
    }
    
    .main-container {
        overflow-y: auto;
    }
    
    .worksheet-box,
    .about-container {
        overflow-y: auto;
        height: auto;
    }
}

/* PWA Scrolling Fix - Ensure scrolling works in standalone and fullscreen modes */
@media screen and (display-mode: standalone), screen and (display-mode: fullscreen) {
    /* Ensure body allows scrolling */
    body {
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100vh;
    }
    
    /* Fix main container scrolling */
    .main-container {
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100vh;
    }
    
    /* Fix worksheet box scrolling */
    .worksheet-box {
        overflow-y: auto !important;
        height: auto !important;
        max-height: none !important;
        position: relative !important;
        min-height: calc(100vh - 100px);
        margin: 20px auto;
        padding: 20px;
    }
    
    /* Ensure worksheet content is scrollable */
    .worksheet-content {
        overflow-y: auto !important;
        height: auto !important;
    }
    
    /* Fix any fixed positioning issues */
    .worksheet-header {
        position: relative !important;
    }
    
    /* Ensure proper viewport height */
    html {
        height: auto !important;
        overflow-y: auto !important;
    }
    
    /* Additional fixes for all content containers */
    .worksheet-section {
        overflow-y: auto !important;
        height: auto !important;
    }
    
    .scenario-content {
        overflow-y: auto !important;
        height: auto !important;
    }
    
    .main-content {
        overflow-y: auto !important;
        height: auto !important;
    }
}

/* ======================================== */
/* MOBILE RESPONSIVE IMPLEMENTATION - STEP 1 */
/* ======================================== */

/* Mobile-First Responsive Design - Comprehensive Mobile Breakpoints */
@media (max-width: 768px) {
    /* Main container adjustments */
    .main-container {
        padding: 10px;
        margin: 0;
    }
    
    /* Worksheet box mobile optimization */
    .worksheet-box {
        margin: 10px;
        padding: 15px;
        border-radius: 8px;
    }
    
    /* Navigation mobile improvements */
    .nav-container {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .nav-link {
        padding: 10px 15px;
        font-size: 14px;
        min-width: 120px;
        text-align: center;
    }
    
    /* Content layout mobile adjustments */
    .main-content {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }
    
    .side-content {
        width: 100%;
        margin: 0;
    }
    
    .center-content {
        padding: 20px;
    }
    
    /* Grid layouts mobile */
    .curriculum-grid {
        grid-template-columns: 1fr;
    }
    
    .worksheets-grid {
        grid-template-columns: 1fr;
    }
    
    /* Two-column layouts to single column */
    .introduction-content-wrapper {
        flex-direction: column;
        gap: 20px;
    }
    
    .introduction-text,
    .introduction-image {
        flex: none;
        width: 100%;
    }
    
    /* System diagrams mobile */
    .system-diagram img {
        width: 100%;
        max-width: 300px;
        height: auto;
    }
    
    /* CAD models mobile */
    .cad-models {
        grid-template-columns: 1fr;
    }
    
    /* PID controls mobile */
    .pid-controls {
        grid-template-columns: 1fr;
    }
    
    /* Response metrics mobile */
    .response-metrics {
        grid-template-columns: 1fr;
    }
    
    /* Challenge list mobile */
    .challenge-list {
        grid-template-columns: 1fr;
    }
    
    /* Worksheet header mobile */
    .worksheet-header-content {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .worksheet-title {
        font-size: 18px;
        order: -1;
    }
    
    .worksheet-nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Key points grid mobile */
    .key-points-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Card headers mobile */
    .card-header {
        padding: 15px;
    }
    
    .card-header h3 {
        font-size: 16px;
    }
    
    .card-content {
        padding: 15px;
    }
    
    /* Key point items mobile */
    .key-point-item {
        padding: 15px;
    }
    
    .key-point-icon {
        margin-right: 15px;
    }
    
    .key-point-icon i {
        font-size: 20px;
    }
    
    /* Background section mobile */
    .background-section {
        flex-direction: column;
        gap: 20px;
    }
    
    .background-text,
    .background-image {
        width: 100%;
    }
    
    .background-image img {
        width: 100%;
        max-width: 300px;
        height: auto;
        margin: 0 auto;
        display: block;
    }
}

/* ======================================== */
/* MOBILE RESPONSIVE IMPLEMENTATION - STEP 2 */
/* ======================================== */

/* Small mobile devices - 480px and below */
@media (max-width: 480px) {
    .main-container {
        padding: 5px;
    }
    
    .worksheet-box {
        margin: 5px;
        padding: 10px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 100px;
    }
    
    .nav-logo h1 {
        font-size: 14px;
    }
    
    .nav-logo img {
        height: 30px;
    }
    
    .center-title {
        font-size: 24px;
    }
    
    .center-subtitle {
        font-size: 16px;
    }
    
    .worksheet-title {
        font-size: 16px;
    }
    
    .section-header {
        font-size: 18px;
    }
    
    /* Hide text on very small screens, show only icons */
    .nav-link span {
        display: none;
    }
    
    .worksheet-nav-btn span {
        display: none;
    }
    
    .worksheet-nav-btn i {
        font-size: 18px;
    }
    
    /* Reduce padding for very small screens */
    .main-content {
        padding: 10px;
    }
    
    .center-content {
        padding: 15px;
    }
    
    .worksheet-header-content {
        padding: 10px;
    }
    
    /* Smaller text for very small screens */
    .introduction-text p {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .card-content p {
        font-size: 14px;
    }
    
    .key-point-content p {
        font-size: 14px;
    }
    
    /* Adjust grid gaps for small screens */
    .curriculum-grid {
        gap: 15px;
    }
    
    .worksheets-grid {
        gap: 15px;
    }
    
    .key-points-grid {
        gap: 10px;
    }
    
    /* Smaller buttons for small screens */
    .side-button {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .worksheet-nav-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    /* Adjust card padding for small screens */
    .card-header {
        padding: 12px;
    }
    
    .card-content {
        padding: 12px;
    }
    
    .key-point-item {
        padding: 12px;
    }
    
    /* Smaller images for very small screens */
    .system-diagram img {
        max-width: 250px;
    }
    
    .background-image img {
        max-width: 250px;
    }
    
    .cad-model img {
        max-width: 250px;
    }
}

/* ======================================== */
/* MOBILE RESPONSIVE IMPLEMENTATION - STEP 3 */
/* ======================================== */

/* Touch-friendly improvements for mobile devices */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets for better mobile interaction */
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .worksheet-nav-btn {
        min-height: 44px;
    }
    
    .side-button {
        min-height: 60px;
    }
    
    .curriculum-card {
        min-height: 120px;
    }
    
    .worksheet-card {
        min-height: 100px;
    }
    
    /* Increase spacing for touch interaction */
    .nav-menu {
        gap: 8px;
    }
    
    .button-container {
        gap: 20px;
    }
    
    .curriculum-grid {
        gap: 25px;
    }
    
    .worksheets-grid {
        gap: 25px;
    }
    
    .key-points-grid {
        gap: 20px;
    }
    
    /* Larger touch targets for interactive elements */
    .step-checkbox {
        min-height: 44px;
        min-width: 44px;
    }
    
    .option-label {
        min-height: 44px;
        padding: 12px 15px;
    }
    
    .control-btn {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    .challenge-btn {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    .submit-question-btn {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    /* Improve slider touch interaction */
    .modern-slider {
        height: 20px;
    }
    
    .modern-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    .modern-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }
    
    /* Better touch feedback */
    .nav-link:active,
    .worksheet-nav-btn:active,
    .side-button:active,
    .control-btn:active,
    .challenge-btn:active,
    .submit-question-btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    /* Improve form input touch targets */
    .answer-input {
        min-height: 44px;
        padding: 12px 15px;
    }
    
    .question textarea {
        min-height: 80px;
        padding: 12px 15px;
    }
    
    /* Better touch targets for close buttons */
    .close-button {
        min-height: 44px;
        min-width: 44px;
        padding: 12px;
    }
    
    /* Improve popup touch interaction */
    .scenario-popup {
        padding: 20px;
    }
    
    .scenario-content {
        padding: 20px;
    }
    
    /* Better touch targets for navigation */
    .worksheet-navigation .nav-btn {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    /* Improve card touch interaction */
    .curriculum-card,
    .worksheet-card,
    .key-point-item {
        cursor: pointer;
        transition: transform 0.2s ease;
    }
    
    .curriculum-card:active,
    .worksheet-card:active,
    .key-point-item:active {
        transform: scale(0.98);
    }
}

/* ======================================== */
/* MOBILE RESPONSIVE IMPLEMENTATION - STEP 4 */
/* ======================================== */

/* Landscape orientation fixes for mobile devices */
@media (max-width: 768px) and (orientation: landscape) {
    .main-container {
        padding: 5px;
    }
    
    .worksheet-box {
        margin: 5px;
        padding: 10px;
    }
    
    .nav-container {
        flex-direction: row;
        gap: 5px;
    }
    
    .nav-logo h1 {
        font-size: 14px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Optimize content for landscape */
    .main-content {
        flex-direction: row;
        gap: 15px;
        padding: 10px;
    }
    
    .side-content {
        width: 30%;
        margin: 0;
    }
    
    .center-content {
        width: 70%;
        padding: 15px;
    }
    
    /* Adjust grids for landscape */
    .curriculum-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .worksheets-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Optimize worksheet layout for landscape */
    .worksheet-header-content {
        flex-direction: row;
        gap: 10px;
        padding: 10px;
    }
    
    .worksheet-title {
        font-size: 16px;
        order: 0;
    }
    
    .worksheet-nav-btn {
        width: auto;
        padding: 8px 15px;
    }
    
    /* Adjust text sizes for landscape */
    .center-title {
        font-size: 20px;
    }
    
    .center-subtitle {
        font-size: 14px;
    }
    
    .section-header {
        font-size: 16px;
    }
    
    /* Optimize images for landscape */
    .system-diagram img {
        max-width: 200px;
    }
    
    .background-image img {
        max-width: 200px;
    }
    
    .cad-model img {
        max-width: 200px;
    }
    
    /* Adjust card layouts for landscape */
    .key-points-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .card-header {
        padding: 10px;
    }
    
    .card-content {
        padding: 10px;
    }
    
    .key-point-item {
        padding: 10px;
    }
    
    /* Optimize introduction layout for landscape */
    .introduction-content-wrapper {
        flex-direction: row;
        gap: 15px;
    }
    
    .introduction-text {
        width: 60%;
    }
    
    .introduction-image {
        width: 40%;
    }
    
    /* Adjust background section for landscape */
    .background-section {
        flex-direction: row;
        gap: 15px;
    }
    
    .background-text {
        width: 60%;
    }
    
    .background-image {
        width: 40%;
    }
    
    /* Optimize PID controls for landscape */
    .pid-controls {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .response-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .challenge-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Adjust button sizes for landscape */
    .side-button {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .worksheet-nav-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Optimize navigation for landscape */
    .nav-menu {
        gap: 5px;
    }
    
    .nav-link {
        padding: 6px 10px;
        font-size: 11px;
        min-width: 80px;
    }
    
    /* Hide some text in landscape to save space */
    .nav-link span {
        display: none;
    }
    
    .worksheet-nav-btn span {
        display: none;
    }
    
    .side-button small {
        display: none;
    }
}