/* Naive Bayes Tutorial - Main Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* Header Styles */
.page-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 60px;
}

.page-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
}

.breadcrumb {
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    color: white;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* learning-objectives hidden to preserve space for tabs */
.learning-objectives { display: none; }

.learning-objectives h3 {
    color: #fff;
    margin-bottom: 1rem;
    text-align: center;
}

.learning-objectives ul {
    list-style: none;
    padding: 0;
}

.learning-objectives li {
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    border-left: 4px solid #4ecdc4;
}

/* Tabs Container */
.tabs-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.tabs-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    overflow-x: auto;
}

.tab-button {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 150px;
}

.tab-button:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-button.active {
    background: #667eea;
    color: white;
    border-bottom: 3px solid #4ecdc4;
}

/* Tab Content */
.tab-content {
    min-height: 600px;
}

.tab-pane {
    display: none;
    padding: 2rem;
}

.tab-pane.active {
    display: block;
}

.tab-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.tab-header h2 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.tab-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Formula Section */
.formula-section h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.formula-box {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    text-align: center;
}

.formula-main {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-align: center;
}

/* MathJax styling */
.MathJax {
    font-size: 1.1em !important;
}

.MathJax_Display {
    margin: 1em 0 !important;
}

/* Removed interactive math terms styling */

/* Naive Bayes Network Section */
.network-section h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

#naive-bayes-network {
    height: 400px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #ddd;
    padding: 8px;
    color: #666;
    overflow: visible;
    margin-bottom: 1rem;
}

.network-caption {
    background: #e8f4fd;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-size: 14px;
    color: #333;
}

.explanation-section h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.assumption-box {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    text-align: center;
}

.assumption-text {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border-left: 4px solid #4ecdc4;
}

.assumption-text p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.pros, .cons {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pros h4 {
    color: #4ecdc4;
    margin-bottom: 1rem;
}

.cons h4 {
    color: #ff6b6b;
    margin-bottom: 1rem;
}

.pros ul, .cons ul {
    list-style: none;
    padding: 0;
}

.pros li, .cons li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.pros li:last-child, .cons li:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .pros-cons {
        grid-template-columns: 1fr;
    }
}

.fraction {
    display: inline-block;
    vertical-align: middle;
}

.numerator {
    display: block;
    border-bottom: 2px solid white;
    padding-bottom: 0.2rem;
    margin-bottom: 0.2rem;
}

.denominator {
    display: block;
}

.formula-components {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.component {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.component h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.component p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Visualization Section */
.visualization-section h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.calculator {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.input-group label {
    font-weight: 500;
    color: #333;
    min-width: 120px;
}

.input-group input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.input-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.input-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.input-group span {
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
    text-align: center;
}

.result-box {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    margin-top: 1rem;
}

.result-box h4 {
    font-size: 1.3rem;
    margin: 0;
}

#bayes-diagram {
    height: 400px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #ddd;
    padding: 8px;
    color: #666;
    overflow: visible;
}

/* Small tables next to nodes */
.bn-table {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    font-size: 12px;
}
.bn-table table { border-collapse: collapse; }
.bn-table th, .bn-table td {
    border: 1px solid #e6e6e6;
    padding: 4px 6px;
    text-align: center;
}
.bn-table th { background: #f3f4f6; color: #333; }
.bn-table .thick { border-right: 2px solid #999; }

/* Example Section */
.example-section {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    margin-top: 2rem;
}

.example-section h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.example-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .example-content {
        grid-template-columns: 1fr;
    }
}

.example-text ul {
    list-style: none;
    padding: 0;
}

.example-text li {
    background: white;
    margin: 0.5rem 0;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #4ecdc4;
}

.calculation-step {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 1rem;
    border: 2px solid #667eea;
}

.interpretation {
    background: #e8f5e8;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    color: #2d5a2d;
    border-left: 4px solid #4caf50;
}

/* Coming Soon */
.coming-soon {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.coming-soon h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 2rem;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Mushroom Tab Styles */
.mushroom-overview-section,
.mushroom-safety-section,
.mushroom-code-section {
    width: 100%;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mushroom-network-section {
    margin: 20px 0;
    text-align: center;
}

#mushroom-naive-bayes-network {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.safety-description {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 16px;
    line-height: 1.5;
    font-style: italic;
}

.safety-checker {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.checker-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 {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.control-group select {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.control-group select:focus {
    outline: none;
    border-color: #28a745;
}

.safety-check-btn {
    grid-column: 1 / -1;
    padding: 15px 30px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.safety-check-btn:hover {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.safety-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.safety-result.safe {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 2px solid #c3e6cb;
}

.safety-result.poisonous {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.safety-result.unknown {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border: 2px solid #ffeaa7;
}

.safety-confidence {
    font-size: 14px;
    margin-top: 10px;
    opacity: 0.8;
}

/* BBC News Tab Styles */
.bbc-overview-section,
.bbc-code-section {
    width: 100%;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bbc-network-section {
    margin: 20px 0;
    text-align: center;
}

#bbc-naive-bayes-network {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.feature-explorer {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.explorer-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.explorer-controls label {
    font-weight: 600;
    color: #2c3e50;
}

.explorer-controls select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.explorer-controls select:focus {
    outline: none;
    border-color: #667eea;
}

.refresh-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-1px);
}

#top-features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.feature-item {
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.feature-word {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.feature-score {
    color: #6c757d;
    font-size: 12px;
    margin-top: 4px;
}

.feature-category {
    display: inline-block;
    padding: 2px 8px;
    background: #667eea;
    color: white;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    margin-top: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .tabs-nav {
        flex-direction: column;
    }
    
    .tab-button {
        min-width: auto;
    }
    
    .formula-main {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .input-group label {
        min-width: auto;
    }
}

/* Animation */
.tab-pane {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* D3.js specific styles */
.node {
    cursor: pointer;
}

.node circle {
    fill: #667eea;
    stroke: #fff;
    stroke-width: 2px;
}

.node text {
    font: 12px sans-serif;
    fill: #333;
}

.link {
    fill: none;
    stroke: #999;
    stroke-width: 2px;
}

.link:hover {
    stroke: #667eea;
    stroke-width: 3px;
}

/* Dataset Section */
.dataset-section, .text-analysis-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.dataset-info {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
}

.dataset-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.dataset-info li {
    margin: 5px 0;
    font-size: 14px;
}

/* Code Section */
.code-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.code-block {
    background: white;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #6f42c1;
}

.code-block h4 {
    margin: 0 0 10px 0;
    color: #6f42c1;
    font-size: 16px;
}

.code-block pre {
    margin: 0;
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.4;
}

/* Feature Distributions */
.feature-distributions {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

/* Word Analysis */
.word-analysis {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Variants Section */
.variants-comparison {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.variants-demos {
    margin-top: 30px;
}

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

.demo-item {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.demo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.demo-item h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.demo-item p {
    margin: 0 0 15px 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.6;
}

.variant-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.info-item {
    margin-bottom: 8px;
    font-size: 14px;
    color: #495057;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item strong {
    color: #2c3e50;
    font-weight: 600;
}

.code-example {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.code-example h5 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
}

.code-example pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    border: 1px solid #4a5568;
}

.code-example code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
    border-radius: 0;
}


/* Formula Derivation */
.formula-derivation {
    margin-top: 30px;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

.formula-derivation h4 {
    margin: 0 0 25px 0;
    color: #2c3e50;
    font-size: 20px;
    text-align: center;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.derivation-step {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 5px solid #667eea;
}

.derivation-step h5 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: bold;
}

.formula-box {
    background: white;
    padding: 25px;
    border-radius: 6px;
    border: 2px solid #e9ecef;
    text-align: center;
    margin: 15px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.formula-box .MathJax {
    color: #2c3e50 !important;
    font-size: 18px !important;
    font-weight: bold !important;
}

.step-explanation {
    margin: 10px 0 0 0;
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
    font-style: italic;
}

.derivation-arrow {
    text-align: center;
    margin: 20px 0;
    color: #667eea;
}

.derivation-arrow span:first-child {
    font-size: 36px;
    font-weight: bold;
    display: block;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.arrow-note {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    color: #495057;
    font-style: italic;
    font-weight: 500;
}

/* Iris Dataset Sections */
.iris-overview-section, .iris-code-section {
    margin: 30px 0;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

.iris-overview-section h3, .iris-code-section h3 {
    margin: 0 0 25px 0;
    color: #2c3e50;
    font-size: 24px;
    text-align: center;
    border-bottom: 3px solid #e74c3c;
    padding-bottom: 10px;
}

.iris-network-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.iris-network-section h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
}

#iris-naive-bayes-network {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.feature-mapping-table {
    margin-top: 30px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.feature-mapping-table h5 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    text-align: center;
}

.feature-mapping-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.feature-mapping-table th,
.feature-mapping-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.feature-mapping-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

.feature-mapping-table td:first-child {
    font-weight: bold;
    color: #e74c3c;
    text-align: center;
}

.code-block-full {
    margin: 25px 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0;
    border-left: 5px solid #28a745;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #28a745;
    padding: 15px 20px;
    margin: 0;
}

.code-header h4 {
    margin: 0;
    color: white;
    font-size: 18px;
}

.code-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.copy-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.download-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.download-btn:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.action-btn:active {
    transform: translateY(0);
}

.code-block-full pre {
    margin: 0;
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 0 0 6px 6px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#iris-code-content {
    padding: 20px;
}

.code-block-full code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
}

.code-description {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 16px;
    line-height: 1.5;
    font-style: italic;
}

.loading-code {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

.error-loading {
    text-align: center;
    padding: 40px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin: 20px 0;
}

/* Mobile Responsive Updates */
@media (max-width: 768px) {
    .demo-grid {
        grid-template-columns: 1fr;
    }
    
    .dist-grid {
        grid-template-columns: 1fr;
    }
    
    .iris-overview-section, .iris-code-section {
        padding: 20px;
    }
    
    .feature-mapping-table {
        overflow-x: auto;
    }
    
    .code-block-full pre {
        font-size: 12px;
        padding: 15px;
    }
    
    .explorer-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .explorer-controls select,
    .refresh-btn {
        width: 100%;
    }
    
    #top-features-list {
        grid-template-columns: 1fr;
    }
    
    .checker-controls {
        grid-template-columns: 1fr;
    }
    
    .safety-check-btn {
        grid-column: 1;
    }
}

/* Code Implementation Container Styles */
.code-implementation-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.code-impl-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.code-impl-tab-btn {
    background: transparent;
    border: none;
    color: #6c757d;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
    flex: 1;
    justify-content: center;
}

.code-impl-tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.code-impl-tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom-color: #667eea;
    box-shadow: 0 -2px 8px rgba(102, 126, 234, 0.1);
}

.code-impl-tab-content {
    display: none;
    padding: 0;
}

.code-impl-tab-content.active {
    display: block;
}

/* Colab Content Styles */
.colab-content {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.colab-header {
    text-align: center;
    margin-bottom: 25px;
}

.colab-header h5 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.colab-header p {
    color: #6c757d;
    font-size: 1rem;
}

.colab-notebook {
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notebook-cell {
    border-bottom: 1px solid #e9ecef;
}

.notebook-cell:last-child {
    border-bottom: none;
}

.cell-header {
    background: #f8f9fa;
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cell-type {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.cell-title {
    color: #495057;
    font-weight: 600;
    font-size: 14px;
}

.cell-content {
    padding: 16px;
}

.cell-content pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.cell-content code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.output-text {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.output-text p {
    margin: 4px 0;
    color: #28a745;
}

.colab-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.colab-btn, .github-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.colab-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.colab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(240, 147, 251, 0.4);
    color: white;
}

.github-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.github-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    color: white;
}

.colab-features {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.colab-features h6 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.colab-features ul {
    list-style: none;
    padding: 0;
}

.colab-features li {
    padding: 6px 0;
    color: #6c757d;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive Design for Code Implementation Tabs */
@media (max-width: 768px) {
    .code-impl-tabs {
        flex-direction: column;
    }
    
    .code-impl-tab-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    
    .colab-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .colab-btn, .github-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .cell-content pre {
        font-size: 12px;
        padding: 12px;
    }
    
    .demo-grid {
        grid-template-columns: 1fr;
    }
    
    .demo-item {
        padding: 20px;
    }
    
    .variant-info {
        padding: 12px;
    }
    
    .code-example pre {
        font-size: 12px;
        padding: 12px;
    }
}
