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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1rem;
    opacity: 0.9;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-btn {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
}

.header-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.theme-icon,
.header-icon {
    font-size: 1.5rem;
}

.lang-text {
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

#lang-toggle:hover .lang-text {
    transform: scale(1.1);
}

main {
    flex: 1;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    width: 100%;
}

/* Progress Accordion */
.progress-accordion {
    margin-bottom: 1.5rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
}

.progress-toggle {
    width: 100%;
    padding: 1rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.progress-toggle:hover {
    background-color: #2980b9;
}

.progress-title {
    font-weight: bold;
    font-size: 1.1rem;
}

.progress-summary {
    font-size: 0.9rem;
    opacity: 0.9;
}

.progress-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.progress-toggle.expanded .progress-arrow {
    transform: rotate(180deg);
}

.progress-content {
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    transition: max-height 0.3s ease;
}

.progress-content.hidden {
    display: none;
}

.progress-actions {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

/* Tabs */
.tabs {
    display: flex;
    background-color: white;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tab-button {
    flex: 1;
    padding: 1rem;
    border: none;
    background-color: #ecf0f1;
    color: #7f8c8d;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 1px solid #ddd;
}

.tab-button:last-child {
    border-right: none;
}

.tab-button:hover {
    background-color: #d5dbdb;
}

.tab-button.active {
    background-color: white;
    color: #2c3e50;
    font-weight: bold;
}

/* Tab Content */
.tab-content {
    background-color: white;
    padding: 2rem;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tab-panel {
    display: none;
}

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

.tab-panel h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

/* Matrix Grid */
.matrix-grid {
    display: grid;
    grid-template-columns: repeat(5, 50px);
    grid-template-rows: repeat(5, 50px);
    gap: 5px;
    margin: 1rem 0;
    justify-content: center;
}

.matrix-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ecf0f1;
    border: 2px solid #bdc3c7;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: default;
    transition: all 0.3s ease;
}

.matrix-cell.highlight-source {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
    transform: scale(1.1);
}

.matrix-cell.highlight-target {
    background-color: #e74c3c;
    color: white;
    border-color: #c0392b;
    transform: scale(1.1);
}

/* Key Matrix Container */
.key-matrix-container {
    text-align: center;
}

.matrix-editor {
    margin-top: 1rem;
    text-align: center;
}

.edit-mode-selector {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: bold;
    color: #2c3e50;
}

.radio-option input[type="radio"] {
    transform: scale(1.2);
}

.input-mode {
    margin-bottom: 1.5rem;
}

.input-mode label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.input-mode input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
    text-transform: uppercase;
}

.keyword-preview {
    margin-top: 1rem;
}

.matrix-preview {
    display: grid;
    grid-template-columns: repeat(5, 30px);
    grid-template-rows: repeat(5, 30px);
    gap: 2px;
    margin-top: 0.5rem;
    justify-content: center;
}

.matrix-preview-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    font-size: 0.8rem;
    font-weight: bold;
    color: #2c3e50;
}

.matrix-preview-cell.keyword-char {
    background-color: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
}

.matrix-editor textarea {
    font-family: monospace;
    font-size: 1.2rem;
    padding: 0.5rem;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    resize: none;
    text-transform: uppercase;
    width: 200px;
    max-width: 100%;
    margin: 0 auto;
    display: block;
    text-align: center;
}

.editor-buttons {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Forms and Inputs */
.input-section {
    margin-bottom: 1.5rem;
}

.input-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.input-section textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
    resize: vertical;
}

.settings-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #3498db;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.mode-settings {
    margin-left: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
    transition: opacity 0.3s ease;
}

.mode-label {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.padding-char-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.padding-char-wrapper > label {
    margin: 0;
    white-space: nowrap;
}

.radio-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-group-vertical label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn:disabled {
    background-color: #bdc3c7;
    color: #7f8c8d;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn:disabled:hover {
    background-color: #bdc3c7;
}

/* Process Section */
.process-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.process-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.animation-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-info {
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-left: 0.5rem;
    font-weight: bold;
}

.process-section h3 {
    color: #2c3e50;
    margin: 0;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #3498db;
    color: #3498db;
}

.btn-outline:hover {
    background-color: #3498db;
    color: white;
}

.restart-section {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.pair-display {
    font-family: monospace;
    font-size: 1.2rem;
    margin: 1rem 0;
    padding: 1rem;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    word-spacing: 0.5rem;
}

.intermediate-states {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.state-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.state-container label {
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.9rem;
}

.pair-display .same-pair {
    color: #e74c3c;
    font-weight: bold;
}

.encrypted-pairs .encrypted-pair {
    color: #27ae60;
    font-weight: bold;
}

.decrypted-pairs .decrypted-pair {
    color: #8e44ad;
    font-weight: bold;
}

/* Output Section */
.output-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #e8f5e9;
    border-radius: 4px;
    border: 1px solid #a5d6a7;
}

.output-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.output-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.output-text {
    flex: 1;
    font-family: monospace;
    font-size: 1.2rem;
    padding: 1rem;
    background-color: white;
    border: 1px solid #a5d6a7;
    border-radius: 4px;
    word-break: break-all;
}

/* Messages */
.error-message {
    color: #e74c3c;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.warning-message {
    color: #f39c12;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.info-message {
    color: #3498db;
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #e3f2fd;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: opacity 0.3s ease;
}

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

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    max-height: 90vh;
    width: 90%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: #e9ecef;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-body section {
    margin-bottom: 2rem;
}

.modal-body section:last-child {
    margin-bottom: 0;
}

.modal-body h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #555;
}

.modal-body ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: #555;
}

.modal-body ul ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.modal-body strong {
    color: #2c3e50;
}

/* Exercise Section */
.exercise-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.exercise-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.exercise-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.exercise-select {
    padding: 0.5rem;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
    min-width: 180px;
}

.exercise-select:disabled {
    background-color: #ecf0f1;
    color: #7f8c8d;
    cursor: not-allowed;
}

.challenge-info {
    margin-top: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.challenge-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.challenge-title {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1rem;
}

.challenge-description {
    color: #555;
    font-size: 0.9rem;
}

.challenge-hint {
    color: #f39c12;
    font-size: 0.9rem;
    font-style: italic;
}

.challenge-points {
    color: #27ae60;
    font-weight: bold;
    font-size: 0.9rem;
}

.answer-check {
    margin-top: 1rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 2px solid #3498db;
}

.answer-check h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.1rem;
}

.answer-input-section {
    margin-bottom: 1rem;
}

.answer-input-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.challenge-answer-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
    text-transform: uppercase;
}

.challenge-answer-input:focus {
    border-color: #3498db;
    outline: none;
}

.answer-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.hint-display {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
}

.hint-counter {
    font-size: 0.85em;
    opacity: 0.8;
    margin-left: 0.25rem;
}

.btn[disabled] .hint-counter {
    opacity: 0.6;
}

#hint-button:not([disabled]):hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

#hint-button:not([disabled]):hover .hint-counter {
    opacity: 1;
    font-weight: bold;
}

.answer-result {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
}

.answer-result.correct {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.answer-result.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.progress-stats {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    margin-bottom: 1rem;
}

.progress-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: help;
}

.progress-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.progress-stat-label {
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .matrix-grid {
        grid-template-columns: repeat(5, 40px);
        grid-template-rows: repeat(5, 40px);
        gap: 3px;
    }
    
    .matrix-cell {
        font-size: 1rem;
    }
    
    .tab-button {
        font-size: 0.9rem;
        padding: 0.75rem 0.5rem;
    }
    
    .output-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
    }
    
    .intermediate-states {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .header-buttons {
        gap: 0.5rem;
    }
    
    .header-btn {
        width: 40px;
        height: 40px;
    }
}

/* Dark Mode */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode header {
    background-color: #1c1c1c;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

body.dark-mode .header-btn {
    border-color: rgba(255, 255, 255, 0.5);
}

body.dark-mode .header-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.7);
}

body.dark-mode .tabs {
    background-color: #2d2d2d;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

body.dark-mode .tab-button {
    background-color: #242424;
    color: #a0a0a0;
    border-color: #3a3a3a;
}

body.dark-mode .tab-button:hover {
    background-color: #2d2d2d;
}

body.dark-mode .tab-button.active {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .tab-content {
    background-color: #1a1a1a;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

body.dark-mode .tab-panel h2 {
    color: #e0e0e0;
}

body.dark-mode .matrix-cell {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .matrix-cell.highlight-source {
    background-color: #2980b9;
    border-color: #1f5f8b;
}

body.dark-mode .matrix-cell.highlight-target {
    background-color: #c0392b;
    border-color: #922b21;
}

body.dark-mode textarea,
body.dark-mode input[type="text"] {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .settings-section {
    background-color: #2d2d2d;
}

body.dark-mode .input-section label {
    color: #e0e0e0;
}

body.dark-mode .btn-primary {
    background-color: #2980b9;
}

body.dark-mode .btn-primary:hover {
    background-color: #1f5f8b;
}

body.dark-mode .btn-success {
    background-color: #229954;
}

body.dark-mode .btn-success:hover {
    background-color: #1a7d42;
}

body.dark-mode .btn-secondary {
    background-color: #5d6d7e;
}

body.dark-mode .btn-secondary:hover {
    background-color: #4a5866;
}

body.dark-mode .btn:disabled {
    background-color: #444;
    color: #666;
}

body.dark-mode .btn:disabled:hover {
    background-color: #444;
}

body.dark-mode .process-section {
    background-color: #2d2d2d;
    border-color: #444;
}

body.dark-mode .process-section h3 {
    color: #e0e0e0;
}

body.dark-mode .btn-small {
    font-size: 0.875rem;
}

body.dark-mode .pair-display {
    background-color: #1a1a1a;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .output-section {
    background-color: #1e3a1e;
    border-color: #2e5a2e;
}

body.dark-mode .output-section h3 {
    color: #e0e0e0;
}

body.dark-mode .output-text {
    background-color: #1a1a1a;
    border-color: #2e5a2e;
    color: #e0e0e0;
}

body.dark-mode .error-message {
    color: #ff6b6b;
}

body.dark-mode .warning-message {
    color: #f1c40f;
}

body.dark-mode .info-message {
    background-color: #1a3a52;
    color: #87ceeb;
}

body.dark-mode .toast {
    background-color: #2d2d2d;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

body.dark-mode footer {
    background-color: #1c1c1c;
}

body.dark-mode footer a {
    color: #5dade2;
}

body.dark-mode .toggle-slider {
    background-color: #666;
}

body.dark-mode .toggle-switch input:checked + .toggle-slider {
    background-color: #2980b9;
}

body.dark-mode .mode-settings {
    background-color: #2d2d2d;
    border-left-color: #2980b9;
}

body.dark-mode .mode-label {
    color: #e0e0e0;
}

body.dark-mode .state-container label {
    color: #e0e0e0;
}

body.dark-mode .encrypted-pairs .encrypted-pair {
    color: #2ecc71;
}

body.dark-mode .decrypted-pairs .decrypted-pair {
    color: #9b59b6;
}

body.dark-mode .step-info {
    color: #95a5a6;
}

body.dark-mode .btn-outline {
    border-color: #2980b9;
    color: #2980b9;
}

body.dark-mode .btn-outline:hover {
    background-color: #2980b9;
    color: white;
}

body.dark-mode .restart-section {
    border-top-color: #444;
}

body.dark-mode .modal-content {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .modal-header {
    background-color: #2d2d2d;
    border-bottom-color: #444;
}

body.dark-mode .modal-header h2 {
    color: #e0e0e0;
}

body.dark-mode .modal-close {
    color: #a0a0a0;
}

body.dark-mode .modal-close:hover {
    background-color: #3a3a3a;
    color: #e0e0e0;
}

body.dark-mode .modal-body h3 {
    color: #e0e0e0;
    border-bottom-color: #2980b9;
}

body.dark-mode .modal-body p,
body.dark-mode .modal-body li {
    color: #b0b0b0;
}

body.dark-mode .modal-body strong {
    color: #e0e0e0;
}

body.dark-mode .radio-option {
    color: #e0e0e0;
}

body.dark-mode .input-mode label {
    color: #e0e0e0;
}

body.dark-mode .input-mode input[type="text"] {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .matrix-preview-cell {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .matrix-preview-cell.keyword-char {
    background-color: #1a3a52;
    border-color: #2980b9;
    color: #5dade2;
}

body.dark-mode .exercise-section {
    background-color: #2d2d2d;
    border-left-color: #2980b9;
}

body.dark-mode .exercise-section h3 {
    color: #e0e0e0;
}

body.dark-mode .exercise-select {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .exercise-select:disabled {
    background-color: #1a1a1a;
    color: #666;
}

body.dark-mode .challenge-info {
    background-color: #1a1a1a;
    border-color: #444;
}

body.dark-mode .challenge-title {
    color: #e0e0e0;
}

body.dark-mode .challenge-description {
    color: #b0b0b0;
}

body.dark-mode .challenge-hint {
    color: #f1c40f;
}

body.dark-mode .challenge-points {
    color: #2ecc71;
}

body.dark-mode .answer-check {
    background-color: #2d2d2d;
    border-color: #2980b9;
}

body.dark-mode .answer-check h4 {
    color: #e0e0e0;
}

body.dark-mode .answer-input-section label {
    color: #e0e0e0;
}

body.dark-mode .challenge-answer-input {
    background-color: #1a1a1a;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .challenge-answer-input:focus {
    border-color: #2980b9;
}

body.dark-mode .hint-display {
    background-color: #3a3a1e;
    border-color: #5a5a2e;
    color: #f1c40f;
}

body.dark-mode .answer-result.correct {
    background-color: #1e3a1e;
    color: #a8d4a8;
    border-color: #2e5a2e;
}

body.dark-mode .answer-result.incorrect {
    background-color: #3a1e1e;
    color: #d4a8a8;
    border-color: #5a2e2e;
}

body.dark-mode .progress-accordion {
    background-color: #2d2d2d;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

body.dark-mode .progress-toggle {
    background-color: #2980b9;
}

body.dark-mode .progress-toggle:hover {
    background-color: #1f5f8b;
}

body.dark-mode .progress-content {
    background-color: #1a1a1a;
    border-top-color: #444;
}

body.dark-mode .progress-stat-value {
    color: #e0e0e0;
}

body.dark-mode .progress-stat-label {
    color: #95a5a6;
}

body.dark-mode .progress-actions {
    border-top-color: #444;
}