/**
 * Стили для исправления layout-блоков
 * 
 * Корректирует расположение элементов на главной странице,
 * обеспечивает правильное отображение уведомлений и блоков
 */

/* === Исправления для главной страницы === */

/* Основной контейнер для блоков на главной странице */
.main-content-blocks {
    display: grid;
    gap: 1.5rem;
    padding: 1.5rem 0;
}

/* Сетка для планшетов и выше */
@media (min-width: 768px) {
    .main-content-blocks {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-content-blocks .full-width {
        grid-column: 1 / -1; /* Для блоков на всю ширину */
    }
}

/* Сетка для больших экранов */
@media (min-width: 1024px) {
    .main-content-blocks {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Информационные карточки */
.info-card {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.info-card-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #e0e0e0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-card-header i {
    color: #4a90e2;
}

.info-card-body {
    flex: 1;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.info-card-footer {
    margin-top: auto;
}

/* Блок статистики */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-card {
    background-color: #2a2a2a;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4a90e2;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Блок недавней активности */
.activity-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #3a3a3a;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.activity-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background-color: rgba(74, 144, 226, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a90e2;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    color: #e0e0e0;
    margin-bottom: 0.25rem;
}

.activity-time {
    color: #9ca3af;
    font-size: 0.75rem;
}

/* === Система уведомлений === */

/* Контейнер уведомлений */
.notifications-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    width: 350px;
    max-width: 100%;
    pointer-events: none;
}

.notification {
    background-color: #252525;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #4a90e2;
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    border-left-color: #4caf50;
}

.notification.error {
    border-left-color: #f44336;
}

.notification.warning {
    border-left-color: #ff9800;
}

.notification.info {
    border-left-color: #4a90e2;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.notification-title {
    font-weight: 500;
    color: #e0e0e0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-title i {
    color: inherit;
}

.notification-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
}

.notification-body {
    color: #9ca3af;
}

/* === Popup уведомлений === */
.notifications-popup {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-height: 400px;
    overflow: hidden;
    background-color: #252525;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
    margin-top: 0.5rem;
    z-index: 40;
    display: none;
}

.notifications-popup.active {
    display: block;
}

.notifications-header {
    padding: 1rem;
    border-bottom: 1px solid #3a3a3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-title {
    font-weight: 500;
    color: #e0e0e0;
}

.mark-all-read {
    color: #4a90e2;
    font-size: 0.875rem;
    background: transparent;
    border: none;
    cursor: pointer;
}

.notifications-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #3a3a3a;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: #2a2a2a;
}

.notification-item.unread {
    background-color: rgba(74, 144, 226, 0.05);
}

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

.notification-message {
    margin-bottom: 0.25rem;
    color: #e0e0e0;
}

.notification-message i {
    margin-right: 0.5rem;
    color: #4a90e2;
}

.notification-time {
    color: #9ca3af;
    font-size: 0.75rem;
}

.notifications-footer {
    padding: 0.75rem 1rem;
    text-align: center;
    border-top: 1px solid #3a3a3a;
}

.notifications-footer a {
    color: #4a90e2;
    text-decoration: none;
}

/* === Выравнивание уровней === */
.level-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.level-container {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.level-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e0e0e0;
}

.level-badge {
    background-color: #4a90e2;
    color: white;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.level-progress {
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 0.75rem;
    background-color: #2a2a2a;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #4a90e2;
    border-radius: 9999px;
    transition: width 0.5s ease;
}

.level-info {
    display: flex;
    justify-content: space-between;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* === Тени для блоков контента === */
.content-block {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
}

.content-block-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #e0e0e0;
}

.content-block-body {
    color: #9ca3af;
}

/* === Дополнительные фиксы для layout === */

/* Фикс для карточек, чтобы они были одинаковой высоты */
.equal-height {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.equal-height-body {
    flex: 1;
}

/* Фикс для заголовков, чтобы они были выровнены по высоте */
.align-headers {
    min-height: 2.5rem;
    display: flex;
    align-items: center;
}

/* Дополнительные классы-утилиты */
.flex-1 {
    flex: 1;
}

.justify-end {
    justify-content: flex-end;
}

.items-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.mt-auto {
    margin-top: auto;
}

/* Дополнительные адаптивные классы */
@media (max-width: 640px) {
    .xs\:flex-col {
        flex-direction: column;
    }
    
    .xs\:items-stretch {
        align-items: stretch;
    }
    
    .xs\:w-full {
        width: 100%;
    }
}