/* --- General Body & Layout --- */
/* --- New Color Variables --- */
:root {
  --purple-dark: #352253;
  --purple-medium: #85279E;
  --purple-light: #D42BE9;
  --purple-accent: #F64BCC;
  
  --orange-dark: #E54A42;
  --orange-medium: #FB8825;
  --orange-light: #FDAC13;
  --orange-accent: #FFD000;
  
  --text-primary: #374151; /* Keeping a dark gray for body text for readability */
  --text-secondary: #fff;
  --background-light: #f9fafb;
  --border-light: #e5e7eb;
}
@font-face {
    font-family: 'Nunito Sans';
    src: url('https://static.igem.wiki/teams/5775/fonts/nunitosans.ttf') format('truetype');
    font-weight: 200 1000; /* Full weight range */
}
@font-face {
    font-family: 'Nunito Sans';
    src: url('https://static.igem.wiki/teams/5775/fonts/nunitosans-italic.ttf') format('truetype');
    font-weight: 200 1000;
    font-style: italic; /* Italic style */
}

body {
    font-family: 'Nunito Sans', sans-serif;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.flex.h-screen {
    display: flex;
    height: 100vh;
}

#sidebar {
    flex-shrink: 0;
    background-color: var(--purple-dark);
}

#main-content {
    flex-grow: 1;
}

/* --- Sidebar Styling --- */
.sidebar-link {
    transition: all 0.3s ease;
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: var(--purple-medium);
    color: var(--orange-accent);
    transform: translateX(5px);
}

/* --- Module Content Styling --- */
.module-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--purple-dark);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--purple-medium);
    padding-bottom: 0.5rem;
}

.module-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--purple-medium);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.module-content > h4, .module-content .styled-h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--purple-dark);
    background-color: rgba(212, 43, 233, 0.1); /* D42BE9 with alpha */
    padding: 0.4rem 0.8rem;
    border-radius: 0.375rem;
    display: inline-block;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--purple-light);
}

.module-content p, .module-content ul, .module-content ol, .module-content table {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.module-content ul, .module-content ol {
    margin-left: 1.5rem;
}

.module-content ol.list-decimal {
    list-style-type: decimal;
}

.module-content .formula {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.1em;
    color: var(--purple-dark);
    background-color: #f0f4ff; /* A light, neutral background */
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--purple-light);
    display: inline-block;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

/* --- Interactive Boxes & Practice Problems --- */
.interactive-box, .practice-problem-box {
    background-color: rgba(246, 75, 204, 0.1); /* F64BCC with alpha */
    border: 1px solid var(--purple-light);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.interactive-box h4, .practice-problem-box h4 {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: var(--purple-dark) !important;
    background-color: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    display: block !important;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
    border-left: none !important;
}

/* --- Quiz Styling --- */
.quiz-question {
    background-color: var(--background-light);
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.quiz-option {
    display: block;
    width: 100%;
    background-color: #fff;
    border: 1px solid var(--border-light);
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.quiz-option:hover {
    border-color: var(--orange-medium);
    background-color: rgba(255, 208, 0, 0.1); /* FFD000 with alpha */
}

.quiz-option.correct, .practice-problem-box .correct-answer {
    background-color: rgba(34, 197, 94, 0.2) !important; /* Green background */
    border-color: #16a34a !important; /* Green border */
    color: #15803d !important; /* Dark green text */
}

.quiz-option.incorrect, .practice-problem-box .incorrect-answer {
    background-color: rgba(229, 74, 66, 0.2) !important; /* Red background */
    border-color: #E54A42 !important; /* Red border */
    color: #dc2626 !important; /* Dark red text */
}

.feedback-message, .practice-feedback {
    margin-top: 0.5rem;
    font-weight: 500;
}

/* --- Calculator & Input Styling --- */
.calculator input, .calculator select, .practice-problem-box input {
    border: 1px solid var(--border-light);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
}

.calculator button, .practice-problem-box button {
    background-color: var(--orange-medium);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.calculator button:hover, .practice-problem-box button:hover {
    background-color: var(--orange-dark);
}

/* --- Helper Component Styling --- */
.solution-details {
    font-size: 0.9rem;
    color: var(--text-primary);
    background-color: var(--background-light);
    border-left: 3px solid var(--orange-medium);
    padding: 0.75rem;
    margin-top: 0.75rem;
    border-radius: 0.25rem;
}

.plasmid-info-box, .media-component-info-box {
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.media-component-button {
    background-color: var(--purple-light);
    border: 1px solid var(--purple-medium);
}

.media-component-button:hover {
    background-color: var(--purple-medium);
}

.media-component-button.selected {
    background-color: var(--purple-dark);
    color: var(--text-secondary);
    font-weight: bold;
}

.highlight-note {
    background-color: rgba(255, 208, 0, 0.1); /* FFD000 with alpha */
    border-left: 4px solid var(--orange-accent);
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

.highlight-note p {
    margin-bottom: 0 !important;
}

.goal-box {
    background-color: rgba(212, 43, 233, 0.1); /* D42BE9 with alpha */
    border: 1px solid var(--purple-light);
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 120px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.goal-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.goal-box strong {
    color: var(--purple-dark);
    font-size: 1.05em;
    margin-bottom: 0.5rem;
}


/* === APPENDED STYLES FOR REFACTOR === */
.module-section { 
    margin-top: 1.25rem; 
    padding: 1rem; 
    background: #fff; 
    border: 1px solid var(--border-light); 
    border-radius: 0.75rem; 
}

.wip {
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem;
  border: 1px dashed rgba(0,0,0,0.12);
  border-radius: 12px;
  background: rgba(0,0,0,0.02);
}
.wip-title { font-weight: 600; color: var(--purple-dark); }
.progress { height: 8px; width: 100%; background: rgba(0,0,0,0.07); border-radius: 999px; overflow: hidden; }
.progress .bar { height: 100%; width: 32%; background: linear-gradient(90deg, var(--orange-accent), var(--orange-light)); animation: wipPulse 1.8s infinite ease-in-out; }
@keyframes wipPulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.2); } }

/* Clickable title styling */
#sidebar h1 {
    transition: all 0.3s ease;
}

#sidebar h1:hover, #sidebar h1.active-title {
    color: var(--orange-accent) !important;
    transform: translateX(3px);
}

/* Mobile Responsive Styles - Add this to your style.css */

/* Mobile sidebar styling */
@media (max-width: 768px) {
    .flex.h-screen {
        flex-direction: column;
    }
    
    #sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 80%;
        max-width: 320px;
        z-index: 40;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    #sidebar.mobile-open {
        left: 0;
    }
    
    #main-content {
        width: 100%;
        margin-left: 0;
        padding-top: 4rem; /* Space for mobile menu button */
    }
}

/* Mobile overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 30;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile menu button */
#mobile-menu-btn {
    display: block;
}

@media (min-width: 768px) {
    #mobile-menu-btn {
        display: none !important;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
}

/* Improve mobile text readability */
@media (max-width: 768px) {
    .module-content h2 {
        font-size: 1.5rem;
    }
    
    .module-content h3 {
        font-size: 1.2rem;
    }
    
    .module-content p, 
    .module-content ul, 
    .module-content ol {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .interactive-box, 
    .practice-problem-box {
        padding: 1rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
    
    .quiz-question {
        padding: 1rem;
    }
    
    .quiz-option {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    /* Make logos stack on very small screens */
    @media (max-width: 480px) {
        .flex.justify-center.items-center.gap-8 {
            flex-direction: column;
            gap: 1rem;
        }
    }
}

/* Clickable title styling */
#sidebar h1 {
    transition: all 0.3s ease;
}

#sidebar h1:hover, #sidebar h1.active-title {
    color: var(--orange-accent) !important;
    transform: translateX(3px);
}

/* Transfection Methods Interactive Styling */
.transfection-methods {
    margin: 1.5rem 0;
    display: grid;
    gap: 1rem;
}

.transfection-method-category {
    background: white;
    border: 2px solid var(--purple-light);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.transfection-method-category:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: var(--orange-medium);
}

.category-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(133, 39, 158, 0.1), rgba(212, 43, 233, 0.1));
    transition: background-color 0.3s ease;
}

.category-header:hover {
    background: linear-gradient(135deg, rgba(133, 39, 158, 0.15), rgba(212, 43, 233, 0.15));
}

.category-title {
    flex-grow: 1;
    color: var(--purple-dark);
    font-size: 1.1rem;
}

.category-indicator {
    color: var(--orange-medium);
    font-weight: bold;
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.transfection-method-category.expanded .category-indicator {
    transform: rotate(45deg);
}

.category-details {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
    line-height: 1.6;
}

.subcategory-grid {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.subcategory-item {
    background: linear-gradient(135deg, rgba(246, 75, 204, 0.06), rgba(255, 208, 0, 0.06));
    border: 1px solid var(--orange-light);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.subcategory-item:hover {
    border-color: var(--orange-medium);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.subcategory-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: rgba(255, 208, 0, 0.1);
    transition: background-color 0.3s ease;
}

.subcategory-header:hover {
    background: rgba(255, 208, 0, 0.15);
}

.subcategory-title {
    flex-grow: 1;
    font-weight: 600;
    color: var(--purple-dark);
    font-size: 0.95rem;
}

.subcategory-indicator {
    background: var(--orange-medium);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.subcategory-details {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .category-header {
        padding: 0.75rem 1rem;
    }
    
    .category-details {
        padding: 1rem;
    }
    
    .subcategory-header {
        padding: 0.6rem 0.8rem;
    }
    
    .subcategory-details {
        padding: 0.6rem 0.8rem;
    }
}

/* Orange highlight notes for module 09 */
.orange-highlight-note {
    background: linear-gradient(135deg, rgba(251, 136, 37, 0.1), rgba(253, 172, 19, 0.1));
    border-left: 4px solid var(--orange-medium);
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

.orange-highlight-note h4 {
    color: var(--orange-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.orange-highlight-note p {
    margin-bottom: 0.5rem !important;
    color: var(--text-primary);
}

.orange-highlight-note ul {
    margin-bottom: 0.5rem !important;
}

/* Q&A styling */
.qa-item {
    background: linear-gradient(135deg, rgba(212, 43, 233, 0.08), rgba(255, 208, 0, 0.08));
    border: 1px solid var(--orange-light);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.qa-item:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transform: translateY(-1px);
    border-color: var(--orange-medium);
}

.qa-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background: rgba(255, 208, 0, 0.1);
    transition: background-color 0.3s ease;
}

.qa-header:hover {
    background: rgba(255, 208, 0, 0.15);
}

.qa-question {
    flex-grow: 1;
    color: var(--purple-dark);
    font-size: 1rem;
}

.qa-toggle {
    color: var(--orange-medium);
    font-weight: bold;
    font-size: 1.3rem;
    transition: transform 0.3s ease;
    margin-left: 1rem;
}

.qa-item.expanded .qa-toggle {
    transform: rotate(45deg);
}

.qa-answer {
    padding: 0.75rem 1.25rem 1rem 1.25rem;
    color: var(--text-primary);
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.8);
}

/* Responsive adjustments for Q&A */
@media (max-width: 768px) {
    .qa-header {
        padding: 0.75rem 1rem;
    }
    
    .qa-answer {
        padding: 0.75rem 1rem 1rem 1rem;
    }
}

/* Golden Gate features styling */
        .golden-gate-features {
            margin: 1.5rem 0;
        }

        .golden-gate-features h5 {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--purple-dark);
            margin-bottom: 0.75rem;
        }

        .golden-gate-features ul {
            list-style: none;
            padding-left: 0;
        }

        .golden-gate-features li {
            margin-bottom: 0.5rem;
            padding-left: 1rem;
            position: relative;
        }

/* Prevent horizontal overflow on mobile */
@media (max-width: 768px) {
    /* Prevent body overflow */
    body {
        overflow-x: hidden;
    }
    
    #main-content {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Make tables responsive */
    .module-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Alternatively, make table cells wrap on very small screens */
    @media (max-width: 480px) {
        .module-content table {
            font-size: 0.85rem;
        }
        
        .module-content table td,
        .module-content table th {
            padding: 0.4rem;
            word-wrap: break-word;
            white-space: normal;
        }
    }
    
    /* Make images responsive */
    .module-content img {
        max-width: 100% !important;
        height: auto !important;
        width: auto !important;
    }
    
    /* Make iframes responsive */
    .module-content iframe {
        max-width: 100%;
    }
    
    /* Prevent long links from overflowing */
    .module-content a {
        word-wrap: break-word;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    /* Ensure all containers respect viewport width */
    .module-content > * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Make pre/code blocks scrollable instead of overflowing */
    .module-content pre,
    .module-content code {
        max-width: 100%;
        overflow-x: auto;
        word-wrap: normal;
        white-space: pre;
    }
    
    /* Fix interactive boxes on mobile */
    .interactive-box,
    .practice-problem-box {
        max-width: 100%;
        overflow-x: auto;
    }
    
    /* Make input fields fit on mobile */
    .calculator input,
    .calculator select,
    .practice-problem-box input {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Ensure formulas don't overflow */
    .module-content .formula {
        max-width: 100%;
        overflow-x: auto;
        display: block;
    }
}

/* Fix endless scrolling in modules on mobile */
@media (max-width: 768px) {
    .module-section {
        overflow: hidden;
        display: block;
        height: fit-content;
    }
    
    .module-content {
        overflow: visible;
        padding-bottom: 2rem; /* Add some bottom padding */
    }
    
    /* Ensure quiz container doesn't cause overflow */
    [id^="quiz-container-"] {
        margin-bottom: 2rem;
        overflow: visible;
    }
}
