/* Module-specific styles */
.concept-demo {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.crypto-flow {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.crypto-step {
    background: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    min-width: 150px;
    flex: 1;
}

.step-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.crypto-arrow {
    font-size: 1.5em;
    font-weight: bold;
    color: #4CAF50;
}

.use-cases, .key-comparison {
    background: rgba(0,0,0,0.1);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.key-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.key-type {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
}

.signature-flow {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.signature-step {
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.step-visual {
    font-size: 1.5em;
    margin: 10px 0;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
}

.signature-examples {
    margin: 30px 0;
}

.signature-use-case {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.signature-use-case p {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.hash-demo {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
}

.input-section {
    margin-bottom: 20px;
}

.input-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.input-section textarea {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
}

.hash-algorithms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.hash-result h4 {
    margin: 0 0 10px 0;
}

.hash-output {
    background: rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.9em;
    word-break: break-all;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.hsm-architecture {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.hsm-layers {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.hsm-layer {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.hsm-layer.hardware {
    background: rgba(76, 175, 80, 0.2);
    border-left-color: #4CAF50;
}

.hsm-layer.firmware {
    background: rgba(33, 150, 243, 0.2);
    border-left-color: #2196F3;
}

.hsm-layer.api {
    background: rgba(255, 152, 0, 0.2);
    border-left-color: #FF9800;
}

.comparison-table {
    display: grid;
    gap: 10px;
}

.comparison-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.comparison-aspect {
    font-weight: bold;
}

.hsm-advantage {
    color: #4CAF50;
}

.software-limitation {
    color: #f44336;
}

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

.demo-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
}

.demo-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.demo-card p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.assessment-intro {
    text-align: center;
    margin-bottom: 40px;
}

.assessment-stats {
    color: #7f8c8d;
    font-style: italic;
}

.assessment-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}

.assessment-card h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.question-preview {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.preview-options {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.preview-options li {
    padding: 8px 0;
    color: #2c3e50;
}

.assessment-actions {
    text-align: center;
    margin-top: 30px;
}

.assessment-actions .btn {
    margin: 0 10px;
}

.next-steps {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.next-module {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
}

.next-module h3 {
    color: white;
    margin-bottom: 15px;
}

.next-module p {
    color: rgba(255,255,255,0.9);
    margin-bottom: 25px;
}

.additional-resources {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.additional-resources h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.additional-resources ul {
    list-style: none;
    padding: 0;
}

.additional-resources li {
    margin: 15px 0;
}

.additional-resources a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.additional-resources a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .crypto-flow {
        flex-direction: column;
    }

    .crypto-arrow {
        transform: rotate(90deg);
    }

    .key-comparison {
        grid-template-columns: 1fr;
    }

    .signature-flow {
        flex-direction: column;
    }

    .hash-algorithms {
        grid-template-columns: 1fr;
    }

    .comparison-row {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .next-steps {
        grid-template-columns: 1fr;
    }
}

/* ===== CRITICAL TEXT VISIBILITY FIXES ===== */
/* Force all text in interactive containers to be visible */
.use-cases p,
.use-cases li,
.key-comparison p,
.key-comparison li,
.hash-properties li,
.hash-properties p,
.signature-examples p,
.signature-examples li,
.signature-use-case p,
.hsm-vs-software p,
.hsm-vs-software li,
.hsm-advantages,
.software-limitation,
.comparison-table p,
.protocol-data p,
.threat-item p,
.impl-details p,
.impl-details li,
.pros li,
.cons li,
.stage-details p,
.stage-details li,
.participant-details p,
.participant-details li,
.concept-demo p,
.concept-demo li {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
}

/* Ensure headings are bright white */
.concept-demo h4,
.concept-demo h5,
.use-cases h4,
.signature-examples h4,
.signature-examples h5,
.hash-properties h4 {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6) !important;
}

/* Make sure strong text stands out */
.interactive-container strong,
.interactive-container b,
.concept-demo strong,
.use-cases strong,
.signature-examples strong {
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7) !important;
}

/* Demo result containers */
.demo-result {
    margin: 20px 0;
    padding: 20px;
    border: 2px solid #3498db;
    border-radius: 8px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    animation: slideIn 0.5s ease-out;
}

.demo-header {
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.demo-header h4 {
    color: #ecf0f1 !important;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
}

.simulation-output {
    background: #1a252f;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: #ecf0f1;
    overflow-x: auto;
}

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

/* Hash Generator specific styles */
.hash-input-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.hash-input-section label {
    display: block;
    margin-bottom: 15px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 16px;
}

.hash-input-section input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    border: 2px solid #3498db;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
    background: white;
    color: #2c3e50;
}

.hash-input-section input[type="text"]:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.hash-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.hash-result {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #ecf0f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hash-result h4 {
    margin: 0 0 10px 0;
    color: #2c3e50 !important;
    font-size: 14px;
    font-weight: bold;
    text-shadow: none !important;
}

.hash-result code {
    display: block;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #2c3e50;
    word-break: break-all;
    min-height: 40px;
    border: 1px solid #dee2e6;
}

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

.hash-actions .btn {
    min-width: 200px;
    padding: 12px 20px;
    font-size: 14px;
}

/* Responsive design for hash generator */
@media (max-width: 768px) {
    .hash-results {
        grid-template-columns: 1fr;
    }

    .hash-actions {
        flex-direction: column;
        align-items: center;
    }

    .hash-input-section input[type="text"] {
        font-size: 16px; /* Prevent zoom on mobile */
    }
}

/* Quiz System Styles */
.quiz-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.quiz-header h3 {
    color: #2c3e50 !important;
    margin-bottom: 15px;
    text-shadow: none !important;
}

.quiz-progress {
    margin-top: 15px;
}

.quiz-progress span {
    color: #7f8c8d;
    font-weight: bold;
    font-size: 14px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.3s ease;
}

.question-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #3498db;
}

.question-card h4 {
    color: #2c3e50 !important;
    margin-bottom: 20px;
    font-size: 18px;
    text-shadow: none !important;
}

.question-options {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.question-options li {
    margin: 10px 0;
    cursor: pointer;
    padding: 12px 15px;
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #2c3e50;
}

.question-options li:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.question-options li.selected {
    border-color: #3498db;
    background: #e3f2fd;
    color: #1976d2;
    font-weight: bold;
}

.question-options li.correct {
    border-color: #27ae60;
    background: #d5f4e6;
    color: #1e8449;
}

.question-options li.incorrect {
    border-color: #e74c3c;
    background: #fadbd8;
    color: #cb4335;
}

.quiz-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

.quiz-actions .btn {
    min-width: 120px;
}

/* Quiz Results */
.quiz-results {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.results-header h3 {
    color: #2c3e50 !important;
    text-shadow: none !important;
    margin-bottom: 20px;
}

.results-score {
    font-size: 3em;
    font-weight: bold;
    margin: 20px 0;
    padding: 20px;
    border-radius: 10px;
}

.results-score.pass {
    color: #27ae60;
    background: #d5f4e6;
}

.results-score.fail {
    color: #e74c3c;
    background: #fadbd8;
}

.results-summary {
    margin: 25px 0;
    font-size: 16px;
    color: #2c3e50;
}

.results-actions {
    margin-top: 30px;
}

.results-actions .btn {
    margin: 0 10px;
}

/* Study Guide */
.study-guide {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
}

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

.study-guide-header h3 {
    color: #2c3e50 !important;
    text-shadow: none !important;
    margin: 0;
}

.study-guide-header .btn {
    padding: 5px 10px;
    min-width: auto;
}

.study-guide-content {
    color: #2c3e50;
    line-height: 1.6;
}

.study-guide-content h4 {
    color: #3498db !important;
    text-shadow: none !important;
    margin-top: 25px;
    margin-bottom: 15px;
}

.study-guide-content ul {
    margin: 15px 0;
    padding-left: 20px;
}

.study-guide-content li {
    margin: 8px 0;
    color: #2c3e50;
}

/* Study Guide Overlay */
.study-guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* Responsive quiz styles */
@media (max-width: 768px) {
    .quiz-container,
    .quiz-results,
    .study-guide {
        margin: 10px;
        padding: 20px;
    }

    .quiz-actions {
        flex-direction: column;
        gap: 10px;
    }

    .quiz-actions .btn {
        width: 100%;
    }

    .question-card h4 {
        font-size: 16px;
    }

    .study-guide {
        max-width: 95%;
        max-height: 90vh;
    }
}

/* Additional Resources Styles */
.resource-modal {
    max-width: 1000px !important;
}

.resource-content {
    max-height: 70vh;
    overflow-y: auto;
}

/* Quick Reference Styles */
.quick-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.ref-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.ref-section h4 {
    color: #2c3e50 !important;
    text-shadow: none !important;
    margin-top: 0;
    margin-bottom: 15px;
}

.ref-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.ref-table th,
.ref-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #dee2e6;
    text-align: left;
    color: #2c3e50;
}

.ref-table th {
    background: #e9ecef;
    font-weight: bold;
    font-size: 12px;
}

.ref-table td {
    font-size: 11px;
}

.perf-tips ul,
.security-levels p {
    margin: 10px 0;
    color: #2c3e50;
}

/* Troubleshooting Guide Styles */
.troubleshooting-sections {
    color: #2c3e50;
}

.issue-section {
    margin: 25px 0;
}

.issue-section h4 {
    color: #e74c3c !important;
    text-shadow: none !important;
    margin-bottom: 20px;
}

.issue-item {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 6px 6px 0;
}

.issue-item h5 {
    color: #856404 !important;
    text-shadow: none !important;
    margin-bottom: 10px;
}

.issue-item pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
    margin: 10px 0;
}

.best-practice {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 6px 6px 0;
}

.best-practice h5 {
    color: #0c5460 !important;
    text-shadow: none !important;
    margin-bottom: 10px;
}

.checklist {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
}

.checklist input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

/* Crypto Game Styles */
.crypto-game-container {
    text-align: center;
    color: #2c3e50;
}

.game-header {
    margin-bottom: 20px;
}

.game-header h4 {
    color: #2c3e50 !important;
    text-shadow: none !important;
}

.game-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.game-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.game-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f4e79);
    transform: translateY(-2px);
}

.race-header {
    margin-bottom: 20px;
}

.race-progress {
    position: relative;
    background: #ecf0f1;
    height: 30px;
    border-radius: 15px;
    margin: 15px 0;
    overflow: hidden;
}

.car {
    position: absolute;
    left: 10%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    transition: left 0.5s ease;
}

.track {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #7f8c8d;
    top: 50%;
    transform: translateY(-50%);
}

.finish {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
}

.race-stats {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    font-weight: bold;
}

.race-question {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.race-question h6 {
    color: #2c3e50 !important;
    text-shadow: none !important;
    font-size: 18px;
}

.race-answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.race-answer-btn {
    background: white;
    color: #2c3e50;
    border: 2px solid #3498db;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.race-answer-btn:hover {
    background: #3498db;
    color: white;
    transform: scale(1.05);
}

.race-results {
    text-align: center;
    padding: 20px;
}

.final-score h4 {
    color: #27ae60 !important;
    text-shadow: none !important;
    margin-bottom: 15px;
}

.race-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* Responsive styles for additional resources */
@media (max-width: 768px) {
    .quick-ref-grid {
        grid-template-columns: 1fr;
    }

    .ref-table {
        font-size: 12px;
    }

    .race-answers {
        grid-template-columns: 1fr;
    }

    .race-stats {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    .race-actions {
        flex-direction: column;
    }
}