﻿/* Toggle Switch */
.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 28px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 22px;
        width: 22px;
        left: 4px;
        bottom: 3px;
        background-color: white;
        transition: 0.4s;
        border-radius: 50%;
    }

input:checked + .slider {
    background-color: #4caf50;
}

    input:checked + .slider:before {
        transform: translateX(24px);
    }

/* Themed Body */
body.light-mode {
    background: linear-gradient(to bottom right, #f1f4f9, #dff1ff);
    color: #1a1a1a;
}

body.dark-mode {
    background: #1e1e2f;
    color: #f0f0f0;
}

    body.dark-mode .topic-section {
        background-color: #2b2c3a;
        border-left-color: #9c27b0;
    }

        body.dark-mode .topic-section h3 {
            color: #f06292;
        }

    body.dark-mode .pdf-download-btn {
        background: linear-gradient(to right, #4caf50, #388e3c);
    }

    /* Optional dark code block */
    body.dark-mode pre code {
        background-color: #121212;
        color: #b0f0ff;
    }




/* Global default text fix */
body.dark-mode {
    color: #f0f0f0;
}

    /* Fix for headings */
    body.dark-mode h1,
    body.dark-mode h2,
    body.dark-mode h3,
    body.dark-mode h4,
    body.dark-mode h5,
    body.dark-mode h6 {
        color: #ffffff;
    }

    /* Fix for paragraphs, lists, and strong */
    body.dark-mode p,
    body.dark-mode li,
    body.dark-mode strong,
    body.dark-mode span {
        color: #e0e0e0;
    }

    /* Code blocks (optional) */
    body.dark-mode pre code {
        background-color: #1e1e2f;
        color: #c0f9ff;
    }

    /* Mode buttons fix */
    body.dark-mode .mode-btn {
        background: #2c2c3c;
        color: #e0e0e0;
    }

        body.dark-mode .mode-btn.active {
            background: linear-gradient(to right, #3f51b5, #9c27b0);
            color: #ffffff;
        }

    /* Button hover fix */
    body.dark-mode .pdf-download-btn:hover {
        background: linear-gradient(to right, #66bb6a, #43a047);
    }

    /* Section cards fix */
    body.dark-mode .topic-section {
        background: #2b2c3a;
        border-left-color: #7e57c2;
    }


    body.dark-mode p,
    body.dark-mode li,
    body.dark-mode strong {
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }


    /* MCQ Section - Dark Mode Fix */
    body.dark-mode .mcq-question {
        background-color: #2a2a40;
        color: #f5f5f5;
        padding: 14px;
        margin: 12px 0;
        border-radius: 10px;
        box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
    }

        body.dark-mode .mcq-question ul {
            list-style: none;
            padding-left: 0;
        }

        body.dark-mode .mcq-question li {
            background-color: #3a3a50;
            color: #f0f0f0;
            margin: 8px 0;
            padding: 10px 14px;
            border-radius: 8px;
            cursor: pointer;
            transition: background-color 0.2s ease;
        }

            body.dark-mode .mcq-question li:hover {
                background-color: #505070;
            }

/* Optional: highlight correct/incorrect feedback */
.mcq-correct {
    background-color: #4caf50 !important; /* green */
    color: white !important;
}

.mcq-wrong {
    background-color: #f44336 !important; /* red */
    color: white !important;
}
