/**
 * Custom CSS cho Quiz Generator
 */

/* Reset và cấu hình chung */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --primary-gradient: linear-gradient(135deg, #777 0%, #EEE 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar-brand {
    font-size: 1.3rem;
    font-weight: 600;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    border-bottom: none;
}

/* Form elements */
textarea.form-control {
    resize: vertical;
    font-size: 0.95rem;
    line-height: 1.6;
}

textarea.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Loading */
#loadingIndicator {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Question display */
.question-item {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.question-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.question-number {
    background: linear-gradient(135deg, var(--primary-color), #0a58ca);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.question-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.6;
    margin-bottom: 15px;
}

.answer-option {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    cursor: default;
}

.answer-option:hover {
    background: #e9ecef;
}

.answer-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    font-weight: 700;
    margin-right: 12px;
    color: #495057;
}

.answer-text {
    flex: 1;
    line-height: 1.5;
}

/* Đáp án đúng */
.answer-option.correct {
    background: linear-gradient(135deg, #d1f4e0, #b8f0d6);
    border-color: var(--success-color);
}

.answer-option.correct .answer-label {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.correct-badge {
    background: var(--success-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 10px;
}

/* Empty state */
#emptyState i {
    color: #adb5bd;
}

/* Character counter */
#charCount {
    font-weight: 600;
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 991px) {
    .question-item {
        padding: 15px;
    }
    
    .question-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
}

/* Alert messages */
.alert {
    border-radius: 10px;
    border: none;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da, #f1aeb5);
}

.alert-success {
    background: linear-gradient(135deg, #d1e7dd, #badbcc);
}

/* Copy button animation */
.btn-copy-success {
    background: var(--success-color) !important;
    color: white !important;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Scrollbar customization */
textarea::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

textarea::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Print styles */
@media print {
    .navbar,
    footer,
    .col-lg-5,
    #resultActions {
        display: none !important;
    }
    
    .col-lg-7 {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .question-item {
        page-break-inside: avoid;
    }
}
.bg-demo {
    background: var(--primary-gradient) !important; 
    color: white !important; 
}