/* static/css/style.css */

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f6f9;
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: #1e293b;
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

header h1 {
    margin: 0;
    font-size: 28px;
}

header a {
    color: #a5b4fc;
    text-decoration: none;
    float: right;
    margin-top: 10px;
    font-weight: bold;
}

main {
    flex: 1;
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

.form-container, .dashboard, .exam-container, .card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

h2 {
    color: #1e293b;
    text-align: center;
    margin-bottom: 10px;
}

p {
    text-align: center;
    color: #64748b;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary {
    background: #4f46e5;
    color: white;
}

.btn-primary:hover {
    background: #4338ca;
}

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

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

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 18px;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.question-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 5px solid #4f46e5;
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1e293b;
}

.options label {
    display: block;
    margin: 12px 0;
    font-size: 16px;
    cursor: pointer;
}

.radio-option {
    margin-right: 10px;
    transform: scale(1.2);
}

.submit-section {
    text-align: center;
    margin-top: 40px;
}

.error {
    color: #ef4444;
    font-size: 14px;
    display: block;
    margin-top: 5px;
}

.footer-text {
    text-align: center;
    margin-top: 30px;
    color: #64748b;
}

.footer-text a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
}

.footer-text a:hover {
    text-decoration: underline;
}

/* Admin Dashboard Styles */
.subtitle {
    text-align: center;
    color: #64748b;
    font-size: 18px;
    margin-bottom: 30px;
}

.badge {
    background: #e0e7ff;
    color: #4f46e5;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.admin-table th {
    background: #f1f5f9;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #1e293b;
}

.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table tr:hover {
    background: #f8fafc;
}

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

.btn-danger {
    background: #ef4444;
}

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

.student-progress {
    margin-bottom: 20px;
}

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

.student-header h4 {
    margin: 0;
    color: #1e293b;
}

.student-header small {
    color: #64748b;
    font-weight: normal;
}

.score-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.score-list li {
    padding: 12px 0;
    border-bottom: 1px dashed #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.score-list li:last-child {
    border-bottom: none;
}

.category-badge {
    background: #4f46e5;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.date {
    color: #64748b;
    font-size: 14px;
}

.performance {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.excellent { background: #d4edda; color: #155724; }
.good      { background: #d1ecf1; color: #0c5460; }
.average   { background: #fff3cd; color: #856404; }
.poor      { background: #f8d7da; color: #721c24; }

.divider {
    border: none;
    border-top: 2px dashed #e2e8f0;
    margin: 30px 0;
}

.empty-state {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 30px 0;
}

/* === Checkbox-based Password Show/Hide (Clean & Responsive) === */
.input-group-text .form-check {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0 8px;
}

.input-group-text .form-check-input {
    margin: 0;
    flex-shrink: 0;
}

.input-group-text .form-check-label {
    font-size: 0.875rem;
    white-space: nowrap;
    user-select: none;
    color: #64748b;
}

/* Seamless attachment to input */
.input-group > .form-control {
    border-right: 0;
}

.input-group > .input-group-text {
    background: #f8fafc;
    border-left: 0;
}

/* Focus ring includes checkbox area */
.input-group:focus-within .form-control,
.input-group:focus-within .input-group-text {
    border-color: #4f46e5;
}

.input-group:focus-within .input-group-text {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    main {
        margin: 20px auto;
        padding: 10px;
    }

    .form-container, .dashboard, .exam-container, .card {
        padding: 25px;
        border-radius: 10px;
    }

    header h1 {
        font-size: 24px;
    }

    header a {
        float: none;
        display: block;
        margin-top: 15px;
    }

    h2 {
        font-size: 24px;
    }

    .question-text {
        font-size: 17px;
    }

    .btn {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }

    .btn-small {
        width: 100%;
        margin-bottom: 8px;
        margin-right: 0;
    }

    .student-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .score-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .performance {
        align-self: flex-start;
    }

    .input-group-text .form-check-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .input-group-text .form-check {
        padding: 0 6px;
        gap: 5px;
    }

    .input-group-text .form-check-label {
        font-size: 0.75rem;
    }

    .input-group-text .form-check-input {
        transform: scale(0.9);
    }
}

@media (max-width: 360px) {
    .input-group-text .form-check {
        padding: 0 4px;
        gap: 4px;
    }

    .input-group-text .form-check-label {
        font-size: 0.7rem;
    }
}