/* Стили для карточек уроков и преподавателей cards.css*/

/* Сетка для уроков */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Стили для карточек уроков */
.lesson-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    overflow: hidden;
}

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

/* Заголовки карточек уроков */
.lesson-header {
    padding: 1.25rem 1.5rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.lesson-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.lesson-duration {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.4;
}

/* Тело карточек уроков */
.lesson-body {
    padding: 1.25rem 1.5rem;
}

/* Информация о преподавателе в карточке урока */
.teacher-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.teacher-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.teacher-details {
    flex: 1;
}

.teacher-fullname {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.teacher-position {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Рейтинги в карточках уроков */
.rating {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stars {
    display: flex;
    gap: 0.125rem;
}

.star {
    color: #d1d5db;
    font-size: 1.25rem;
    transition: color 0.2s ease;
}

.star.filled {
    color: #fbbf24;
}

.rating-value {
    font-weight: 600;
    color: #1f2937;
    font-size: 1.125rem;
}

/* Описание урока */
.lesson-description {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #e5e7eb;
}

/* Кнопки действий */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #4f46e5;
    color: white;
}

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #4f46e5;
    border: 1px solid #4f46e5;
}

.btn-outline:hover {
    background: #4f46e5;
    color: white;
    transform: translateY(-1px);
}

/* Сообщение о необходимости авторизации */
.auth-required-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #fef3cd;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    color: #92400e;
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* СТИЛИ ДЛЯ ПРЕПОДАВАТЕЛЕЙ В ВИДЕ ГОРИЗОНТАЛЬНЫХ ПОЛОСОК */

.teachers-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.teacher-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.teacher-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e5e7eb;
}

.teacher-rank {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.rank-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.rank-info {
    flex: 1;
}

.teacher-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
}

.teacher-subject {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
    font-weight: 500;
}

.overall-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.rating-value-large {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    min-width: 50px;
    text-align: center;
}

.teacher-body {
    padding: 1.25rem 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.subject-info {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.subject-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.subject-details {
    flex: 1;
}

.subject-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.subject-description {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.4;
}

.teacher-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
}

/* Прогресс-бар для рейтинга */
.rating-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Стили для топ-3 преподавателей */
.teacher-card.gold-rank {
    border: 2px solid #fbbf24;
    background: linear-gradient(135deg, #fffdf4 0%, #ffffff 100%);
    position: relative;
}

.teacher-card.gold-rank .rank-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
}

.teacher-card.gold-rank .teacher-header {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.teacher-card.silver-rank {
    border: 2px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.teacher-card.silver-rank .rank-badge {
    background: linear-gradient(135deg, #e5e7eb 0%, #9ca3af 100%);
}

.teacher-card.silver-rank .teacher-header {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.teacher-card.bronze-rank {
    border: 2px solid #f59e0b;
    background: linear-gradient(135deg, #fef7ed 0%, #ffffff 100%);
}

.teacher-card.bronze-rank .rank-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
}

.teacher-card.bronze-rank .teacher-header {
    background: linear-gradient(135deg, #fffbeb 0%, #fed7aa 100%);
}

/* Бейджи для топ-3 */
.teacher-card.gold-rank::before {
    content: '🥇 ЛУЧШИЙ ПРЕПОДАВАТЕЛЬ';
    position: absolute;
    top: 10px;
    right: -35px;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #92400e;
    padding: 0.5rem 3rem;
    font-size: 0.75rem;
    font-weight: 700;
    transform: rotate(45deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.teacher-card.silver-rank::before {
    content: '🥈 ТОП-2';
    position: absolute;
    top: 10px;
    right: -30px;
    background: linear-gradient(135deg, #e5e7eb 0%, #9ca3af 100%);
    color: #374151;
    padding: 0.5rem 2.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    transform: rotate(45deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.teacher-card.bronze-rank::before {
    content: '🥉 ТОП-3';
    position: absolute;
    top: 10px;
    right: -30px;
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
    color: #92400e;
    padding: 0.5rem 2.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    transform: rotate(45deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

/* Сообщение об отсутствии данных */
.no-data-message {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.no-data-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.no-data-message p {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 500;
}

.no-data-message small {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Стили для формы добавления урока */
.add-lesson-form-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.lesson-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    margin-top: 1rem;
}

.form-actions .btn {
    min-width: 150px;
}

/* Стили для отображения преподавателя в форме */
.teacher-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-weight: 500;
    color: #374151;
}

.teacher-display i {
    color: #6b7280;
    width: 16px;
}

/* Улучшенные стили для формы */
.form-group input[type="hidden"] {
    display: none;
}

/* Подсветка обязательных полей */
.form-group input:required,
.form-group select:required {
    border-left: 3px solid #4f46e5;
}

/* Сообщения о загрузке */
.loading-text {
    color: #6b7280;
    font-style: italic;
}

/* Адаптивность для карточек уроков */
@media (max-width: 768px) {
    .lessons-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .lesson-card {
        margin: 0 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .lesson-duration {
        font-size: 0.8rem;
    }
    
    .lesson-body {
        padding: 1rem;
    }
    
    .teacher-info {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
}

/* Адаптивность для горизонтальных карточек преподавателей */
@media (max-width: 768px) {
    .teacher-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        text-align: left;
    }
    
    .teacher-rank {
        width: 100%;
    }
    
    .overall-rating {
        align-self: flex-end;
    }
    
    .teacher-body {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .teacher-stats {
        order: -1;
    }
    
    .teacher-card.gold-rank::before,
    .teacher-card.silver-rank::before,
    .teacher-card.bronze-rank::before {
        font-size: 0.625rem;
        right: -40px;
        padding: 0.4rem 3rem;
    }
}

@media (max-width: 480px) {
    .teacher-header {
        padding: 1rem;
    }
    
    .teacher-body {
        padding: 1rem;
    }
    
    .rank-badge {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .teacher-name {
        font-size: 1.125rem;
    }
    
    .rating-value-large {
        font-size: 1.25rem;
    }
    
    .subject-info {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .rating-progress {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .progress-bar {
        width: 100%;
    }
    
    .teacher-card.gold-rank::before,
    .teacher-card.silver-rank::before,
    .teacher-card.bronze-rank::before {
        display: none;
    }
}

/* Адаптивность для формы */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .add-lesson-form-container {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .add-lesson-form-container {
        padding: 1rem;
    }
}

/* Стили для кнопки удаления */
.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-danger:active {
    background: #b91c1c;
}

/* Анимация подтверждения удаления */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.btn-danger.shaking {
    animation: shake 0.5s ease-in-out;
}

/* Стили для неактивных кнопок */
.btn-disabled {
    background: #9ca3af !important;
    color: #d1d5db !important;
    cursor: not-allowed !important;
    border: none !important;
}

.btn-disabled:hover {
    background: #9ca3af !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Убедимся, что disabled атрибут работает */
.btn:disabled {
    background: #9ca3af !important;
    color: #d1d5db !important;
    cursor: not-allowed !important;
    border: none !important;
    opacity: 0.6;
}

.btn:disabled:hover {
    background: #9ca3af !important;
    transform: none !important;
    box-shadow: none !important;
}