@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --bg-color: #121212;
    --primary-text-color: #e0e0e0;
    --container-bg-color: #1e1e1e;
    --border-color: #444;
    --button-bg-color: #333;
    --button-hover-bg-color: #444;
    --accent-color: #3d93f5;
    --correct-color: #2a9d8f;
    --incorrect-color: #e76f51;
    --shadow-color: rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-text-color);
    margin: 0;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
}

#initial-setup-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.hide {
    display: none !important;
}

#app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

#vertical-progress-bar {
    width: 50px;
    background-color: var(--container-bg-color);
    padding: 10px 5px;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

.progress-block {
    width: 30px;
    height: 30px;
    margin: 3px auto;
    border-radius: 3px;
    background-color: var(--button-bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: default;
    transition: all 0.3s ease;
    font-size: 0.8em;
    flex-shrink: 0;
}

.progress-block.current {
    border: 2px solid var(--accent-color);
    background-color: var(--button-hover-bg-color);
}

.progress-block.answered {
    background-color: #555;
}

.progress-block.answered.correct {
    background-color: var(--correct-color);
}

.progress-block.answered.incorrect {
    background-color: var(--incorrect-color);
}

.option-btn.selected {
    background-color: var(--accent-color);
}

.option-btn.selected:hover {
    background-color: var(--accent-color) !important;
    cursor: default !important;
}

.progress-block.flagged {
    border: 2px solid orange;
}

.progress-block:hover {
    background-color: var(--button-hover-bg-color);
    cursor: pointer;
}

#vertical-progress-bar.results-active .progress-block:hover {
    background-color: var(--button-hover-bg-color);
    cursor: pointer;
}

#main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: 1rem;
}

/* --- Initial Setup Page Styles --- */
#initial-setup-container {
    background-color: var(--container-bg-color);
    border-radius: 15px;
    padding: 2rem 3rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px var(--shadow-color);
    border: 1px solid var(--border-color);
}

#drop-zone-container {
    text-align: center;
}

#drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 2rem;
    color: var(--primary-text-color);
    background-color: var(--button-bg-color);
    transition: background-color 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#drop-zone h2 {
    margin-top: 0;
}

#quiz-options {
    margin-top: 20px;
    text-align: left;
}

#drop-zone:hover, #drop-zone.drag-over {
    border-color: var(--accent-color);
    background-color: #2c2c2c;
}

#file-upload {
    display: none !important;
}

.custom-file-upload {
    border: none;
    display: inline-block;
    padding: 10px 20px;
    cursor: pointer;
    background-color: var(--accent-color);
    color: white;
    border-radius: 5px;
    margin-top: 10px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.custom-file-upload:hover {
    background-color: #2980b9;
}

.separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: #888;
    margin: 1.5rem 0;
}
.separator::before, .separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}
.separator:not(:empty)::before {
    margin-right: .5em;
}
.separator:not(:empty)::after {
    margin-left: .5em;
}

#universal-input-area {
    text-align: center;
}

#universal-input-area h2 {
    margin-top: 0;
}

#universal-input {
    width: 100%;
    box-sizing: border-box;
    height: 100px;
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--button-bg-color);
    color: var(--primary-text-color);
    resize: vertical;
    font-family: monospace;
}

#universal-load-btn {
    width: 100%;
    margin-bottom: 1rem;
}

#recommended-quizzes-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

#quiz-wrapper {
    width: 100%;
    max-width: 700px;
    text-align: center;
}

h1, h2 {
    text-align: center;
    color: var(--accent-color);
    font-weight: 600;
}

#question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

#question-counter {
    font-size: 1.2rem;
    font-weight: bold;
}

#question-text {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.option-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--button-bg-color);
    color: var(--primary-text-color);
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-family: inherit;
}

.option-btn:hover:not([disabled]) {
    background-color: var(--button-hover-bg-color);
}

.option-btn.correct {
    background-color: var(--correct-color);
    border-color: var(--correct-color);
}

.option-btn.incorrect {
    background-color: var(--incorrect-color);
    border-color: var(--incorrect-color);
}

.quiz-btn {
    display: inline-block;
    margin: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    background-color: var(--accent-color);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
    overflow-wrap: break-word;
    white-space: normal;
}

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

.quiz-btn.selected {
    background-color: var(--correct-color);
}

#toggle-progress-btn {
    display: none;
}

#hot-directory-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

.hot-quiz-link {
    color: var(--accent-color);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 5px;
    background-color: var(--button-bg-color);
    transition: background-color 0.3s;
    overflow-wrap: break-word;
    white-space: normal;
}

.hot-quiz-link:hover {
    background-color: var(--button-hover-bg-color);
}
.result-item {
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-left: 5px solid;
    text-align: left;
}

.result-item.correct {
    border-left-color: var(--correct-color);
}

.result-item.incorrect {
    border-left-color: var(--incorrect-color);
}

.score-container {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--button-bg-color);
    border-radius: 15px;
    display: inline-block;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.score-display {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
}

.score-divider {
    color: #666;
    font-size: 0.7em;
    margin: 0 5px;
}

.score-message {
    font-size: 1.1rem;
    color: #aaa;
    margin-top: 0.5rem;
    margin-bottom: 0;
    font-weight: 500;
}

.quiz-file-info {
    font-size: 0.9em;
    color: var(--primary-text-color);
    margin-top: 5px;
}

#footer-info {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 9999;
}

#github-link {
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
    text-decoration: none;
}

#github-link:hover {
    color: var(--primary-text-color);
}

#version-display {
    font-size: 0.8em;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--container-bg-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* --- Responsive Styles --- */
@media (max-width: 768px) {
    body {
        justify-content: center;
    }

    #initial-setup-container {
        padding: 1rem;
        width: 85%;
        margin-top: 20px;
    }

    #app-container {
        flex-direction: column;
        height: 100%;
    }

    #main-content {
        padding: 1rem;
        padding-bottom: 44px;
    }

    #vertical-progress-bar {
       
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 999;
        width: 100%;
        height: 44px;
        padding: 5px 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: none;
        border-top: 1px solid var(--border-color);
        transition: transform 0.4s ease-in-out;
    }

    #vertical-progress-bar.progress-bar-hidden {
        transform: translateY(100%);
    }

    .progress-block {
        width: 30px;
        height: 30px;
        margin: 0 5px;
    }

        #toggle-progress-btn {
            display: flex;
            justify-content: center;
            align-items: center;
            position: fixed;
            bottom: 60px;
            left: 20px;
            z-index: 1000;
            width: 35px;
            height: 35px;
            border-radius: 50%;
            padding: 0;
            transition: transform 0.4s ease-in-out;
        }
    
        #toggle-progress-btn.bar-is-hidden {
            transform: translateY(44px);
        }
    #progress-arrow {
        border: solid white;
        border-width: 0 3px 3px 0;
        display: inline-block;
        padding: 4px;
        transition: transform 0.3s ease-in-out;
    }

    #progress-arrow.down {
        transform: rotate(45deg);
    }

    #progress-arrow.up {
        transform: rotate(-135deg);
    }

    #question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .quiz-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}
