/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 400px;
    width: 100%;
}

.dashboard-container {
    max-width: 800px;
    width: 100%;
    background: white;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 16px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input.error {
    border-color: #e74c3c;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    margin-top: 10px;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
    display: inline-block;
    margin-left: 10px;
}

/* Alert Styles */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Link Styles */
.link {
    text-align: center;
    margin-top: 20px;
}

.link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.link a:hover {
    text-decoration: underline;
}

/* Dashboard Styles */
.welcome-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.welcome-section h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.welcome-section p {
    font-size: 16px;
    opacity: 0.9;
}

.user-info {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.user-info h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.info-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.info-label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.info-value {
    color: #333;
    font-size: 16px;
    word-break: break-all;
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container, .dashboard-container {
        padding: 30px 20px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .navigation {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-small {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e1e1;
    color: #666;
    font-size: 14px;
}

/* Form validation styles */
.form-group.has-error input {
    border-color: #e74c3c;
}

.form-group.has-success input {
    border-color: #27ae60;
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

.success-message {
    color: #27ae60;
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

/* ========================================
   QUIZ SYSTEM STYLES
======================================== */

/* Quiz Grid and Cards */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.quiz-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quiz-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.quiz-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
}

.quiz-card-body {
    padding: 20px;
}

/* Quiz Taking Interface */
.quiz-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.question-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.question-header {
    background: linear-gradient(135deg, #8affc8 0%, #8affc8 100%);
    color: white;
    padding: 20px;
}

.question-body {
    padding: 25px;
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 15px;
}

/* Answer Options */
.answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    position: relative;
    cursor: pointer;
}

.option-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.option-label:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.option-item input[type="radio"]:checked + .option-label {
    background: #e3f2fd;
    border-color: #667eea;
    color: #1565c0;
}

.option-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #adb5bd;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.option-item input[type="radio"]:checked + .option-label .option-marker {
    border-color: #667eea;
    background: #667eea;
}

.option-item input[type="radio"]:checked + .option-label .option-marker::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

/* Text Answers */
.text-answer {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    resize: vertical;
    min-height: 80px;
}

.text-answer:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* True/False Options */
.true-false-options {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.tf-option {
    flex: 1;
    max-width: 200px;
}

/* Progress and Timer */
.progress-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.timer-container {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(255,107,107,0.3);
}

.timer {
    font-size: 18px;
    font-weight: 600;
}

.timer.warning {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Question Navigation */
.question-navigation {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.question-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.question-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
}

.question-dot.answered {
    background: #28a745;
}

.question-dot.current {
    background: #667eea;
    transform: scale(1.3);
}

/* Navigation Buttons */
.btn-nav {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-prev {
    background: #6c757d;
    color: white;
}

.btn-prev:hover {
    background: #5a6268;
}

.btn-next {
    background: #667eea;
    color: white;
}

.btn-next:hover {
    background: #5a67d8;
}

.btn-complete {
    background: #28a745;
    color: white;
}

.btn-complete:hover {
    background: #218838;
}

/* Quiz Results */
.score-circle {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #667eea 0%, #667eea 70%, #e9ecef 70%, #e9ecef 100%);
}

.score-inner {
    width: 90px;
    height: 90px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-value {
    font-size: 24px;
    font-weight: 700;
}

.score-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

/* Quiz Management */
.quiz-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quiz-table table {
    width: 100%;
    border-collapse: collapse;
}

.quiz-table th,
.quiz-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.quiz-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.quiz-table tr:hover {
    background: #f8f9fa;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-completed {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-failed {
    background: #ffebee;
    color: #c62828;
}

.status-not-attempted {
    background: #e3f2fd;
    color: #1976d2;
}

.status-in-progress {
    background: #fff3e0;
    color: #f57c00;
}

/* Admin Action Buttons */
.actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    min-width: 120px;
}

.btn-icon {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
    text-decoration: none;
    color: white;
    font-weight: 600;
    width: 100%;
    text-align: center;
    white-space: nowrap;
}

.btn-edit {
    background: #17a2b8;
}

.btn-edit:hover {
    background: #138496;
}

.btn-questions {
    background: #28a745;
}

.btn-questions:hover {
    background: #218838;
}

.btn-toggle {
    background: #ffc107;
    color: #212529;
}

.btn-toggle:hover {
    background: #e0a800;
}

.btn-delete {
    background: #dc3545;
}

.btn-delete:hover {
    background: #c82333;
}

/* Stats and Metrics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number,
.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state h3 {
    margin-bottom: 15px;
    color: #333;
}

/* Form Controls */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Responsive Quiz Styles */
@media (max-width: 768px) {
    .quiz-grid {
        grid-template-columns: 1fr;
    }
    
    .quiz-info,
    .score-display {
        flex-direction: column;
        gap: 15px;
    }
    
    .true-false-options {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .question-dots {
        gap: 6px;
    }
    
    .question-dot {
        width: 10px;
        height: 10px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .btn-nav {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .actions {
        min-width: 100px;
    }
    
    .btn-icon {
        font-size: 10px;
        padding: 3px 6px;
    }
}