* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    background: white;
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #58cc02;
    font-size: 2.5em;
    font-weight: bold;
}

.progress-container {
    display: flex;
    gap: 20px;
    font-size: 1.1em;
    font-weight: bold;
}

#score {
    color: #1cb0f6;
}

#streak {
    color: #ff9600;
}

/* Menu */
.menu {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.menu h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2em;
}

.modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.module-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.module-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.module-card h3 {
    margin-bottom: 10px;
    font-size: 1.5em;
}

.module-card p {
    margin-bottom: 20px;
    opacity: 0.9;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.3);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    background: #58cc02;
    height: 100%;
    transition: width 0.3s;
}

/* Learning Section */
.learning {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.lesson-content {
    max-width: 800px;
    margin: 0 auto;
}

.lesson-content h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2em;
}

.lesson-content h3 {
    color: #555;
    margin-top: 25px;
    margin-bottom: 15px;
}

.lesson-content h4 {
    color: #666;
    margin-top: 20px;
    margin-bottom: 10px;
}

.lesson-content p {
    line-height: 1.8;
    color: #666;
    margin-bottom: 15px;
}

.logic-gate {
    display: inline-block;
    background: #f0f0f0;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 10px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.truth-table {
    margin: 20px 0;
    border-collapse: collapse;
    width: 100%;
    max-width: 400px;
}

.truth-table th,
.truth-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.truth-table th {
    background: #667eea;
    color: white;
}

.truth-table tr:nth-child(even) {
    background: #f9f9f9;
}

/* Quiz Section */
.quiz {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.quiz-header {
    margin-bottom: 30px;
}

.quiz-progress {
    text-align: center;
    margin-top: 20px;
}

#question-num {
    color: #666;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

.quiz-progress-bar {
    background: #e0e0e0;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.quiz-progress-fill {
    background: #58cc02;
    height: 100%;
    transition: width 0.3s;
}

.question-container {
    max-width: 700px;
    margin: 0 auto;
}

#question-text {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 30px;
}

#question-image {
    margin: 20px 0;
    text-align: center;
    font-size: 3em;
}

#answer-options {
    display: grid;
    gap: 15px;
}

.answer-btn {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s;
    text-align: left;
}

.answer-btn:hover {
    border-color: #667eea;
    background: #f0f0ff;
}

.answer-btn.correct {
    background: #d7ffb8;
    border-color: #58cc02;
}

.answer-btn.incorrect {
    background: #ffd7d7;
    border-color: #ff4b4b;
}

.answer-btn:disabled {
    cursor: not-allowed;
}

/* Quiz Feedback */
.quiz-feedback {
    background: #f0f0f0;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.quiz-feedback.correct {
    background: #d7ffb8;
}

.quiz-feedback.incorrect {
    background: #ffd7d7;
}

#feedback-text {
    color: #333;
    font-size: 1.1em;
    margin-bottom: 15px;
}

/* Results Section */
.results {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.results-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.results-content h2 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 30px;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat {
    background: #f0f0f0;
    padding: 25px;
    border-radius: 12px;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-size: 1.1em;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Buttons */
.back-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 1.1em;
    cursor: pointer;
    padding: 10px;
    font-weight: bold;
}

.back-btn:hover {
    color: #764ba2;
}

.primary-btn {
    background: #58cc02;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.primary-btn:hover {
    background: #46a302;
}

.secondary-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.secondary-btn:hover {
    background: #764ba2;
}

/* Lesson Path */
.lesson-path {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.lesson-path h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2em;
}

.lessons-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lesson-item {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px 25px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.lesson-item:hover:not(.locked) {
    border-color: #58cc02;
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.lesson-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.lesson-item.completed {
    background: #d7ffb8;
    border-color: #58cc02;
}

.lesson-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

.lesson-item.completed .lesson-icon {
    background: #58cc02;
}

.lesson-item.locked .lesson-icon {
    background: #ccc;
}

.lesson-info {
    flex: 1;
}

.lesson-info h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.2em;
}

.lesson-info p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

.lesson-status {
    font-size: 1.5em;
}

/* Hearts and Progress Info */
.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#hearts {
    font-size: 1.2em;
}

/* Results Icon */
.results-icon {
    font-size: 5em;
    text-align: center;
    margin-bottom: 20px;
}

/* Feedback Content */
.feedback-content {
    text-align: center;
}

/* Explanation Box */
.explanation {
    margin-top: 15px;
    padding: 15px;
    background: #f0f7ff;
    border-left: 4px solid #1976d2;
    border-radius: 8px;
    font-size: 0.95em;
    line-height: 1.6;
    text-align: left;
}

.quiz-feedback.correct .explanation {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

.quiz-feedback.incorrect .explanation {
    background: #fff3e0;
    border-left-color: #ff9800;
}

.explanation strong {
    color: #333;
    display: block;
    margin-bottom: 8px;
}

/* K-Map Styles */
.kmap-container {
    margin: 30px auto;
    text-align: center;
}

.kmap-table {
    margin: 20px auto;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.kmap-table th {
    background: #667eea;
    color: white;
    padding: 12px;
    font-weight: bold;
    border: 2px solid #764ba2;
}

.kmap-cell {
    width: 50px;
    height: 50px;
    border: 2px solid #ddd;
    text-align: center;
    vertical-align: middle;
    font-size: 1.5em;
    font-weight: bold;
    transition: all 0.3s;
    background: white;
}

.kmap-cell.one {
    background: #e3f2fd;
    color: #1976d2;
}

.kmap-cell.interactive {
    cursor: pointer;
}

.kmap-cell.interactive:hover {
    background: #fff9c4;
    transform: scale(1.1);
}

.kmap-cell.highlighted {
    border: 3px solid #ff9800;
    box-shadow: inset 0 0 10px rgba(255, 152, 0, 0.3);
}

.kmap-cell.selected {
    background: #ffeb3b !important;
    border: 3px solid #fbc02d;
}

.kmap-cell.dontcare {
    background: #f0f0f0;
    color: #999;
    font-style: italic;
}

/* K-Map Corner Cell with Slash */
.kmap-corner-cell {
    background: #667eea !important;
    position: relative;
    padding: 8px !important;
}

.corner-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.85em;
    color: white;
}

.corner-label .col-vars {
    font-weight: bold;
}

.corner-label .slash {
    font-size: 1.2em;
    transform: rotate(-20deg);
    display: inline-block;
}

.corner-label .row-vars {
    font-weight: bold;
}

/* K-Map Group Legend */
.kmap-group-legend {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.kmap-group-legend h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1em;
}

.legend-empty {
    color: #999;
    font-style: italic;
    margin: 10px 0;
}

.legend-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-left: 4px solid;
    border-radius: 4px;
    transition: transform 0.2s;
}

.legend-item:hover {
    transform: translateX(5px);
}

.legend-color-box {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.legend-details {
    flex: 1;
}

.legend-term {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 4px;
}

.variable-info {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
}

.kept-vars {
    color: #2196F3;
    font-weight: 500;
}

.kept-vars::before {
    content: '✓ ';
}

.eliminated-vars {
    color: #999;
    font-weight: 500;
}

.eliminated-vars::before {
    content: '✗ ';
}

/* Interactive K-Map highlighting */
.kmap-cell.selecting {
    background: rgba(255, 235, 59, 0.6) !important;
    border: 2px dashed #FBC02D;
}

.kmap-cell.hint-highlight {
    animation: hint-pulse 2s ease-in-out;
}

@keyframes hint-pulse {
    0%, 100% { background: transparent; }
    50% { background: rgba(76, 175, 80, 0.5); }
}

.kmap-labels {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 30px;
    color: #666;
    font-size: 0.9em;
}

#question-image {
    margin: 20px 0;
    min-height: 100px;
}

/* Interactive K-Map Styles */
.kmap-interactive-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin: 20px 0;
}

.kmap-header {
    text-align: center;
    margin-bottom: 20px;
}

.kmap-header h3 {
    color: #333;
    margin-bottom: 10px;
}

.kmap-header p {
    color: #666;
    font-size: 0.9em;
}

.kmap-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.kmap-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.kmap-btn:hover {
    background: #667eea;
    color: white;
}

.kmap-btn.primary {
    background: #58cc02;
    border-color: #58cc02;
    color: white;
}

.kmap-btn.primary:hover {
    background: #46a302;
    border-color: #46a302;
}

.kmap-table-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.interactive-kmap {
    user-select: none;
}

.kmap-cell.selecting {
    background: #bbdefb !important;
    border: 3px solid #2196f3;
}

.kmap-cell.in-group {
    border: 3px solid #333;
}

.kmap-cell.hint-highlight {
    animation: hintPulse 2s ease-in-out;
}

@keyframes hintPulse {
    0%, 100% { background: white; }
    50% { background: #fff59d; }
}

.kmap-groups-display {
    margin-top: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 12px;
}

.kmap-groups-display h4 {
    color: #333;
    margin-bottom: 15px;
}

.no-groups {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.groups-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.group-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: white;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.group-term {
    font-weight: bold;
    color: #333;
    font-family: 'Courier New', monospace;
    flex: 1;
}

.group-size {
    color: #666;
    font-size: 0.9em;
}

.remove-group-btn {
    background: #ff4b4b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.remove-group-btn:hover {
    background: #cc0000;
}

.simplified-expression {
    padding: 15px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 8px;
    margin-top: 15px;
}

.simplified-expression strong {
    color: #1976d2;
    display: block;
    margin-bottom: 5px;
}

.solution-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-success {
    background: #d7ffb8;
    border: 2px solid #58cc02;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.result-success h4 {
    color: #46a302;
    margin-bottom: 10px;
}

.result-improvement {
    background: #fff3e0;
    border: 2px solid #ff9800;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.result-improvement h4 {
    color: #f57c00;
    margin-bottom: 10px;
}

/* Boolean Simplifier Styles */
.boolean-simplifier-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin: 20px 0;
}

.simplifier-header {
    text-align: center;
    margin-bottom: 25px;
}

.simplifier-header h3 {
    color: #333;
    margin-bottom: 10px;
}

.simplifier-header p {
    color: #666;
    font-size: 0.9em;
}

.expression-container {
    background: #f5f5f5;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
}

.expression-display {
    font-size: 1.8em;
    font-family: 'Courier New', monospace;
    color: #333;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

.expression-term {
    padding: 8px 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.expression-term:hover {
    border-color: #667eea;
    background: #f0f0ff;
}

.expression-term.selected {
    border-color: #58cc02;
    background: #d7ffb8;
    box-shadow: 0 0 10px rgba(88, 204, 2, 0.3);
}

.operator {
    font-size: 0.9em;
    color: #999;
    margin: 0 5px;
}

.laws-panel {
    margin-bottom: 25px;
}

.laws-panel h4 {
    color: #333;
    margin-bottom: 15px;
}

.laws-panel .hint {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 15px;
}

.laws-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.law-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.law-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.law-card strong {
    display: block;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.05em;
}

.law-examples {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.law-examples small {
    color: #666;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

.simplifier-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.control-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-btn.primary {
    background: #58cc02;
    border-color: #58cc02;
    color: white;
}

.control-btn.primary:hover {
    background: #46a302;
    border-color: #46a302;
}

.history-panel {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.history-panel h4 {
    color: #333;
    margin-bottom: 15px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-step {
    padding: 12px 15px;
    background: white;
    border-left: 4px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.history-step:hover {
    border-left-color: #667eea;
    transform: translateX(5px);
}

.history-step.current {
    border-left-color: #58cc02;
    background: #d7ffb8;
}

.step-number {
    font-weight: bold;
    color: #667eea;
    margin-right: 10px;
}

.step-expression {
    font-family: 'Courier New', monospace;
    color: #333;
}

.target-expression {
    background: #e3f2fd;
    padding: 15px;
    border-left: 4px solid #2196f3;
    border-radius: 8px;
    margin-top: 20px;
}

.target-expression strong {
    color: #1976d2;
    margin-right: 10px;
}

.target-expression span {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
}

/* Truth Table Activities Styles */
.truth-table-activity-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin: 20px 0;
}

.activity-header {
    text-align: center;
    margin-bottom: 25px;
}

.activity-header h3 {
    color: #333;
    margin-bottom: 10px;
}

.activity-header p {
    color: #666;
    font-size: 0.95em;
}

.interactive-table {
    margin: 20px auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.interactive-table .input-column {
    background: #e3f2fd;
}

.interactive-table .output-column {
    background: #fff3e0;
}

.input-cell {
    background: #f5f5f5;
    color: #666;
    font-weight: bold;
}

.output-cell {
    background: white;
}

.table-input {
    width: 40px;
    height: 40px;
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
}

.table-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.table-input.correct {
    background: #d7ffb8;
    border-color: #58cc02;
    color: #46a302;
}

.table-input.incorrect {
    background: #ffd7d7;
    border-color: #ff4b4b;
    color: #cc0000;
}

.activity-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 25px 0;
    flex-wrap: wrap;
}

.activity-feedback {
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    margin-top: 20px;
    animation: slideIn 0.3s ease-out;
}

.activity-feedback.success {
    background: #d7ffb8;
    border: 2px solid #58cc02;
    color: #46a302;
}

.activity-feedback.partial {
    background: #fff3e0;
    border: 2px solid #ff9800;
    color: #f57c00;
}

.activity-feedback.warning {
    background: #fff9c4;
    border: 2px solid #fbc02d;
    color: #f57f17;
}

.activity-feedback.info {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    color: #1976d2;
}

.expression-input-container {
    text-align: center;
    margin: 25px 0;
}

.expression-input-container label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.expression-input {
    width: 80%;
    max-width: 400px;
    padding: 12px 20px;
    font-size: 1.1em;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    text-align: center;
    transition: all 0.3s;
}

.expression-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.expression-input-container small {
    display: block;
    color: #999;
    margin-top: 8px;
    font-size: 0.85em;
}

/* K-Map Practice Generator Styles */
.kmap-practice-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin: 20px 0;
}

.kmap-practice-header {
    text-align: center;
    margin-bottom: 25px;
}

.kmap-practice-header h3 {
    color: #333;
    margin-bottom: 15px;
}

.var-selector {
    margin: 15px 0;
}

.var-selector label {
    font-weight: bold;
    color: #666;
    margin-right: 10px;
}

.var-select {
    padding: 8px 15px;
    font-size: 1em;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.var-select:focus {
    outline: none;
    border-color: #667eea;
}

.practice-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.practice-instructions {
    background: #f0f7ff;
    padding: 20px;
    border-radius: 12px;
    margin-top: 25px;
    border-left: 4px solid #2196f3;
}

.practice-instructions p {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.practice-instructions ul {
    list-style-position: inside;
    color: #666;
    line-height: 1.8;
}

.practice-instructions li {
    margin-bottom: 5px;
}

.practice-instructions strong {
    color: #667eea;
}

/* Canonical Forms Styles */
.canonical-forms-container {
    padding: 20px;
}

.activity-selection {
    margin: 30px 0;
}

.activity-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.activity-btn {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
}

.activity-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.activity-content {
    margin-top: 40px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.concept-summary {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-top: 30px;
    text-align: left;
}

.concept-summary ul {
    list-style: none;
    padding: 0;
}

.concept-summary li {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.concept-summary li:last-child {
    border-bottom: none;
}

.activity-header {
    margin-bottom: 30px;
}

.problem-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.minterm-options, .maxterm-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.minterm-checkbox, .maxterm-checkbox {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.minterm-checkbox:hover, .maxterm-checkbox:hover {
    background: #e9ecef;
}

.minterm-checkbox input, .maxterm-checkbox input {
    margin-right: 8px;
}

.truth-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.truth-table th, .truth-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.truth-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.truth-table td.output-1 {
    background: #d4edda;
    font-weight: 600;
}

.truth-table td.output-0 {
    background: #f8d7da;
}

.answer-section {
    display: flex;
    gap: 10px;
    margin: 30px 0;
}

.check-btn, .new-problem-btn, .show-solution-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.check-btn {
    background: #28a745;
    color: white;
}

.check-btn:hover {
    background: #218838;
}

.new-problem-btn {
    background: #6c757d;
    color: white;
}

.new-problem-btn:hover {
    background: #5a6268;
}

.show-solution-btn {
    background: #17a2b8;
    color: white;
}

.show-solution-btn:hover {
    background: #138496;
}

.result-success, .result-error, .result-partial, .result-improvement, .result-info {
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.result-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.result-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.result-partial {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.result-improvement {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
}

.result-info {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
}

.hint {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9em;
}

.expression-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.user-expression {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: #495057;
}

.expected-answer {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

/* Circuit Builder Styles */
.circuit-builder-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
}

.circuit-toolbar {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.circuit-toolbar h3 {
    width: 100%;
    margin: 0 0 10px 0;
    color: #333;
}

.gate-btn {
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.gate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.gate-btn.input-btn {
    border-color: #4CAF50;
    color: #4CAF50;
}

.gate-btn.output-btn {
    border-color: #f44336;
    color: #f44336;
}

.circuit-canvas-area {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
}

.circuit-canvas {
    display: block;
    cursor: crosshair;
}

.circuit-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .modules {
        grid-template-columns: 1fr;
    }
    
    .results-stats {
        grid-template-columns: 1fr;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    header h1 {
        font-size: 1.8em;
    }
}
