/* 
 * Платформа Назначений - Дополнительные стили
 * Нежный пастельный дизайн
 */

/* КРИТИЧЕСКИ ВАЖНО: Z-INDEX для модальных окон Bootstrap */
/* Эти стили ОБЯЗАТЕЛЬНЫ для корректной работы модальных окон */

/* Отключаем pointer-events для всех декоративных элементов */
body::before,
body::after,
.decorative-shape,
.stat-card::before,
.card::before,
.card::after,
.quick-action-card::before,
.course-card::after,
.bg-gradient::after {
    pointer-events: none !important;
    z-index: -1 !important;
}

/* Модальные окна должны быть выше всего */
body.modal-open {
    overflow: hidden !important;
}

.modal-backdrop {
    z-index: 1050 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    pointer-events: auto !important;
}

.modal {
    z-index: 1055 !important;
    pointer-events: auto !important;
}

.modal.show {
    display: block !important;
}

.modal-dialog {
    position: relative;
    pointer-events: auto !important;
}

.modal-content {
    position: relative;
    pointer-events: auto !important;
}

/* Убеждаемся, что обычные элементы имеют низкий z-index */
.navbar {
    z-index: 1000 !important;
}

.card,
.btn,
.table,
main,
.container {
    z-index: 1 !important;
}

/* Дополнительные анимации */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Градиентные карточки быстрого доступа */
.quick-action-card {
    border-radius: 24px;
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.quick-action-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

.quick-action-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.quick-action-card h5 {
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.quick-action-card p {
    opacity: 0.95;
    position: relative;
    z-index: 1;
    margin-bottom: 1.5rem;
}

.quick-action-card .btn {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.quick-action-card .btn:hover {
    background: white;
    color: inherit;
    transform: none;
}

/* Цвета для карточек */
.quick-action-primary {
    background: linear-gradient(135deg, #B8A8D8 0%, #9B86C9 100%);
}

.quick-action-success {
    background: linear-gradient(135deg, #81C784 0%, #66BB6A 100%);
}

.quick-action-warning {
    background: linear-gradient(135deg, #FFB74D 0%, #FFA726 100%);
}

.quick-action-info {
    background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 100%);
}

/* Лидерборд */
.leaderboard-item {
    padding: 1rem;
    border-radius: 16px;
    margin-bottom: 0.8rem;
    transition: all 0.3s;
    background: white;
    border: 2px solid transparent;
}

.leaderboard-item:hover {
    background: linear-gradient(135deg, #F8F5FF 0%, #FFF9FC 100%);
    border-color: #B8A8D8;
    transform: translateX(8px);
}

.leaderboard-item.highlight {
    background: linear-gradient(135deg, #E5DCF5 0%, #FFD4E5 100%);
    border-color: #B8A8D8;
}

.rank-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rank-badge.gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
}

.rank-badge.silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    color: white;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #B8732B 100%);
    color: white;
}

.rank-badge.regular {
    background: linear-gradient(135deg, #E5DCF5 0%, #D4C5F0 100%);
    color: #9B86C9;
}

/* Курсы */
.course-card {
    position: relative;
    overflow: hidden;
}

.course-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.7s;
}

.course-card:hover::after {
    left: 100%;
}

.course-progress {
    margin-top: 1.5rem;
}

.course-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.course-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.course-meta-item i {
    color: #B8A8D8;
    font-size: 1.2rem;
}

/* Тесты */
.quiz-question {
    background: linear-gradient(135deg, #F8F5FF 0%, #FFF9FC 100%);
    border-left: 4px solid #B8A8D8;
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.quiz-question:hover {
    box-shadow: 0 8px 24px rgba(184, 168, 216, 0.15);
    transform: translateX(4px);
}

.quiz-answer {
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid #E5DCF5;
    margin-bottom: 0.8rem;
    transition: all 0.3s;
    cursor: pointer;
}

.quiz-answer:hover {
    background: #F8F5FF;
    border-color: #B8A8D8;
    transform: translateX(4px);
}

.quiz-answer input:checked + label {
    background: linear-gradient(135deg, #E5DCF5 0%, #FFD4E5 100%);
    border-color: #B8A8D8;
    font-weight: 600;
}

/* Соревнования */
.competition-card {
    position: relative;
    overflow: hidden;
}

.competition-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    backdrop-filter: blur(10px);
}

.competition-active {
    background: rgba(129, 199, 132, 0.9);
    color: white;
    animation: pulse 2s infinite;
}

.competition-upcoming {
    background: rgba(255, 183, 77, 0.9);
    color: white;
}

.prize-item {
    background: linear-gradient(135deg, #FFF9FC 0%, #F8F5FF 100%);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1rem;
    border-left: 4px solid;
    transition: all 0.3s;
}

.prize-item:hover {
    transform: translateX(8px);
    box-shadow: 0 8px 24px rgba(184, 168, 216, 0.15);
}

.prize-item.place-1 {
    border-left-color: #FFD700;
}

.prize-item.place-2 {
    border-left-color: #C0C0C0;
}

.prize-item.place-3 {
    border-left-color: #CD7F32;
}

/* Бейджи/Достижения */
.badge-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: 20px;
    background: white;
    box-shadow: 0 4px 12px rgba(184, 168, 216, 0.1);
    transition: all 0.3s;
}

.badge-item:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 30px rgba(184, 168, 216, 0.2);
}

.badge-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.badge-earned {
    background: linear-gradient(135deg, #E5DCF5 0%, #FFD4E5 100%);
}

.badge-locked {
    opacity: 0.5;
    filter: grayscale(80%);
}

/* История активности */
.activity-timeline {
    position: relative;
    padding-left: 40px;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #B8A8D8 0%, #FFD4E5 100%);
    border-radius: 4px;
}

.activity-item {
    position: relative;
    padding-bottom: 2rem;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -35px;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #B8A8D8 0%, #9B86C9 100%);
    border: 4px solid white;
    box-shadow: 0 0 0 4px rgba(184, 168, 216, 0.2);
}

/* Статистика в карточках */
.stat-icon {
    font-size: 3rem;
    opacity: 0.9;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.stat-label {
    font-size: 0.9rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Формы улучшенные */
.form-floating > label {
    color: #999;
}

.form-floating > .form-control:focus ~ label {
    color: #B8A8D8;
}

/* Декоративные элементы */
.decorative-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.05;
    pointer-events: none;
}

.decorative-shape-1 {
    width: 300px;
    height: 300px;
    background: #B8A8D8;
    top: -150px;
    right: -150px;
}

.decorative-shape-2 {
    width: 200px;
    height: 200px;
    background: #FFD4E5;
    bottom: -100px;
    left: -100px;
}

/* Пустые состояния */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 5rem;
    color: #E5DCF5;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    color: #9B86C9;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #999;
}

/* Загрузчики */
.spinner-custom {
    width: 40px;
    height: 40px;
    border: 4px solid #E5DCF5;
    border-top-color: #B8A8D8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Медиа-запросы */
@media (max-width: 992px) {
    .quick-action-card {
        min-height: 180px;
    }
    
    .stat-value {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .quick-action-card {
        min-height: 160px;
        padding: 1.5rem;
    }
    
    .leaderboard-item {
        padding: 0.8rem;
    }
    
    .rank-badge {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Улучшения для печати */
@media print {
    .navbar, .toast-container, .btn {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
