/* /var/www/html/edu.macmasta.ru/main.css */
/* Основные стили MacMasta School */
/* Username: starmynd, Password: Viewsonic89 */

/* === ОБЩИЕ СТИЛИ === */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 15px;
    --box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* === КНОПКИ === */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

/* === КАРТОЧКИ === */
.card {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

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

/* === LOGIN PAGE === */
.login-body {
    background: var(--primary-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.demo-users {
    background: var(--light-color);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
}

/* === HERO SECTION === */
.hero {
    background: var(--primary-gradient);
    color: white;
    padding: 100px 0;
}

.stats-counter {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* === FEATURES === */
.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.feature-icon:hover {
    transform: scale(1.1);
}

/* === PRICE CARDS === */
.price-card {
    border: 2px solid #e9ecef;
    transition: var(--transition);
    border-radius: var(--border-radius);
}

.price-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* === NAVBAR === */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-primary {
    background: var(--primary-gradient) !important;
}

.navbar-light .navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

/* === DASHBOARD === */
.dashboard-card {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

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

.stat-card {
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--border-radius);
}

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

.notification-badge {
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
}

.progress-ring {
    width: 80px;
    height: 80px;
}

.achievement-badge {
    background: #ffd93d;
    color: #333;
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
    margin: 2px;
}

/* === LESSONS === */
.lesson-card {
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.lesson-card:hover {
    border-left-color: var(--secondary-color);
    background-color: rgba(102, 126, 234, 0.05);
}

/* === MARKDOWN CONTENT === */
.markdown-content {
    line-height: 1.7;
    color: var(--text-color);
}

.markdown-content .lesson-h1 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.markdown-content .lesson-h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
    padding-left: 1rem;
    border-left: 4px solid var(--secondary-color);
}

.markdown-content .lesson-h3 {
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
}

.markdown-content .lesson-list {
    margin: 1rem 0;
    padding-left: 2rem;
}

.markdown-content .lesson-list li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.markdown-content .lesson-code {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #e83e8c;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    border: 1px solid #dee2e6;
}

.markdown-content .lesson-code-block {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #f7fafc;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #4a5568;
    overflow-x: auto;
}

.markdown-content .lesson-code-block code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.markdown-content p {
    margin: 1rem 0;
    text-align: justify;
}

.markdown-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

.markdown-content em {
    color: var(--secondary-color);
    font-style: italic;
}

.markdown-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.markdown-content a:hover {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

/* === LESSON SIDEBAR === */
.lesson-list {
    max-height: 400px;
    overflow-y: auto;
}

.lesson-item {
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.lesson-item:hover {
    border-color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.05);
}

.lesson-item-content {
    background: transparent;
    transition: all 0.2s ease;
}

.lesson-item:hover .lesson-item-content {
    background: rgba(255, 255, 255, 0.8);
}

.lesson-icon {
    font-size: 1.2rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lesson-details {
    min-width: 0; /* Позволяет text-truncate работать в flex */
}

.lesson-title {
    font-size: 0.9rem;
    line-height: 1.3;
    word-wrap: break-word;
    color: var(--text-color);
}

.lesson-item:hover .lesson-title {
    color: var(--primary-color);
}

.lesson-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.lesson-thumb {
    width: 40px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
}

.lesson-thumb-placeholder {
    width: 40px;
    height: 30px;
    background: var(--bg-secondary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* === VIDEO STYLING === */
.lesson-video {
    margin-bottom: 2rem;
}

.video-wrapper {
    width: 100%;
    height: 500px;
    min-height: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lesson-video .ratio {
    min-height: 500px;
    height: 500px;
}

.lesson-iframe {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border-radius: 8px;
    border: none;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
}

.video-provider-badge {
    z-index: 10;
}

.lesson-video video {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* === SCHEDULE MODAL === */
.lesson-select {
    max-height: 200px;
    overflow-y: auto;
    resize: vertical;
}

.lesson-select option {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-select option:hover {
    background-color: var(--primary-color);
    color: white;
}

.modal-dialog {
    max-width: 600px;
}

.modal-body .form-text {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.lesson-status-completed {
    color: var(--success-color);
    font-weight: bold;
}

.lesson-status-pending {
    color: var(--warning-color);
    font-weight: bold;
}

.lesson-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--light-color);
    overflow: hidden;
}

.lesson-progress-bar {
    background: var(--primary-gradient);
    height: 100%;
    transition: width 0.5s ease;
}

/* === TESTS === */
.test-card {
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.test-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.test-score-excellent {
    color: var(--success-color);
    font-weight: bold;
}

.test-score-good {
    color: var(--info-color);
    font-weight: bold;
}

.test-score-poor {
    color: var(--danger-color);
    font-weight: bold;
}

/* === TEST PAGE STYLES === */
.test-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.question-card {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.question-card.current {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.question-number {
    background: var(--primary-gradient);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.option-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.option-card:hover {
    border-color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.05);
}

.option-card.selected {
    border-color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.1);
}

.option-card.correct {
    border-color: var(--success-color);
    background-color: rgba(40, 167, 69, 0.1);
}

.option-card.incorrect {
    border-color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
}

.timer {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-gradient);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
}

.timer.warning {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    animation: pulse 1s infinite;
}

.progress-bar-custom {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
}

.results-summary {
    border-radius: var(--border-radius);
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
}

.question-review {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    margin-bottom: 1rem;
    padding: 1rem;
}

.navigation-buttons {
    position: sticky;
    bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: 0 -2px 15px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
}

.test-navigation {
    position: sticky;
    top: 80px;
    background: white;
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.question-nav-btn {
    width: 40px;
    height: 40px;
    margin: 2px;
    border: 2px solid #dee2e6;
    background: white;
    color: #333;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.question-nav-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.1);
}

.question-nav-btn.answered {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.question-nav-btn.current {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

/* === ADMIN PANEL === */
.admin-sidebar {
    background: var(--dark-color);
    min-height: 100vh;
    padding: 0;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    border-radius: 8px;
    margin: 2px 8px;
    transition: var(--transition);
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: var(--primary-color);
    color: white;
}

.admin-header {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
}

.table-actions {
    white-space: nowrap;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 4px;
}

/* === FORMS === */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* === ALERTS === */
.alert {
    border-radius: 10px;
    border: none;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f1b0b7 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #b8daff 100%);
    color: #0c5460;
}

/* === MODALS === */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* === BADGES === */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

.badge-role-admin {
    background: var(--danger-color);
}

.badge-role-teacher {
    background: var(--info-color);
}

.badge-role-student {
    background: var(--success-color);
}

/* === PROGRESS BARS === */
.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--light-color);
}

.progress-bar {
    background: var(--primary-gradient);
}

/* === PAGINATION === */
.page-link {
    color: var(--primary-color);
    border-color: #dee2e6;
}

.page-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background: var(--primary-gradient);
    border-color: var(--primary-color);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero {
        padding: 60px 0;
    }
    
    .stats-counter {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .feature-icon {
        font-size: 2.5rem;
    }
    
    .admin-sidebar {
        min-height: auto;
    }
    
    .timer {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 20px;
        display: block;
        text-align: center;
    }
    
    .question-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }
    
    .test-navigation {
        position: relative;
        top: auto;
    }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* === LOADING SPINNER === */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === UTILITIES === */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.border-gradient {
    border: 2px solid;
    border-image: var(--primary-gradient) 1;
}

.shadow-custom {
    box-shadow: var(--box-shadow);
}

.rounded-custom {
    border-radius: var(--border-radius);
}

/* === УПРАВЛЕНИЕ ТЕСТАМИ === */
.question-block {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background: #f8f9fa;
    transition: var(--transition);
}

.question-block:hover {
    border-color: var(--primary-color);
    background: #fff;
}

.question-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.drag-handle {
    cursor: move;
    color: #6c757d;
    transition: var(--transition);
}

.drag-handle:hover {
    color: var(--primary-color);
}

.option-input {
    position: relative;
}

.correct-marker {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success-color);
    font-size: 1.2em;
}

/* Стили для редактирования тестов */
.test-form-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}

.question-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.question-delete-btn {
    opacity: 0.7;
    transition: var(--transition);
}

.question-delete-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Анимации для добавления/удаления вопросов */
.question-block {
    opacity: 0;
    animation: slideInUp 0.3s ease-out forwards;
}

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

/* Улучшенные стили форм */
.form-section-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

/* Стили для multiple select */
.form-select[multiple] {
    min-height: 100px;
}

.form-select[multiple]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Стили для списка существующих тестов */
.existing-tests {
    max-height: 600px;
    overflow-y: auto;
}

.test-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background: white;
    transition: var(--transition);
}

.test-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.test-item h6 {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.test-meta {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.test-actions {
    display: flex;
    gap: 5px;
}

.test-actions .btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 5px 8px;
}