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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

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

/* Header Styles */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero h1 i {
    margin-right: 15px;
    color: #fbbf24;
}

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

/* Navigation Styles */
.navigation {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navigation ul {
    list-style: none;
    display: flex;
    justify-content: center;
    padding: 0;
}

.navigation li {
    margin: 0 20px;
}

.nav-link {
    display: block;
    padding: 20px 0;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Main Content */
main {
    padding: 40px 0;
}

.section {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.section.active {
    display: block;
}

.section h2 {
    font-size: 2.5rem;
    color: #1e293b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.section h2 i {
    margin-right: 15px;
    color: #667eea;
}

.section-intro {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 30px;
}

/* Truth Tables */
.truth-table-container {
    margin-bottom: 40px;
}

.truth-table-container h3 {
    font-size: 1.5rem;
    color: #374151;
    margin-bottom: 20px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.truth-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.truth-table th {
    background: #f1f5f9;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e2e8f0;
}

.truth-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 500;
}

.truth-table .true {
    background-color: #dcfce7;
    color: #166534;
    font-weight: 600;
}

.truth-table .false {
    background-color: #fef2f2;
    color: #dc2626;
    font-weight: 600;
}

/* Operations Grid */
.operations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.operation-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
}

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

.operation-card h3 {
    color: #1e293b;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.operation-card h3 i {
    margin-right: 10px;
    color: #667eea;
}

.operation-card .formula {
    background: #667eea;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    text-align: center;
    margin: 15px 0;
    font-weight: 600;
}

/* Interactive Section */
.interactive-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.controls {
    background: #f8fafc;
    padding: 30px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.controls h3 {
    color: #1e293b;
    margin-bottom: 20px;
}

.expression-builder {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.prop-select,
.operator-select {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
}

.prop-select:focus,
.operator-select:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #64748b;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.current-expression {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
}

.current-expression span {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: #667eea;
    font-weight: 600;
}

.generated-table-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    min-height: 200px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #10b981;
    color: white;
}

.btn-secondary:hover {
    background: #059669;
}

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

.btn-outline:hover {
    background: #667eea;
    color: white;
}

/* Practice Problems */
.problems-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.problem-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
}

.problem-card h3 {
    color: #1e293b;
    margin-bottom: 15px;
}

.practice-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.practice-table th {
    background: #667eea;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 600;
}

.practice-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.answer-select {
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    padding: 8px;
    background: white;
    font-size: 1rem;
    width: 60px;
}

.answer-select.correct {
    border-color: #10b981;
    background-color: #dcfce7;
}

.answer-select.incorrect {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.multiple-choice {
    margin: 20px 0;
}

.choice-label {
    display: block;
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-label:hover {
    border-color: #667eea;
}

.choice-label input {
    margin-right: 10px;
}

.choice-label.correct {
    border-color: #10b981;
    background-color: #dcfce7;
}

.choice-label.incorrect {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.step-by-step {
    margin: 20px 0;
}

.step {
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step label {
    font-weight: 500;
    flex: 1;
}

.step-answer {
    width: 80px;
}

.problem-actions {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.feedback {
    margin-top: 15px;
    padding: 15px;
    border-radius: 6px;
    font-weight: 500;
}

.feedback.success {
    background: #dcfce7;
    color: #166534;
    border: 2px solid #10b981;
}

.feedback.error {
    background: #fef2f2;
    color: #dc2626;
    border: 2px solid #ef4444;
}

.solution {
    margin-top: 20px;
    padding: 20px;
    background: #fffbeb;
    border: 2px solid #fbbf24;
    border-radius: 8px;
}

.solution.hidden {
    display: none;
}

.solution h4 {
    color: #92400e;
    margin-bottom: 15px;
}

.solution ul {
    margin-left: 20px;
}

.solution li {
    margin-bottom: 5px;
}

/* Expression Mode Radio Buttons */
.expression-mode {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.radio-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.radio-container input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

/* Complex Expression Builder */
.complex-controls {
    margin-bottom: 20px;
}

.complex-controls label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.expression-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    transition: border-color 0.3s ease;
}

.expression-input:focus {
    outline: none;
    border-color: #667eea;
}

.expression-help {
    margin-top: 8px;
}

.expression-help small {
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Preset Expressions */
.preset-expressions {
    margin-top: 20px;
}

.preset-expressions h4 {
    margin-bottom: 15px;
    color: #374151;
    font-size: 1rem;
}

.preset-btn {
    display: inline-block;
    margin: 5px 8px 5px 0;
    padding: 8px 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Complex table styling */
.complex-table {
    font-size: 0.9rem;
}

.complex-table th {
    padding: 10px 8px;
    font-size: 0.85rem;
}

.complex-table td {
    padding: 8px 6px;
}

/* Enhanced feedback styles */
.feedback.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
    animation: slideIn 0.3s ease;
}

.feedback.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f1c2c7 100%);
    border-left: 4px solid #dc3545;
    animation: shake 0.5s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Problem card enhancements */
.problem-card {
    position: relative;
    overflow: hidden;
}

.problem-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.problem-card h3 {
    margin-top: 20px;
}

/* Step-by-step styling improvements */
.step {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s ease;
}

.step:hover {
    transform: translateX(5px);
}

.step label {
    font-weight: 500;
    color: var(--text-primary);
}

/* Multiple choice improvements */
.choice-label {
    background: var(--bg-secondary);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.choice-label:hover {
    background: rgba(74, 144, 226, 0.1);
    border-color: var(--primary-color);
}

.choice-label input[type="radio"] {
    margin-right: 10px;
}

/* Solution panel improvements */
.solution {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    position: relative;
}

.solution::before {
    content: '💡';
    position: absolute;
    top: -10px;
    left: 20px;
    background: white;
    padding: 0 10px;
    font-size: 20px;
}

.solution h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 18px;
}

.solution ul {
    list-style-type: none;
    padding-left: 0;
}

.solution li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.solution li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* Footer */
.footer {
    background: #1e293b;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .navigation ul {
        flex-direction: column;
        text-align: center;
    }
    
    .navigation li {
        margin: 0;
    }
    
    .nav-link {
        padding: 15px 0;
        border-bottom: none;
        border-right: 3px solid transparent;
    }
    
    .operations-grid {
        grid-template-columns: 1fr;
    }
    
    .interactive-container {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 20px;
    }
    
    .problem-actions {
        flex-direction: column;
    }
    
    .step {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .step label {
        margin-bottom: 10px;
    }
    
    .expression-mode {
        flex-direction: column;
        gap: 10px;
    }
    
    .preset-expressions {
        text-align: center;
    }
    
    .preset-btn {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
    
    .complex-table {
        font-size: 10px;
    }
    
    .complex-table th,
    .complex-table td {
        padding: 4px 2px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section.active {
    animation: fadeIn 0.5s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
