/* Basic Styles */
html, body {
    height: 100%;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* More modern font */
    background-color: #e9ebee; /* Slightly darker background */
    margin: 0;
    padding: 20px; /* Consistent padding */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    line-height: 1.6;
    color: #333;
}

.wrapper {
    background-color: #fff;
    padding: 40px; /* Increased padding */
    border-radius: 12px; /* Slightly more rounded corners */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* More prominent shadow */
    width: 90%;
    max-width: 1400px; /* Even wider max-width for desktop */
    text-align: left;
    margin-top: 30px; /* Increased top margin */
    margin-bottom: 30px;
}

/* Media queries for responsiveness */
@media (max-width: 1024px) {
    .wrapper {
        max-width: 95%;
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .wrapper {
        max-width: 100%;
        padding: 20px;
        margin-top: 0;
        border-radius: 0;
    }
    body {
        padding: 10px;
        align-items: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    .wrapper {
        padding: 15px;
    }
}

/* Typography */
h1, h2, h3, h4 {
    color: #2c3e50; /* Darker heading color */
    margin-bottom: 25px;
    font-weight: 600;
}
h2 {
    font-size: 2.2em;
    margin-bottom: 30px;
    text-align: center;
}
h3 {
    font-size: 1.8em;
    margin-bottom: 20px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}
p {
    color: #555;
    margin-bottom: 15px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #444;
    font-weight: 500;
}

.form-control {
    width: calc(100% - 22px); /* Adjusted for padding and border */
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    outline: none;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 8px;
    display: block;
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 12px 25px; /* Larger padding */
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1.05em;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

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

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

.btn-danger {
    background-color: #dc3545;
}

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

.btn-info {
    background-color: #17a2b8;
}

.btn-info:hover {
    background-color: #138496;
}

/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 1em;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Dashboard Sections (Admin/Teacher) */
.dashboard-section {
    margin-bottom: 40px;
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background-color: #fefefe;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dashboard-section h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.add-btn {
    margin-bottom: 25px;
    background-color: #28a745;
}
.add-btn:hover {
    background-color: #218838;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate; /* Use separate for border-radius */
    border-spacing: 0;
    margin-top: 25px;
    border-radius: 8px; /* Rounded corners for table */
    overflow: hidden; /* Ensures border-radius is visible */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

table th,
table td {
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    text-align: left;
}

table th {
    background-color: #007bff;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
}

table tr:nth-child(even) {
    background-color: #f8f9fa;
}

table tr:hover {
    background-color: #e9f5ff; /* Light blue hover effect */
}

.action-links a {
    margin-right: 10px;
    text-decoration: none;
    color: #007bff;
    font-weight: 500;
}
.action-links a:hover {
    text-decoration: underline;
}

.question-image-thumb {
    max-width: 60px;
    height: auto;
    border-radius: 4px;
}

/* Specific styles for student dashboard exam items */
.exam-item {
    background-color: #fefefe;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.exam-item h4 {
    color: #007bff;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.exam-item p {
    margin-bottom: 8px;
    color: #555;
}

.exam-item .btn {
    margin-top: 15px;
}

/* Styles for take_exam.php */
.timer-container {
    background-color: #ffeeba;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 30px;
    border: 1px solid #ffc107;
}

.question-block {
    background-color: #fefefe;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.question-block h4 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.3em;
    margin-bottom: 15px;
}

.options-list {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.options-list li {
    margin-bottom: 12px;
}

.options-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1.1em;
    color: #444;
}

.options-list input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2); /* Slightly larger radio buttons */
}

.bookmark-btn {
    background-color: #6c757d; /* Grey for unbookmarked */
    color: #fff;
    padding: 8px 15px;
    font-size: 0.9em;
    border-radius: 5px;
    margin-top: 15px;
}

.bookmark-btn.bookmarked {
    background-color: #28a745; /* Green for bookmarked */
}

/* Styles for detailed reports */
.report-summary {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.question-block .correct-answer {
    color: #28a745;
    font-weight: bold;
}
.question-block .incorrect-answer {
    color: #dc3545;
    font-weight: bold;
}
.question-block .chosen-answer {
    font-style: italic;
    color: #007bff;
}
.explanation {
    margin-top: 20px;
    padding: 15px;
    background-color: #e2f0cb;
    border-left: 5px solid #8bc34a;
    border-radius: 5px;
}

.profile-photo-preview {
    max-width: 180px;
    height: auto;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    display: block;
    border: 3px solid #007bff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
