/* style.css - Professional and Standardized Styling for Proctored Exam System */

/* --- Global Reset and Typography --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

h1, h2, h3 {
    color: #1e3a8a; /* Dark Blue */
    margin-top: 0;
}

/* --- General Containers and Layout --- */
.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    margin: 50px auto;
    box-sizing: border-box;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4b5563;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #3b82f6; /* Blue focus ring */
    outline: none;
}

/* --- Buttons --- */
button, .btn {
    background-color: #3b82f6; /* Primary Blue */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.1s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button:hover, .btn:hover {
    background-color: #2563eb;
}

button:active, .btn:active {
    transform: scale(0.99);
}

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

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

.btn-small {
    padding: 8px 12px;
    font-size: 14px;
}

.btn-success {
    background-color: #10b981;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-warning {
    background-color: #f59e0b;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-primary {
    background-color: #3b82f6;
}

.btn-primary:hover {
    background-color: #2563eb;
}

/* --- Alerts and Messages --- */
.error, .alert-danger {
    color: #991b1b;
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

.success, .alert-success {
    color: #065f46;
    background-color: #d1fae5;
    border: 1px solid #6ee7b7;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

/* --- Admin Dashboard/List Styles --- */
.admin-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #4b5563;
}

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

.actions a {
    margin-right: 10px;
    color: #3b82f6;
    text-decoration: none;
}

/* --- Exam Interface Styles (Focus of the Restyle) --- */
.exam-interface {
    display: flex;
    max-width: 1400px;
    margin: 20px auto;
    gap: 20px;
    padding: 0 20px;
}

.exam-main {
    flex: 3;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.exam-sidebar {
    flex: 1;
    min-width: 250px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 20px;
    height: fit-content;
    border-left: 4px solid #3b82f6; /* Accent border */
}

#timer {
    font-size: 2.5em;
    font-weight: 700;
    color: #ef4444; /* Red for urgency */
    text-align: center;
    margin: 10px 0 20px 0;
    padding: 10px;
    border: 2px solid #fca5a5;
    border-radius: 6px;
    background-color: #fef2f2;
}

#webcam-feed {
    width: 100%;
    border: 3px solid #3b82f6;
    border-radius: 8px;
    margin-bottom: 15px;
    display: block;
}

.proctoring-info {
    font-size: 0.85em;
    color: #6b7280;
    text-align: center;
    margin-bottom: 20px;
}

/* Question Styling */
.question-container {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: #f9fafb;
}

.question-container h3 {
    color: #1e3a8a;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.question-container p {
    font-size: 1.1em;
    margin-bottom: 20px;
}

/* Answer Options */
.question-container label {
    display: block;
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.question-container label:hover {
    background-color: #eff6ff;
}

.question-container input[type="radio"],
.question-container input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.question-container textarea,
.question-container input[type="text"] {
    min-height: 100px;
    resize: vertical;
}

/* Navigation Buttons */
.navigation-buttons {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.navigation-buttons button {
    width: auto;
    flex-grow: 1;
    padding: 10px 15px;
}

#submit-exam-btn {
    background-color: #10b981; /* Green for submission */
}

#submit-exam-btn:hover {
    background-color: #059669;
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.p-10 { padding: 10px; }
.bg-light { background-color: #f8f9fa; }
.border { border: 1px solid #dee2e6; }
.rounded { border-radius: 0.25rem; }

/* --- Status Indicators --- */
.status-completed {
    color: #065f46;
    font-weight: 600;
    padding: 4px 8px;
    background-color: #d1fae5;
    border-radius: 4px;
}

.status-in-progress {
    color: #92400e;
    font-weight: 600;
    padding: 4px 8px;
    background-color: #fef3c7;
    border-radius: 4px;
}

.status-pending {
    color: #6b7280;
    font-weight: 600;
    padding: 4px 8px;
    background-color: #f3f4f6;
    border-radius: 4px;
}

.status-processing {
    color: #1e40af;
    font-weight: 600;
    padding: 4px 8px;
    background-color: #dbeafe;
    border-radius: 4px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* --- Status Indicators --- */
.status-completed {
    color: #065f46;
    font-weight: 600;
    padding: 4px 8px;
    background-color: #d1fae5;
    border-radius: 4px;
}

.status-in-progress {
    color: #92400e;
    font-weight: 600;
    padding: 4px 8px;
    background-color: #fef3c7;
    border-radius: 4px;
}

.status-pending {
    color: #6b7280;
    font-weight: 600;
    padding: 4px 8px;
    background-color: #f3f4f6;
    border-radius: 4px;
}

.status-processing {
    color: #1e40af;
    font-weight: 600;
    padding: 4px 8px;
    background-color: #dbeafe;
    border-radius: 4px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.btn-small {
    padding: 8px 12px;
    font-size: 14px;
}

.btn-success {
    background-color: #10b981;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-warning {
    background-color: #f59e0b;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-primary {
    background-color: #3b82f6;
}

.btn-primary:hover {
    background-color: #2563eb;
}
