/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Карточки игр - исправление для квадратных изображений 300x300 */
.game-image {
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
}

/* Игровое модальное окно */
.game-modal .modal-content {
    max-width: 90vw !important;
    max-height: 90vh !important;
    width: 90vw !important;
}

.game-modal-container {
    width: 100%;
}

.game-iframe-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 180px); /* Высота экрана минус отступы */
    max-height: 600px;
    min-height: 400px;
    margin-bottom: 60px; /* Отступ снизу 60px */
    border-radius: 8px;
    overflow: hidden;
}

/* Для игрового оверлея убираем ограничения */
#gameOverlay .game-iframe-container,
#gameOverlayMobile .game-iframe-container {
    height: 100% !important;
    max-height: none !important;
    min-height: 100% !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
}

.game-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: relative;
    z-index: 1;
    border-radius: 8px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .game-modal .modal-content {
        max-width: 95vw !important;
        width: 95vw !important;
        margin: 10px;
    }

    .game-iframe-container {
        height: calc(100vh - 200px);
        max-height: 400px;
        margin-bottom: 60px;
    }

    /* Для игрового оверлея убираем ограничения на мобильных */
    #gameOverlay .game-iframe-container,
    #gameOverlayMobile .game-iframe-container {
        height: 100% !important;
        max-height: none !important;
        margin-bottom: 0 !important;
    }
}

@media (max-width: 480px) {
    .game-iframe-container {
        height: 300px;
        margin-bottom: 60px;
    }

    /* Для игрового оверлея убираем ограничения */
    #gameOverlay .game-iframe-container,
    #gameOverlayMobile .game-iframe-container {
        height: 100% !important;
        max-height: none !important;
        margin-bottom: 0 !important;
    }
    
    .game-header h3 {
        font-size: 1rem;
    }
    
    .game-header button {
        padding: 8px;
    }
    
    .game-header svg {
        width: 16px;
        height: 16px;
    }
}

/* Полноэкранный режим для iframe */
.game-iframe-container iframe:fullscreen {
    width: 100vw;
    height: 100vh;
}

/* Фиксируем отступ снизу в обычном режиме */
.game-modal .modal-body {
    padding-bottom: 4rem;
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

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

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Модальное окно */
.modal-content {
    animation: fadeIn 0.3s ease-out;
}

.modal-backdrop-blur {
    backdrop-filter: blur(4px);
}

/* Карточки игр */
.game-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    background: #1f2937;
}

.game-card:hover {
    transform: translateY(-2px);
}

.game-card img {
    transition: transform 0.3s ease, filter 0.3s ease;
    backface-visibility: hidden;
    perspective: 1000px;
}

.game-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.game-card:hover .game-card-overlay {
    transform: translateY(0);
}

.game-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .game-card-image {
    transform: scale(1.1);
    filter: blur(2px);
}

/* New game card hover effects */
.game-card:hover img {
    filter: blur(2px);
}

/* Ensure text and buttons stay sharp on hover */
.game-card:hover .absolute,
.game-card:hover .p-3,
.game-card:hover button {
    filter: none;
}

/* Custom Checkbox Styling */
.custom-checkbox {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    flex-shrink: 0;
}

.custom-checkbox input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.custom-checkbox .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: #374151;
    border: 2px solid #6B7280;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #8B5CF6, #3B82F6);
    border-color: #8B5CF6;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.custom-checkbox .checkmark:after {
    content: "";
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark:after {
    opacity: 1;
}

.custom-checkbox:hover .checkmark {
    border-color: #8B5CF6;
    background: #4B5563;
}

.custom-checkbox input[type="checkbox"]:checked:hover + .checkmark {
    background: linear-gradient(135deg, #7C3AED, #2563EB);
}

/* Боковое меню */
.sidebar-closed {
    transform: translateX(-100%);
}

@media (min-width: 1024px) {
    .sidebar-closed {
        transform: translateX(0);
    }
}

/* Кнопки */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

/* Загрузчик */
.loader {
    border: 3px solid #1f2937;
    border-radius: 50%;
    border-top: 3px solid #8b5cf6;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Z-INDEX HIERARCHY */
/*
  1-99: Обычный контент, элементы страницы
  100-199: Дропдауны, тултипы, DataTable фильтры
  200-499: Боковые панели, навигация
  500-999: Модальные окна, оверлеи
  1000-1999: Хедер и важные элементы навигации
  2000-2999: Зарезервировано
  3000-9999: Специальные случаи
  10000+: Критически важные уведомления (только для экстренных случаев)
*/

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 999999; /* Самый высокий приоритет для уведомлений - выше всех модальных окон */
    animation: slideInRight 0.3s ease-out;
}

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

.notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.notification.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

/* Адаптивность */
@media (max-width: 768px) {
    .game-card-overlay {
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    }
}

/* Переключатель темы */
.theme-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background: #4b5563;
    border-radius: 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.theme-toggle.active {
    background: #8b5cf6;
}

.theme-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.theme-toggle.active .theme-toggle-slider {
    transform: translateX(30px);
}

/* Живые индикаторы */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Прогресс бар */
.progress-bar {
    height: 4px;
    background: #1f2937;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #3b82f6);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Чипы */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #374151;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.chip:hover {
    background: #4b5563;
    transform: scale(1.05);
}

.chip.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
}
/* Search Autocomplete */
/* Positioning handled by Tailwind classes and JavaScript */
