/* base.html */
body {
    font-family: "Noto Sans TC", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f6f8;
    color: #333;
    line-height: 1.6;
}

header {
    background: #0066cc;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

header a {
    color: white;
    text-decoration: none;
}

header nav a {
    color: #fff;
    margin-left: 15px;
    text-decoration: none;
    font-weight: bold;
}

header nav a:hover {
    text-decoration: underline;
}

main {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

footer {
    text-align: center;
    padding: 15px;
    margin-top: 30px;
    background: #f0f0f0;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #ddd;
}

/* index.html */
.login-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 40px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
}

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

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    font-size: 1rem;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
    text-align: center;
}

.form-group button {
    width: 100%;
    padding: 10px;
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

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

/* error.html */
.error-container {
    max-width: 600px;
    margin: 100px auto;
    padding: 40px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.error-container h2 {
    margin-bottom: 20px;
    color: red;
}

/* dashboard_student.html and dashboard_teacher.html*/
.selection {
    max-width: 500px;
    margin: 30px auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.selection h2 {
    margin-bottom: 35px;
    color: #333;
    font-size: 1.5rem;
}

.selection div {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.selection a {
    padding: 12px 24px;
    background: #0066cc;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.selection a:hover {
    background: #004a99;
}

.exam-record-list {
    max-width: 500px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.exam-record-list h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.5rem;
}

.exam-record-dashboard {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 20px;
    margin: 20px 0;
}

.exam-record-dashboard p {
    margin: 10px 0;
    padding: 12px 24px;
    background: rgba(0, 221, 255, 0.632);
    text-decoration: none;
    border-radius: 6px;
    font-size: 1rem;
    transition: background 0.3s ease;
    font-weight: bold;
}

.exam-record-info {
    width: 100%;
    padding: 15px 0px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #f5f5f5;
}
.exam-record-info p {
    margin: 8px 0;
    font-size: 1rem;
    color: #333;
}

.exam-record-info a {
    padding: 5px 15px;
    margin: 10px 0;
    background: #0066cc;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.exam-record-info a:hover {
    background: #004a99;
}

/* exam.html & exam_result.html */
.exam-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.exam-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
}

#timer {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.exam-container button {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.exam-container button:hover {
    background: #004a99;
}

.exam-result {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.question {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.question p {
    font-weight: bold;
    margin-bottom: 10px;
}

.question img {
    height: auto;
    width: 100%;
    display: block;
    margin: 0 auto 10px auto;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 5px;
    background: #fafafa;
    box-sizing: border-box;
}

.question input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #bbb;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.question input[type="text"]:focus {
    border-color: #0066cc;
    outline: none;
}

.question.correct {
    border: 2px solid #28a745;
}

.question.wrong {
    border: 2px solid #dc3545;
}

.correct-answer {
    border: 2px solid #28a745;
    color: #155724;
    background: #d4edda;
    padding: 5px;
    width: 200px;
}

.wrong-answer {
    border: 2px solid #dc3545;
    color: #721c24;
    background: #f8d7da;
    padding: 5px;
    width: 200px;
}

.correct-text {
    font-size: 0.9rem;
    color: #555;
    margin-top: 5px;
}

.result-actions {
    margin-top: 20px;
    text-align: center;
}

.result-actions a {
    display: inline-block;
    margin: 0 10px;
    padding: 10px 20px;
    background: #0066cc;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s;
}

.result-actions a:hover {
    background: #004a99;
}

/* user_create.html and user_read.html and user_delete.html */
.user-function {
    max-width: 400px;
    margin: 40px auto;
    padding: 40px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.user-function form {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.user-function form input[type="text"] {
    width: 100%;
    padding: 10px 0px;
    margin-bottom: 15px;
    border: 1px solid #bbb;
    border-radius: 6px;
    font-size: 1rem;
    transition: border 0.3s ease;
    text-align: center;
}

.user-function form input[type="text"]:focus {
    border-color: #007bff;
    outline: none;
}

.user-function form button {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.user-function form button:hover {
    background-color: #004a99;
}

.user-function select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    padding: 10px 40px 10px 12px;
    font-size: 1rem;
    border: 1px solid #bbb;
    border-radius: 8px;
    background-color: #fff;
    color: #222;
    transition: border-color 0.18s ease, box-shadow 0.18s ease,
        transform 0.06s ease;
    cursor: pointer;
    margin: 0px 0px 20px;
}

.user-function select:hover {
    border-color: #888;
}

.user-function select:active {
    transform: translateY(0.5px);
}

.user-function input[type="file"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    font-size: 1rem;
    border: 1px solid #bbb;
    border-radius: 8px;
    background-color: #fff;
    color: #222;
    transition: border-color 0.18s ease, box-shadow 0.18s ease,
        transform 0.06s ease;
    cursor: pointer;
    margin: 0px 0px 20px;
}

.user-function input[type="file"]::file-selector-button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background-color: #f5f5f5;
    color: #222;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.06s ease;
}

.user-function input[type="file"]::file-selector-button:hover {
    background-color: #e0e0e0;
}

.user-function input[type="file"]::file-selector-button:active {
    transform: translateY(0.5px);
}

/* question_create.html and question_read.html and question_delete.html */
.question-function {
    max-width: 400px;
    margin: 40px auto;
    padding: 40px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.question-function form {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.question-function form input[type="text"] {
    width: 100%;
    padding: 10px 0px;
    margin-bottom: 15px;
    border: 1px solid #bbb;
    border-radius: 6px;
    font-size: 1rem;
    transition: border 0.3s ease;
    text-align: center;
}

.question-function form input[type="text"]:focus {
    border-color: #007bff;
    outline: none;
}

.question-function form button {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.question-function form button:hover {
    background-color: #004a99;
}

.question-function select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    padding: 10px 40px 10px 12px;
    font-size: 1rem;
    border: 1px solid #bbb;
    border-radius: 8px;
    background-color: #fff;
    color: #222;
    transition: border-color 0.18s ease, box-shadow 0.18s ease,
        transform 0.06s ease;
    cursor: pointer;
    margin: 0px 0px 20px;
}

.question-function select:hover {
    border-color: #888;
}

.question-function select:active {
    transform: translateY(0.5px);
}

.question-function input[type="file"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    font-size: 1rem;
    border: 1px solid #bbb;
    border-radius: 8px;
    background-color: #fff;
    color: #222;
    transition: border-color 0.18s ease, box-shadow 0.18s ease,
        transform 0.06s ease;
    cursor: pointer;
    margin: 0px 0px 20px;
}

.question-function input[type="file"]::file-selector-button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background-color: #f5f5f5;
    color: #222;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.06s ease;
}

.question-function input[type="file"]::file-selector-button:hover {
    background-color: #e0e0e0;
}

.question-function input[type="file"]::file-selector-button:active {
    transform: translateY(0.5px);
}

/* success-msg and error-msg */
.success-msg {
    color: green;
    font-weight: bold;
}

.error-msg {
    color: red;
    font-weight: bold;
}