.quiz-master-teacher-dashboard,
.quiz-master-student-dashboard,
.quiz-master-quiz,
.quiz-master-results {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 2.5rem;
    margin: 0;
    color: #2271b1;
}

.dashboard-tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-weight: 500;
}

.tab.active {
    border-bottom: 3px solid #2271b1;
    color: #2271b1;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

.btn-primary {
    background: #2271b1;
    color: white;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-success {
    background: #00a32a;
    color: white;
}

.btn-danger {
    background: #d63638;
    color: white;
}

.quiz-table,
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.quiz-table th,
.quiz-table td,
.results-table th,
.results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.quiz-table th,
.results-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.quizzes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.quiz-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.quiz-card h4 {
    margin: 0 0 10px 0;
    color: #2271b1;
}

.quiz-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.instructions {
    margin-bottom: 20px;
}

.instructions ul {
    margin-left: 20px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.quiz-timer {
    font-size: 1.2rem;
    font-weight: 600;
    color: #d63638;
}

.question-card {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.question-header h3 {
    margin: 0 0 15px 0;
    color: #2271b1;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.option:hover {
    background: #f8f9fa;
}

.option input[type="radio"] {
    margin-right: 10px;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.result-summary {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #2271b1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    font-weight: 600;
}

.print-button {
    text-align: center;
    margin-top: 20px;
}

@media print {
    .quiz-navigation,
    .print-button {
        display: none;
    }
}


/* Certificate Styles */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.certificate-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    border-left: 4px solid #ddd;
}

.certificate-card.approved {
    border-left-color: #00a32a;
}

.certificate-card.pending {
    border-left-color: #ffb900;
}

.certificate-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.certificate-header h4 {
    margin: 0;
    color: #2271b1;
    flex: 1;
}

.certificate-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-approved {
    background: #d1f7e4;
    color: #00a32a;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.certificate-details p {
    margin: 5px 0;
    color: #555;
}

.certificate-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pending-notice {
    font-size: 0.9rem;
    color: #666;
    margin: 10px 0 0 0;
    font-style: italic;
}

/* Certificate Management */
.certificate-management {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.certificate-settings {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.certificate-settings h4 {
    margin-top: 0;
    color: #2271b1;
}

.certificate-approval-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.certificate-approval-table th,
.certificate-approval-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.certificate-approval-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.no-certificates {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .certificate-management {
        grid-template-columns: 1fr;
    }
    
    .certificates-grid {
        grid-template-columns: 1fr;
    }
    
    .certificate-actions {
        flex-direction: column;
    }
    
    .certificate-header {
        flex-direction: column;
        gap: 10px;
    }
}

/* Template Preview Styles */
.template-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.template-preview {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-preview.active {
    border-color: #2271b1;
    background: #f0f6fc;
}

.template-preview:hover {
    border-color: #2271b1;
}

.template-thumbnail {
    height: 100px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.template-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.template-preview input[type="radio"] {
    margin: 8px 0;
}

.btn-preview-template {
    background: #f0f0f1;
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    width: 100%;
}

.btn-preview-template:hover {
    background: #e0e0e0;
}

.current-signature {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.current-signature img {
    margin-bottom: 8px;
}

/* Modal improvements */
.modal-content {
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

/* Certificate status improvements */
.certificate-pending {
    color: #856404;
    background: #fff3cd;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}