/* ============================================
   Educational Web Application - Unified Styles
   Reusable component library for educational interfaces
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

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

/* Main Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Typography */
h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5em;
    font-weight: 600;
}

h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2em;
    font-weight: 600;
}

h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
}

h4 {
    color: #34495e;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.2em;
    margin-bottom: 30px;
    font-style: italic;
}

/* Universal Button Styles */
button,
.btn,
.primary-btn,
.secondary-btn,
.action-btn {
    display: inline-block;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
    text-align: center;
    min-width: 120px;
    white-space: nowrap;
    overflow: visible;
    height: 44px;
    line-height: 20px;
    box-sizing: border-box;
}

/* Primary Button Styles */
.primary-btn,
.btn.primary,
.action-btn {
    background-color: #007bff;
    color: white;
}

.primary-btn:hover:not(:disabled),
.btn.primary:hover:not(:disabled),
.action-btn:hover:not(:disabled) {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

/* Secondary Button Styles */
.secondary-btn,
.btn.secondary {
    background-color: #6c757d;
    color: white;
}

.secondary-btn:hover:not(:disabled),
.btn.secondary:hover:not(:disabled) {
    background-color: #545b62;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Disabled Button States */
button:disabled,
.btn:disabled,
.primary-btn:disabled,
.secondary-btn:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Link Styles */
a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Form Elements */
input,
select,
textarea {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Card Grid Layout - responsive grid for content cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

/* Legacy alias for step-based content */
.step-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.content-card,
.step-card {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    background: white;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

.content-card:hover,
.step-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

.content-card.disabled,
.step-card.coming-soon {
    opacity: 0.6;
    background: #f8f9fa;
}

.status-badge,
.step-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
    margin-bottom: 15px;
    width: fit-content;
}

.status-badge.available,
.step-status.available {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.pending,
.step-status.soon {
    background-color: #fff3cd;
    color: #856404;
}

.content-card h3,
.step-card h3 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.3em;
    text-align: left;
}

.content-card p,
.step-card p {
    color: #6c757d;
    margin-bottom: 20px;
    flex-grow: 1;
    font-size: 0.95em;
    line-height: 1.5;
}

.card-footer {
    margin-top: auto;
}

/* Alternative Card Layout - centered cards with smaller minimum width */
.option-grid,
.centered-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.option-card,
.centered-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.option-card:hover,
.centered-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,123,255,0.15);
}

/* Progress Bar Component */
.progress-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
    flex-wrap: wrap;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.progress-step {
    padding: 8px 16px;
    background-color: #e9ecef;
    border-radius: 20px;
    font-size: 0.9em;
    color: #6c757d;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 80px;
    text-align: center;
    font-weight: 500;
}

.progress-step.active {
    background-color: #667eea;
    color: white;
    font-weight: bold;
    border-color: #5a6fd8;
}

.progress-step.completed {
    background-color: #28a745;
    color: white;
}

.progress-step.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-step.clickable:hover {
    background-color: #007bff;
    color: white;
    transform: translateY(-1px);
    border-color: #007bff;
}

/* Section Styles */
/* Content Sections */
.info-section,
.info-box,
.highlight-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 4px solid #3498db;
}

.info-section.callout {
    background-color: #e7f3ff;
    border-color: #007bff;
    border-left-width: 5px;
}

.featured-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #e0e5f2 100%);
    border: 1px solid #d6d9de;
    color: white;
    border-left: 4px solid #ffd700;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.featured-card h3 {
    color: white;
    font-weight: bold;
}

.content-section,
.step-section {
    margin: 30px 0;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.content-box,
.step-box {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.content-box h4,
.step-box h4 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 15px;
}

.checklist-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.setup-instructions-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.os-instructions {
    margin: 20px 0;
    padding: 15px;
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

.os-instructions p:first-child {
    margin-top: 0;
    font-weight: 600;
}

.placeholder {
    background-color: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-style: italic;
}

.test-section,
.verification-section {
    background-color: #d4edda;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.demo-section {
    background-color: #fff3cd;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.troubleshooting-section {
    background-color: #f8d7da;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.troubleshooting-section .step-box {
    border-left-color: #dc3545;
    background-color: #fff5f5;
}

/* Lists and Checklists */
.checklist {
    margin: 15px 0;
}

.checklist label {
    display: flex;
    align-items: center;
    margin: 12px 0;
    cursor: pointer;
    padding: 10px 0;
    transition: background-color 0.2s ease;
    border-radius: 4px;
}

.checklist label:hover {
    background-color: rgba(0, 123, 255, 0.05);
    padding-left: 8px;
    margin-left: -8px;
}

.checklist input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    transform: scale(1.2);
    accent-color: #007bff;
}

ol, ul {
    margin: 15px 0;
    padding-left: 25px;
}

li {
    margin: 8px 0;
    line-height: 1.5;
}

/* Code and Tech Elements */
.code-block {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.code-block:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.code-block .code-header {
    background-color: #e9ecef;
    padding: 8px 15px;
    font-size: 0.8em;
    color: #6c757d;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.code-block .copy-btn {
    background-color: transparent;
    border: 1px solid #007bff;
    color: #007bff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: auto;
    height: auto;
    font-family: 'Inter', sans-serif;
}

.code-block .copy-btn:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    transform: none;
    box-shadow: none;
}

.code-block .copy-btn:active {
    transform: scale(0.95);
}

.code-block .copy-btn.copied {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.code-block .code-content {
    padding: 15px;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.code-block code {
    background: none;
    color: #495057;
    padding: 0;
    font-size: 0.9em;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Simple code blocks without headers (backwards compatibility) */
.code-block:not(.has-header) {
    padding: 15px;
}

.code-block:not(.has-header) code {
    display: block;
}

/* Language-specific styling hints */
.code-block.language-html .code-content {
    background: linear-gradient(90deg, transparent 0%, rgba(220, 53, 69, 0.05) 100%);
}

.code-block.language-javascript .code-content {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 193, 7, 0.05) 100%);
}

.code-block.language-json .code-content {
    background: linear-gradient(90deg, transparent 0%, rgba(40, 167, 69, 0.05) 100%);
}

.code-block.language-css .code-content {
    background: linear-gradient(90deg, transparent 0%, rgba(102, 126, 234, 0.05) 100%);
}

/* Formatted Prompt Styles */
.formatted-prompt {
    background-color: #f8f9fa;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 0;
    margin: 15px 0;
    overflow: hidden;
}

.prompt-header {
    background-color: #007bff;
    color: white;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 1.1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prompt-title {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.prompt-copy-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: auto;
}

.prompt-copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: none;
    box-shadow: none;
}

.prompt-content {
    padding: 20px;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

.prompt-content p {
    margin-bottom: 15px;
    color: #2c3e50;
}

.prompt-content p:last-child {
    margin-bottom: 0;
}

.prompt-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.prompt-content li {
    margin-bottom: 6px;
    color: #495057;
}

.prompt-content em {
    color: #6c757d;
    font-style: italic;
}

code {
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

/* Status Messages */
.status-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 15px 0;
    font-weight: 500;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Interactive Interface Sections */
.interactive-section,
.experiment-section {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    text-align: center;
}

.configuration-section,
.config-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 4px solid #6f42c1;
}

.choice-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.choice-btn {
    width: clamp(160px, 25vw, 220px);
    height: clamp(90px, 12vw, 120px);
    flex: 0 1 auto;
    padding: 0 20px; /* horizontal padding maintained, vertical via flex centering */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: 2px solid transparent;
    border-radius: 14px;
    font-size: 1.25em;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.choice-btn:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
    filter: brightness(1.05);
}

.choice-btn:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.choice-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0 20px 0;
    gap: 15px;
}

.nav-btn {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-btn.primary {
    background-color: #007bff;
    color: white;
}

.nav-btn.primary:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

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

.nav-btn.secondary:hover {
    background-color: #545b62;
    transform: translateY(-1px);
}

.nav-btn.disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    pointer-events: none;
}

/* Form Styling */
.config-form {
    margin: 20px 0;
}

.config-group,
.control-group,
.form-group {
    margin: 20px 0;
}

.config-group label,
.control-group label,
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.config-group input,
.config-group select,
.control-group input,
.control-group select,
.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.3s ease;
}

.config-group input:focus,
.config-group select:focus,
.control-group input:focus,
.control-group select:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.config-group small,
.control-group small,
.form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.85em;
}

/* Interactive Application Interface */
.app-header,
.game-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.scoreboard {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

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

.score-item {
    margin: 10px 0;
}

.score-label {
    display: block;
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 5px;
}

.score-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #2c3e50;
}

#status {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 8px;
    font-weight: 500;
    color: #1565c0;
    border-left: 4px solid #2196f3;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .container {
        padding: 25px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .step-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .progress-bar {
        padding: 15px;
    }
    
    .progress-step {
        font-size: 0.8em;
        padding: 6px 12px;
        min-width: 60px;
    }
    
    .choice-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .choice-btn {
        width: clamp(160px, 60vw, 240px);
    }
    
    .parameter-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .step-grid {
        grid-template-columns: 1fr;
    }
    
    .option-grid {
        grid-template-columns: 1fr;
    }
    
    .scoreboard {
        flex-direction: column;
        gap: 15px;
    }
}

/* Optional Method Styling */
.optional-method {
    position: relative;
    border-left: 4px solid #6c757d;
    background-color: #f8f9fa;
}

.optional-method h4 {
    color: #6c757d;
}

/* ============================================
   AI Explanations Page Styles
   ============================================ */

.algorithm-section {
    background: #f8f9fa;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.code-example {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
    margin: 10px 0;
}

.highlight {
    background: #fff3cd;
    padding: 3px 6px;
    border-radius: 3px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.back-link:hover {
    text-decoration: underline;
}

.instructor-note {
    margin-top: 40px;
    padding: 20px;
    background: #e9ecef;
    border-radius: 8px;
}

/* Additional utility classes for inline style cleanup */
.centered-card {
    max-width: 400px;
    margin: 0;
}

.methodology-link {
    display: inline-block;
    margin-top: 10px;
}

.post-save-suggestions {
    margin-top: 20px;
    background-color: #f8f9fa;
    border-left: 4px solid #28a745;
}

/* ============================================
   Validation and Testing Styles
   ============================================ */

.result-item,
.test-result {
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid transparent;
}

.result-pass,
.test-pass {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.result-fail,
.test-fail {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.test-summary {
    font-size: 1.2em;
    font-weight: 600;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.test-summary.all-pass {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.test-summary.has-failures {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.test-suite-results {
    margin-bottom: 25px;
}

.test-suite-results h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.suite-summary {
    font-weight: bold;
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 6px;
    font-size: 1.1em;
}

/* Tooltip icon for help text */
.tooltip-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    height: 22px !important;
    padding: 0 !important;
    background-color: #6c757d !important;
    color: white !important;
    border-radius: 50% !important;
    text-align: center !important;
    font-weight: bold !important;
    font-size: 14px !important;
    line-height: 22px !important;
    cursor: help !important;
    margin-left: 8px !important;
    position: relative !important;
    top: 3px !important;
    text-decoration: none !important;
    user-select: none !important;
}

.tooltip-icon:hover {
    background-color: #34495e !important;
    transform: scale(1.1) !important;
}

/* ============================================
   Step 5 Configuration Form Improvements
   ============================================ */

/* Improved Checkbox Group Styling */
.form-group.checkbox-group {
    display: flex;
    align-items: center;
    margin: 20px 0;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.form-group.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    margin-bottom: 0;
    cursor: pointer;
    accent-color: #007bff;
}

.form-group.checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    flex: 1;
}

/* AI Settings Container */
.ai-settings-container {
    margin: 15px 0;
    animation: slideDown 0.3s ease-out;
}

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

.ai-settings-box {
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 10px;
    border-left: 4px solid #6f42c1;
}

.ai-settings-box h5 {
    margin: 0 0 15px 0;
    color: #6f42c1;
    font-weight: 600;
}

.algorithm-settings {
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.coming-soon {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background-color: #f1f3f4;
    border-radius: 4px;
    margin: 0;
}

/* Transition Note Styling */
.transition-note {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
}

.transition-note p {
    margin: 0;
    color: #1565c0;
    font-size: 0.95em;
}

.transition-note a {
    color: #0d47a1;
    font-weight: 500;
    text-decoration: none;
}

.transition-note a:hover {
    text-decoration: underline;
}

/* Range Input Value Display */
.form-group span:not(.tooltip-icon) {
    margin-left: 10px;
    font-weight: 500;
    color: #495057;
    min-width: 80px;
    display: inline-block;
}

/* Algorithm Explanation Box - uses same styling as step-box with blue accent */
.algorithm-explanation-box {
    margin: 15px 0;
    animation: slideDown 0.3s ease-out;
}

.algorithm-explanation-box .explanation-content {
    background-color: #f8f9fa;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 20px;
    margin-top: 10px;
    border-left: 4px solid #007bff;
}

.algorithm-explanation-box h4 {
    margin-top: 0;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* ============================================
   Button Variants
   ============================================ */

/* Compact button modifier for smaller buttons */
.btn.compact,
.primary-btn.compact,
.secondary-btn.compact {
    padding: 5px 12px !important;
    font-size: 0.85em !important;
    min-width: auto !important;
    height: auto !important;
    line-height: 1.5 !important;
}

/* ============================================
   Expandable Content Cards
   Reusable for explanatory content with collapsible sections
   ============================================ */

.concept-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 15px 0;
    overflow: hidden;
}

.card-header {
    background-color: #e9ecef;
    padding: 15px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.card-header:hover {
    background-color: #dee2e6;
}

.card-content {
    padding: 15px;
    display: none;
}

.card-content.expanded {
    display: block;
}

.toggle-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

/* ============================================
   Educational Content Styling
   For mathematical formulas and parameter displays
   ============================================ */

.formula {
    background-color: #f1f3f4;
    padding: 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    margin: 15px 0;
    text-align: center;
    border-left: 4px solid #007bff;
    font-size: 0.95em;
}

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

.parameter-box {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
}

.parameter-box h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

/* ============================================
   Technical Explanation Page Enhancements
   For mathematical formulas, calculations, and complexity analysis
   ============================================ */

.calculation-example {
    background: #f9f9f9;
    border-left: 4px solid #e74c3c;
    padding: 15px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.calculation-example p {
    margin: 8px 0;
}

.calculation-example ul {
    margin: 10px 0;
    padding-left: 20px;
}

.complexity-table {
    overflow-x: auto;
    margin: 15px 0;
}

.complexity-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.complexity-table th, .complexity-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.complexity-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.complexity-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Performance indicators */
.complexity-table td:last-child {
    font-weight: bold;
}

/* ============================================
   RPS Configuration Demo Styles
   ============================================ */

.rps-config-demo .config-form-container {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.parameter-control {
    margin-bottom: 20px;
}

.parameter-control label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.parameter-control .control-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.parameter-control input[type="range"] {
    flex-grow: 1;
    margin: 0; /* Override default margins */
}

.parameter-control input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

.rps-config-demo .form-group {
    margin-bottom: 20px;
}

.rps-config-demo .form-group label,
.parameter-control label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 8px;
}

.rps-config-demo .form-group input[type="range"] {
    margin-right: 10px;
}

.rps-config-demo .form-group span {
    font-weight: bold;
    color: #007bff;
    min-width: 50px;
}

.rps-config-demo .form-group.checkbox-group {
    margin-top: 15px;
}

.rps-config-demo .form-group.checkbox-group input {
    margin-right: 8px;
}

.rps-config-demo .form-group.checkbox-group label {
    margin-bottom: 0;
}

/* Algorithm-specific settings containers */
.rps-config-demo .algorithm-settings-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.rps-config-demo .ai-settings-box {
    margin-top: 10px;
}

.rps-config-demo .ai-settings-box h5 {
    text-align: center;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
    display: inline-block;
}

.rps-config-demo .algorithm-settings {
    margin-top: 10px;
}

.rps-config-demo .form-group span.tooltip-icon {
    min-width: 22px; /* override earlier 50px */
    width: 22px;
    height: 22px;
}

/* ============================================
   Step 6 RPS – Choice Reveal & Result Animations
   ============================================ */

/* Reveal container fades in from below */
.reveal-section {
    text-align: center;
    animation: fadeInUp 0.4s ease-out;
}

/* Layout for the side-by-side choice cards */
.choice-reveal {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Subtle "vs" divider */
.vs-divider {
    font-size: 1.1em;
    font-weight: 600;
    color: #6c757d;
}

/* Card that shows each choice (emoji + label) */
.choice-display {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 14px;
    padding: 25px 35px;
    min-width: 150px;
    animation: popIn 0.4s ease-out;
}

.choice-emoji-large {
    font-size: 3rem;
    display: block;
    margin-bottom: 8px;
}

/* Result banner with outcome-specific colouring */
.result-display {
    margin-top: 10px;
    padding: 18px 28px;
    border-radius: 14px;
    font-size: 1.15em;
    font-weight: 600;
    animation: fadeInScale 0.35s ease-out;
}

.result-display.player_wins {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.result-display.ai_wins {
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.result-display.tie {
    background-color: #fff3cd;
    color: #856404;
    border: 2px solid #ffeeba;
}

/* ---------- Keyframes ---------- */
@keyframes popIn {
    0%   {transform: scale(0.6); opacity: 0;}
    60%  {transform: scale(1.15); opacity: 1;}
    100% {transform: scale(1);}
}

@keyframes fadeInScale {
    0%   {opacity: 0; transform: scale(0.95);}
    100% {opacity: 1; transform: scale(1);}
}

@keyframes fadeInUp {
    0%   {opacity: 0; transform: translateY(18px);}
    100% {opacity: 1; transform: translateY(0);}
}

/* ============================================
   Step 6 Game Progress Bar (distinct from step navigation)
   ============================================ */

.game-progress-container {
    margin: 15px 0;
    text-align: center;
}

.game-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.game-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-label {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: 500;
}