/* Basic Setup with New Professional Theme */
:root {
    --primary-bg: #ffffff;      /* Light Grey-Blue background */
    --secondary-bg: #ffffff;    /* White for content areas */
    --primary-text: #000000;    /* Dark, muted blue for text */
    --secondary-text: #000000;  /* Greyish text for subtitles */
    --accent-color: #000000;    /* Strong, professional blue */
    --accent-hover: #000000;    /* Lighter blue for hover */
    --banner-bg: #000000;       /* Banner background */
    --correct-color: #028338;   /* Green for correct answers */
    --wrong-color: #ff1900;     /* Red for wrong answers */
    --disabled-color: #666666;  /* Grey for disabled elements */
    --font-family-eng: 'Poppins', sans-serif;
    --font-family-urdu: 'Noto Nastaliq Urdu', sans-serif;
}

body {
    font-family: var(--font-family-eng);
    background-color: #e2e8f0;
    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: 800px;
    background-color: var(--primary-bg);
    border-radius: 15px;
    box-shadow: 0 15px 45px rgb(0, 0, 0);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.top-banner {
    background: linear-gradient(90deg, var(--accent-hover), var(--accent-color));
    color: white;
    text-align: center;
    padding: 15px; /* Increased height */
    font-weight: 600;
    font-size: 1.2em; /* Slightly larger text */
    flex-shrink: 0;
}

/* 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.8em; font-weight: 700; color: var(--primary-text); margin: 0; }
.subtitle { font-size: 1.3em; color: var(--secondary-text); margin: 5px 0 35px; }
.form-title { font-size: 1.9em; 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: 14px; background-color: var(--secondary-bg);
    border: 1px solid #dcdfe2; 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 4px rgba(41, 128, 185, 0.2);
}

/* --- Records Sidebar --- */
#records-sidebar {
    width: 250px; flex-shrink: 0; background-color: #eaf1f5;
    padding: 20px; display: flex; flex-direction: column;
    overflow-y: auto; border-left: 1px solid #d9e2e8;
}
.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, #sidebar-unlock-view button {
    width: 100%; padding: 10px; margin: 5px 0; box-sizing: border-box;
    border-radius: 5px; border: 1px solid #ced4da;
}
#sidebar-unlock-view button { background-color: var(--accent-color); color: white; border: none; cursor: pointer; }
#sidebar-content-view { font-size: 1.1em; }
.sidebar-record {
    padding: 10px 8px; border-bottom: 1px solid #d3dde3;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.95em;
}
.delete-record-btn {
    color: var(--secondary-text); cursor: pointer; font-size: 1.5em;
    font-weight: bold; padding: 0 5px; transition: color 0.3s;
    line-height: 1;
}
.delete-record-btn:hover { color: var(--wrong-color); }
.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;
    box-shadow: 0 4px 15px rgba(41, 128, 185, 0.2);
}
.action-button:hover:not(:disabled) { background-color: var(--accent-hover); transform: translateY(-3px); }
.start-button { margin-top: 20px; }
.action-button:disabled { background-color: var(--disabled-color); cursor: not-allowed; transform: none; box-shadow: none; }

/* --- Quiz Screen Styles --- */
#quiz-screen { padding: 25px 30px; }
.quiz-header { padding: 0 0 15px; display: flex; flex-direction: column; flex-shrink: 0; }
.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.6em; 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 #e1e6e9; flex-shrink: 0; }
.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.6em; font-weight: 600; line-height: 1.5; margin-bottom: 10px; }
.urdu { font-family: var(--font-family-urdu); font-size: 1.7em; color: var(--secondary-text); }
#options-container { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 15px 0; }
.option-display {
    font-size: 1.2em; font-weight: 500; padding: 20px; background-color: var(--secondary-bg);
    color: var(--primary-text); border: 1px solid #e1e6e9; border-radius: 8px;
    display: flex; justify-content: center; align-items: center; text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); transition: all 0.3s;
}
.option-display.correct { background-color: var(--correct-color); border-color: var(--correct-color); color: white; transform: scale(1.05); }
.option-display.wrong { background-color: var(--wrong-color); border-color: var(--wrong-color); color: white; opacity: 0.7; }

/* --- Answer Input Styles --- */
#answer-input-container { padding: 20px 0; text-align: center; flex-shrink: 0; }
#answer-input {
    font-size: 1.4em; padding: 12px; width: 90%; max-width: 500px;
    text-align: center; border: 2px solid #bdc3c7; border-radius: 8px;
    transition: all 0.3s;
}
#answer-input:focus {
    outline: none; border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(41, 128, 185, 0.2);
}

.feedback-text { text-align: center; font-size: 1.2em; font-weight: 600; min-height: 50px; line-height: 1.6; }

/* Results & Modal Styles */
#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.8em; }
.results-summary { font-size: 1.5em; 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: #7f8c8d; box-shadow: 0 4px 15px rgba(127, 140, 141, 0.2); }
.action-button.secondary:hover { background-color: #95a5a6; }

.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6); 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);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.close-button {
    color: #aaa; position: absolute; top: 10px; right: 20px;
    font-size: 30px; 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); }