* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding: 20px;
    background-color: #f4f4f4;
}

#app {
    max-width: 800px;
    margin: 0 auto;
}

body.old-people-mode {
    font-size: 17px;
}

body.old-people-mode #app {
    max-width: none;
    width: calc(100vw - 40px);
    margin: 0;
}

body.old-people-mode .container,
body.old-people-mode .section,
body.old-people-mode #testContainer,
body.old-people-mode .test-container {
    max-width: none;
    width: 100%;
}

body.old-people-mode .question .options {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

body.old-people-mode input,
body.old-people-mode button,
body.old-people-mode .text-answer {
    font-size: 17px;
}

.old-people-btn {
    display: block;
    margin-bottom: 15px;
}

.section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

h2 {
    margin-bottom: 20px;
    color: #333;
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input, button {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.text-answer {
    width: 100%;
    box-sizing: border-box;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 10px;
    transition: border-color 0.3s;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
    max-width: 100%;
    display: block;
    width: 100%;
}

.text-answer:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

.question {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.option {
    display: flex;
    align-items: center;
    gap: 10px;
}

#testsList, #adminTestsList {
    display: grid;
    gap: 15px;
}

.test-card {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    background-color: white;
}

.test-card .description {
    color: #666;
    margin: 10px 0;
    font-size: 0.9em;
    line-height: 1.4;
}

.test-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.result {
    margin-top: 20px;
    padding: 15px;
    background-color: #e9ecef;
    border-radius: 4px;
    text-align: center;
}

.result-details {
    margin-top: 20px;
}

.result-item {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.correct {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.incorrect {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.partial {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.feedback {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

.total-score {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

#addQuestionBtn {
    margin: 10px 0;
    background-color: #28a745;
}

.error {
    color: #dc3545;
    margin-top: 10px;
}

.test-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.test-actions button {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.edit-btn {
    background-color: #4CAF50;
    color: white;
}

.edit-btn:hover {
    background-color: #45a049;
}

.delete-btn {
    background-color: #f44336;
    color: white;
}

.delete-btn:hover {
    background-color: #da190b;
}

.remove-question {
    background-color: #dc3545;
    color: white;
    margin-top: 10px;
}

.remove-question:hover {
    background-color: #c82333;
}

.admin-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-btn {
    background-color: #6c757d;
    color: white;
}

.back-btn:hover {
    background-color: #5a6268;
}

.primary-btn {
    background-color: #007bff;
    color: white;
}

.primary-btn:hover {
    background-color: #0056b3;
}

.secondary-btn {
    background-color: #6c757d;
    color: white;
}

.secondary-btn:hover {
    background-color: #5a6268;
}

#editTestForm, #newTestForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.question {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 16px;
    position: relative;
}

.tab-btn:hover {
    color: #007bff;
}

.tab-btn.active {
    color: #007bff;
    font-weight: bold;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #007bff;
}

.admin-tab-content {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

#newTestForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

#newTestForm input[type="text"],
#newTestForm textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#newTestForm textarea {
    min-height: 100px;
    resize: vertical;
}

#questionsContainer {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.question {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.question .options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 10px 0;
}

.remove-question {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.remove-question:hover {
    background: #c82333;
}

#addQuestionBtn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    align-self: flex-start;
}

#addQuestionBtn:hover {
    background: #218838;
}

.test-dropdown {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
}

.test-dropdown option {
    padding: 10px;
}

.test-dropdown option[value=""] {
    color: #666;
}

.edit-test-container {
    max-width: 800px;
    margin: 0 auto;
}

h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
}

textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 15px;
}

.edit-form {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1000;
}

.edit-form::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.edit-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0 8px;
}

.close-btn:hover {
    color: #333;
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.secondary-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.secondary-btn:hover {
    background-color: #5a6268;
}

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

.question {
    font-size: 1.2em;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.options {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.text-question-options {
    width: 100%;
    box-sizing: border-box;
    display: block;
}

.options label {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.options label:hover {
    background-color: #f8f9fa;
}

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

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding: 1rem 0;
}

.nav-left, .nav-right {
    flex: 1;
}

.nav-right {
    display: flex;
    justify-content: flex-end;
}

.prev-btn, .next-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.prev-btn {
    background-color: #6c757d;
    color: white;
}

.prev-btn:hover {
    background-color: #5a6268;
}

.next-btn {
    background-color: #007bff;
    color: white;
}

.next-btn:hover {
    background-color: #0056b3;
}

.results {
    text-align: center;
    padding: 30px;
}

.results h2 {
    color: #007bff;
    margin-bottom: 20px;
}

#testSelect {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    animation: fadeIn 0.3s ease-in;
}

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

.option-label {
    display: block;
    margin: 10px 0;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-label:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

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

.option-text {
    display: inline-block;
    vertical-align: middle;
}

.option-text strong {
    color: #007bff;
    margin-right: 8px;
}

.option-label input[type="radio"]:checked + .option-text {
    font-weight: 500;
}

.option-label:has(input[type="radio"]:checked) {
    background-color: #e7f1ff;
    border-color: #007bff;
}

.score-display {
    text-align: center;
    padding: 2rem;
    margin: 2rem 0;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.score {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.percentage {
    font-size: 2.5rem;
    font-weight: bold;
    color: #007bff;
}

.restart-btn {
    display: block;
    width: 200px;
    margin: 2rem auto;
    padding: 1rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.restart-btn:hover {
    background-color: #218838;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.results-table th,
.results-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.results-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.results-table tr:hover {
    background-color: #f8f9fa;
}

.results-table td.score {
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: #28a745;
}

.option-block {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-block:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.option-block.selected {
    border-color: #007bff;
    background-color: #e7f1ff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.option-block input[type="radio"] {
    display: none;
}

.option-block label {
    display: block;
    width: 100%;
    cursor: pointer;
    margin: 0;
}

.option-text {
    display: block;
    font-size: 1.1rem;
    color: #495057;
}

.option-text strong {
    color: #007bff;
    margin-right: 0.5rem;
}

.options {
    margin: 2rem 0;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.header h2 {
    margin: 0;
}

.logout-btn {
    padding: 0.5rem 1rem;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.logout-btn:hover {
    background-color: #c82333;
}

/* Submit Test Button */
#submitTest {
    width: 100%;
    padding: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s;
}

#submitTest:hover {
    background-color: #45a049;
}

#submitTest:active {
    background-color: #3d8b40;
}

/* Configuration Styles */
.config-form {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.config-form .form-group {
    margin-bottom: 20px;
}

.config-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.config-form input[type="number"],
.config-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.config-form button {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.config-form button:hover {
    background-color: #0056b3;
}

/* Update tab styles */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    position: relative;
}

.tab-button.active {
    color: #007bff;
    font-weight: bold;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #007bff;
}
