/* HSG Tin Học AI Tutor - Custom Styles */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.view-container {
    animation: fadeIn 0.3s;
}

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

/* Cards */
.card {
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

/* Topic Cards */
.topic-card {
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.topic-card:hover {
    border-left-color: var(--primary-color);
    background-color: #f0f0f0;
}

.mastery-bar {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.mastery-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

.mastery-low {
    background: linear-gradient(90deg, #dc3545, #fd7e14);
}

.mastery-medium {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.mastery-high {
    background: linear-gradient(90deg, #20c997, #198754);
}

/* Code Editor */
#code-editor {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    background-color: #f8f9fa;
}

#code-editor:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Exercise Content */
.exercise-description {
    line-height: 1.8;
}

.exercise-description pre {
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid var(--info-color);
}

/* Test Results */
.test-result {
    padding: 10px;
    margin: 5px 0;
    border-radius: 6px;
    border-left: 4px solid;
}

.test-result.passed {
    background-color: #d1e7dd;
    border-left-color: var(--success-color);
}

.test-result.failed {
    background-color: #f8d7da;
    border-left-color: var(--danger-color);
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Stats */
.stat-box {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 15px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Exercise List */
.exercise-item {
    padding: 12px;
    margin: 8px 0;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.2s;
    background-color: white;
}

.exercise-item:hover {
    background-color: #e7f3ff;
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.difficulty-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
}

.difficulty-1 {
    background-color: #d1e7dd;
    color: #0f5132;
}

.difficulty-2 {
    background-color: #fff3cd;
    color: #664d03;
}

.difficulty-3 {
    background-color: #f8d7da;
    color: #842029;
}

/* Progress Bars */
.progress {
    height: 24px;
    border-radius: 12px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 12px;
    font-weight: 600;
    transition: width 0.6s ease;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    #code-editor {
        font-size: 12px;
    }

    .stat-value {
        font-size: 2rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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

/* Exam Timer */
.exam-timer {
    position: fixed;
    top: 70px;
    right: 20px;
    background-color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.exam-timer.warning {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
}

.exam-timer.danger {
    background-color: #f8d7da;
    border: 2px solid #dc3545;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Hint Box */
.hint-box {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
}

/* Feedback Box */
.feedback-box {
    background-color: #cfe2ff;
    border-left: 4px solid #0d6efd;
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
}

/* Code Block */
pre code {
    display: block;
    padding: 15px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}

/* Topic Progress Table */
.topic-progress-table {
    width: 100%;
}

.topic-progress-table tr {
    border-bottom: 1px solid #dee2e6;
}

.topic-progress-table td {
    padding: 12px 8px;
}

/* Mastery Badge */
.mastery-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.mastery-beginner {
    background-color: #f8d7da;
    color: #842029;
}

.mastery-intermediate {
    background-color: #fff3cd;
    color: #664d03;
}

.mastery-advanced {
    background-color: #d1e7dd;
    color: #0f5132;
}

.mastery-expert {
    background-color: #cfe2ff;
    color: #084298;
}

/* Action Buttons in Chatbot */
.action-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #007bff;
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.action-btn-practice {
    background: #28a745;
}

.action-btn-practice:hover {
    background: #218838;
}

.action-btn-review_spaced {
    background: #dc3545;
}

.action-btn-review_spaced:hover {
    background: #c82333;
}

.action-btn-review {
    background: #ffc107;
    color: #000;
}

.action-btn-review:hover {
    background: #e0a800;
}

.action-btn-example {
    background: #17a2b8;
}

.action-btn-example:hover {
    background: #138496;
}

.action-btn-navigate {
    background: #6c757d;
}

.action-btn-navigate:hover {
    background: #5a6268;
}
