/* Basic Setup */
:root {
    --primary-bg: #e7f5ff; /* Light Sky Blue - Main background */
    --secondary-bg: #ffffff; /* White - For options and inputs */
    --primary-text: #343a40; /* Dark Grey */
    --secondary-text: #6c757d; /* Medium Grey */
    --accent-color: #007bff; /* Bright Blue (for buttons) */
    --accent-hover: #0056b3; /* Darker Blue (for hover) */
    --banner-bg: #0056b3; /* Darker Blue for the top banner */
    --correct-color: #28a745; /* Green */
    --wrong-color: #dc3545; /* Red */
    --disabled-color: #95a5a6; /* Grey for disabled button */
    --font-family-eng: 'Poppins', sans-serif;
    --font-family-urdu: 'Noto Nastaliq Urdu', sans-serif;
}

body {
    font-family: var(--font-family-eng);
    background-color: #d0e1f0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    color: var(--primary-text);
}

#app-container {
    width: 95%;
    max-width: 950px;
    height: 95vh;
    max-height: 750px;
    background-color: var(--primary-bg);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.top-banner {
    background-color: var(--banner-bg);
    color: white;
    text-align: center;
    padding: 10px;
    font-weight: 600;
    font-size: 1.1em;
}

/* Screen Management */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    box-sizing: border-box;
    overflow-y: auto;
}
.screen.active {
    display: flex;
}

/* --- Login Screen Styles --- */
#login-screen {
    padding: 0;
}
.login-layout {
    display: flex;
    width: 100%;
    height: 100%;
}
.content-frame {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    box-sizing: border-box;
    text-align: center;
}
.main-title { font-size: 2.5em; font-weight: 700; color: var(--primary-text); margin: 0; }
.subtitle { font-size: 1.2em; color: var(--secondary-text); margin: 5px 0 30px; }
.form-title { font-size: 1.8em; color: var(--accent-color); margin-bottom: 25px; font-family: var(--font-family-urdu); }
.input-group { margin-bottom: 20px; text-align: left; width: 100%; max-width: 400px; }
.input-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--secondary-text); }
.text-entry {
    font-size: 1em; width: 100%; padding: 12px; background-color: var(--secondary-bg);
    border: 1px solid #ced4da; border-radius: 8px; box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.text-entry:focus {
    outline: none; border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* --- Records Sidebar --- */
#records-sidebar {
    width: 240px;
    flex-shrink: 0;
    background-color: var(--primary-bg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-left: 1px solid #b8d6ed;
}
.sidebar-title { text-align: center; margin-top: 0; margin-bottom: 20px; color: var(--secondary-text); }
#sidebar-unlock-view { text-align: center; }
#sidebar-unlock-view p { font-size: 0.9em; color: var(--secondary-text); }
#sidebar-unlock-view input {
    width: 100%; padding: 8px; margin: 10px 0; box-sizing: border-box;
    border-radius: 5px; border: 1px solid #ced4da;
}
#sidebar-unlock-view button {
    width: 100%; padding: 10px; background-color: var(--accent-color); color: white;
    border: none; border-radius: 5px; cursor: pointer;
}
#sidebar-content-view { font-size: 1.1em; }
.sidebar-record { padding: 8px; border-bottom: 1px solid #d0e1f0; }
.hidden { display: none; }

/* Action Buttons */
.action-button {
    font-size: 1.1em; font-weight: 600; color: white; background-color: var(--accent-color);
    border: none; padding: 15px 30px; border-radius: 8px; cursor: pointer;
    transition: background-color 0.3s, transform 0.2s; width: 100%; max-width: 400px;
}
.action-button:hover:not(:disabled) { background-color: var(--accent-hover); transform: translateY(-2px); }
.start-button { margin-top: 20px; }
.action-button:disabled { background-color: var(--disabled-color); cursor: not-allowed; transform: none; }

/* --- Quiz Screen Styles --- */
#quiz-screen { padding: 25px 30px; }
.quiz-header { padding: 0 0 15px; display: flex; flex-direction: column; }
.welcome-text { font-size: 1em; font-weight: 600; color: var(--secondary-text); align-self: flex-start; }
.header-main-row { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.quiz-title { font-size: 1.5em; font-weight: bold; text-align: center; flex-grow: 1; margin: 0 10px; }
.record-button, .back-button {
    font-size: 0.9em; background: none; border: 1px solid #ced4da; color: var(--secondary-text);
    padding: 8px 15px; border-radius: 20px; cursor: pointer; transition: all 0.3s; white-space: nowrap;
}
.record-button:hover, .back-button:hover { background-color: var(--accent-color); color: white; border-color: var(--accent-color); }
.status-bar { display: flex; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid #dee2e6; }
.status-label { font-size: 1em; font-weight: 600; }
.score { color: var(--accent-color); }
#question-container { text-align: center; padding: 20px 0; }
.question-text { font-size: 1.5em; font-weight: 600; line-height: 1.5; margin-bottom: 10px; }
.urdu { font-family: var(--font-family-urdu); font-size: 1.6em; color: var(--secondary-text); }
#options-container { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; flex-grow: 1; padding: 15px 0; }
.option-button {
    font-size: 1.2em; font-weight: 600; padding: 18px; background-color: var(--secondary-bg);
    color: var(--primary-text); border: 1px solid #dee2e6; border-radius: 8px; cursor: pointer;
    transition: all 0.2s; display: flex; justify-content: center; align-items: center; text-align: center;
}
.option-button:hover:not(:disabled) { border-color: var(--accent-color); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.option-button:disabled { cursor: not-allowed; }
.option-button.correct { background-color: var(--correct-color); border-color: var(--correct-color); color: white; }
.option-button.wrong { background-color: var(--wrong-color); border-color: var(--wrong-color); color: white; }
.feedback-text { text-align: center; font-size: 1.1em; font-weight: 600; min-height: 50px; line-height: 1.6; }

/* Results & Modal Styles (Unchanged) */
#results-screen { justify-content: center; align-items: center; text-align: center; }
.results-content { padding: 20px; }
.results-title { font-family: var(--font-family-eng); font-size: 2.5em; }
.results-summary { font-size: 1.4em; margin-bottom: 30px; line-height: 1.7;}
.results-buttons { display: flex; flex-direction: column; gap: 15px; align-items: center; width: 100%; max-width: 400px;}
.action-button.secondary { background-color: #6c757d; }
.action-button.secondary:hover { background-color: #5a6268; }

.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); justify-content: center; align-items: center;
}
.modal-content {
    background-color: var(--primary-bg); padding: 30px; border-radius: 10px; width: 90%; max-width: 450px;
    text-align: center; position: relative; color: var(--primary-text);
}
.close-button {
    color: #aaa; position: absolute; top: 10px; right: 20px;
    font-size: 28px; font-weight: bold; cursor: pointer;
}
.record-title { font-family: var(--font-family-urdu); }
#record-details p { font-size: 1.1em; margin: 10px 0; text-align: left; }
#record-details .correct { color: var(--correct-color); }
#record-details .wrong { color: var(--wrong-color); }
#record-details .percentage { font-weight: bold; color: var(--accent-color); }