/* Light Mode (default) */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #ffffff; /* white background */
    color: #000000; /* black text */
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #222426; /* almost black background */
    color: #f0f0f0; /* almost white text */
}

h2 {
    color: inherit; /* Use inherited color (black or white depending on mode) */
    margin-top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark-mode h2 {
    color: white; /* white text in dark mode */
}

.container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    transition: all 0.5s ease; /* Smooth transition */
}

.tab, .card {
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tab {
    border: 1px solid #ccc;
    flex: 1; /* Allow tabs to grow */
    min-width: 300px; /* Minimum width */
}

.card {
    border: 1px solid #ddd;
    margin: 10px 0;
    background-color: #ffffff; /* white background in light mode */
    color: #000000; /* black text in light mode */
}

.input-row {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
}

#examSelect, input {
    min-width: 150px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 1%;
    box-sizing: border-box;
}

button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background-color: #007BFF; /* blue */
    color: white;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3; /* darker blue */
}

.edit-button {
    background-color: orange;
}

.delete-button {
    background-color: red;
}

.exam-item, .answer-key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 10px;
}

.button-container {
    margin-left: auto;
}

.take-exam {
    color: blue;
    text-decoration: underline;
}

.options {
    margin-left: 10px;
}

.radio-button {
    display: inline-block;
    margin: 0 5px 20px;
    cursor: pointer;
    text-align: center;
}

input[type="radio"] {
    display: none; /* Hide the default radio button */
}

.radio-button span {
    padding: 5px 10px;
    border: 1px solid #007BFF;
    border-radius: 5px;
    background-color: white;
    color: #007BFF;
    transition: background-color 0.3s, color 0.3s;
}

input[type="radio"]:checked + span {
    background-color: #007BFF;
    color: white;
    border-color: #0056b3;
}

.radio-button span:hover {
    background-color: #f0f0f0;
}

/* Dark Mode (when toggled) */
body.dark-mode .card {
    background-color: #1f1f1f; /* dark background for cards in dark mode */
    color: #f0f0f0; /* light text for cards in dark mode */
}

body.dark-mode .toggle-dark-mode {
    background-color: #007BFF; /* blue background for the toggle button */
}

body.dark-mode .toggle-dark-mode:before {
    transform: translateX(25px);
    background-color: white; /* Move the toggle to the right */
}

body.dark-mode button {
    background-color: #007BFF; /* Light background for buttons in dark mode */
    color: white; /* Dark text for buttons in dark mode */
}

body.dark-mode .edit-button {
    background-color: #a86809;
}

body.dark-mode .delete-button {
    background-color: #f44336;
}

body.dark-mode .take-exam {
    color: blue;
}

body.dark-mode .radio-button span {
    background-color: #333; /* dark background for radio button */
    color: #007BFF;
}

body.dark-mode .radio-button span:hover {
    background-color: #444; /* darker grey on hover */
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .input-row {
        flex-direction: column;
    }
    input, select, button {
        margin-right: 0;
        width: 100%;
    }
    .container {
        flex-direction: column;
    }
}

/* Toggle Button Styles */
.toggle-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #007BFF;
}

.toggle-dark-mode {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 25px;
    background-color: #898989; /* gray background */
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-dark-mode:before {
    content: '';
    position: absolute;
    top: 2.5px;
    left: 2.5px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}
