/* ===== Стили админ-панели ===== */

/* Вкладки админки */
.admin-tab-btn {
    background: transparent;
    color: #9ca3af;
    position: relative;
    overflow: hidden;
}

.admin-tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-tab-btn:hover::before {
    opacity: 1;
}

.admin-tab-btn:hover {
    color: #e5e7eb;
}

.admin-tab-btn.active {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

/* Контейнер вкладок: разрешаем перенос на маленьких экранах */
.tabs {
    flex-wrap: wrap;
}

/* Скрываем подписи вкладок на узких экранах, оставляем только эмодзи */
@media (max-width: 420px) {
    .admin-tab-label { display: none; }
    .admin-tab-btn { padding: 8px 10px; }
}

/* ===== Стили вкладки Подарки ===== */

/* Фильтры категорий подарков */
.gift-filter-btn {
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.5);
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gift-filter-btn:hover {
    background: rgba(75, 85, 99, 0.4);
    color: #e5e7eb;
    border-color: rgba(139, 92, 246, 0.5);
}

.gift-filter-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    border-color: #a855f7;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Карточка подарка в сетке */
.gift-card {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.9), rgba(31, 41, 55, 0.7));
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gift-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gift-card:hover::before {
    opacity: 1;
}

.gift-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(168, 85, 247, 0.8);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

/* Стикер подарка в карточке */
.gift-sticker-container {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
    position: relative;
}

.gift-sticker {
    width: 80%;
    height: 80%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* Анимации для стикеров подарков */

/* 1. Анимация для превью в карточках (легкое вращение и колебание) */
.gift-sticker-preview {
    animation: giftFloat 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

@keyframes giftFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-5px) rotate(-2deg) scale(1.02);
    }
    50% {
        transform: translateY(-8px) rotate(2deg) scale(1.05);
    }
    75% {
        transform: translateY(-5px) rotate(-1deg) scale(1.02);
    }
}

/* Свечение и тень при наведении на карточку */
.gift-card:hover .gift-sticker-preview {
    filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.6)) 
            drop-shadow(0 0 25px rgba(168, 85, 247, 0.4));
    animation: giftFloatHover 2s ease-in-out infinite;
}

@keyframes giftFloatHover {
    0%, 100% {
        transform: translateY(-3px) rotate(0deg) scale(1.08);
    }
    50% {
        transform: translateY(-10px) rotate(3deg) scale(1.12);
    }
}

/* 2. Анимация для модального окна (постоянное приближение/отдаление) */
.gift-sticker-modal {
    animation: giftPulseZoom 4s ease-in-out infinite;
    transition: all 0.4s ease;
    cursor: pointer;
}

@keyframes giftPulseZoom {
    0%, 100% {
        transform: scale(1) rotateY(0deg);
    }
    25% {
        transform: scale(1.05) rotateY(5deg);
    }
    50% {
        transform: scale(1.1) rotateY(0deg);
    }
    75% {
        transform: scale(1.05) rotateY(-5deg);
    }
}

/* Свечение при наведении на стикер в модальном окне */
.gift-sticker-modal:hover {
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.8)) 
            drop-shadow(0 0 40px rgba(168, 85, 247, 0.6))
            drop-shadow(0 0 60px rgba(236, 72, 153, 0.4));
    animation: giftPulseZoomHover 2s ease-in-out infinite;
}

@keyframes giftPulseZoomHover {
    0%, 100% {
        transform: scale(1.12) rotateY(0deg) rotateZ(0deg);
    }
    33% {
        transform: scale(1.18) rotateY(10deg) rotateZ(2deg);
    }
    66% {
        transform: scale(1.15) rotateY(-10deg) rotateZ(-2deg);
    }
}

/* 3. Эффект масштабирования при клике */
.gift-sticker-clicked {
    animation: giftClickScale 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes giftClickScale {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(0.9) rotate(-5deg);
    }
    50% {
        transform: scale(1.3) rotate(5deg);
        filter: drop-shadow(0 0 30px rgba(236, 72, 153, 1)) 
                drop-shadow(0 0 60px rgba(168, 85, 247, 0.8));
    }
    75% {
        transform: scale(1.15) rotate(-2deg);
    }
    100% {
        transform: scale(1.1) rotate(0deg);
    }
}

/* 4. Эффект получения подарка (заготовка для будущей реализации) */
.gift-received {
    animation: giftReceived 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes giftReceived {
    0% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 1;
        filter: drop-shadow(0 0 0 transparent);
    }
    20% {
        transform: scale(1.2) translateY(-20px) rotate(10deg);
        filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.8));
    }
    40% {
        transform: scale(1.4) translateY(-40px) rotate(-10deg);
        filter: drop-shadow(0 0 40px rgba(251, 191, 36, 1)) 
                drop-shadow(0 0 60px rgba(236, 72, 153, 0.8));
    }
    60% {
        transform: scale(1.6) translateY(-30px) rotate(5deg);
        opacity: 1;
    }
    80% {
        transform: scale(1.3) translateY(-60px) rotate(-5deg);
        opacity: 0.6;
    }
    100% {
        transform: scale(0.8) translateY(-100px) rotate(0deg);
        opacity: 0;
        filter: drop-shadow(0 0 80px rgba(251, 191, 36, 0.4));
    }
}

.protected-media {
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Бейдж редкости */
.gift-rarity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gift-rarity-badge.common {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.gift-rarity-badge.rare {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.gift-rarity-badge.exclusive {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.gift-rarity-badge.premium {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.gift-rarity-badge.collector {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.4);
}

.asset-card {
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 10px;
    padding: 10px;
    background: rgba(15, 23, 42, 0.7);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.asset-card:hover {
    border-color: rgba(168, 85, 247, 0.6);
    transform: translateY(-2px);
}

.asset-card.selected {
    border-color: rgba(236, 72, 153, 0.9);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.4);
}

/* Модальное окно подарка */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-content-wrapper {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close-btn {
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(107, 114, 128, 0.7);
    transform: rotate(90deg);
}

/* Анимация для TGS стикеров (lottie) */
.gift-sticker.animated,
.gift-sticker.video {
    width: 100%;
    height: 100%;
}

/* Индикатор загрузки стикера */
.gift-sticker-loading {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 12px;
}

/* Карточки админки */
.admin-card {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(31, 41, 55, 0.6));
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.admin-card:hover {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

.admin-card-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Кнопки админки */
.btn-admin-primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-admin-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-admin-primary:active {
    transform: translateY(0);
}

.btn-admin-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-admin-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-admin-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-admin-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-admin-danger-critical {
    background: linear-gradient(135deg, #991b1b, #7f1d1d);
    color: white;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 10px;
    border: 2px solid #dc2626;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(153, 27, 27, 0.5);
}

.btn-admin-danger-critical:hover {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

.btn-admin-secondary {
    background: rgba(75, 85, 99, 0.5);
    color: #e5e7eb;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(107, 114, 128, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-admin-secondary:hover:not(:disabled) {
    background: rgba(107, 114, 128, 0.7);
    border-color: rgba(139, 92, 246, 0.5);
}

.btn-admin-secondary:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Адаптивные размеры кнопок и форм под телефон */
@media (max-width: 420px) {
    .btn-admin-primary,
    .btn-admin-success,
    .btn-admin-danger,
    .btn-admin-danger-critical,
    .btn-admin-secondary {
        padding: 10px 14px;
        font-size: 14px;
    }

    /* Поиск игрока: на маленьких экранах переносим в два ряда */
    #admin-users-tab .admin-card .flex { flex-wrap: wrap; }
    #admin-users-tab #search-user-input { flex: 1 1 100%; }
    #admin-users-tab #search-user-btn { width: 100%; margin-top: 8px; }
}

/* Карточки статистики */
.stat-card {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.8), rgba(17, 24, 39, 0.9));
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.stat-bar {
    width: 100%;
    height: 6px;
    background: rgba(31, 41, 55, 0.8);
    border-radius: 3px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px currentColor;
}

/* Мини карточки статистики */
.stat-card-mini {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.6), rgba(17, 24, 39, 0.8));
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card-mini:hover {
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

.stat-mini-value {
    font-size: 20px;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 4px;
}

.stat-mini-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Анимации для админ-панели */
.admin-tab-content {
    animation: adminFadeIn 0.4s ease;
}

@keyframes adminFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Уведомления (тосты) */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    z-index: 10000;
    animation: toastSlideIn 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

    @keyframes toastSlideOut {
        from {
            transform: translateX(0);
            opacity: 1;
        }
        to {
            transform: translateX(400px);
            opacity: 0;
        }
    }

/* Загрузчик */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* RTP прогресс-бары */
.rtp-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.rtp-label {
    min-width: 100px;
    font-weight: 600;
    color: #e5e7eb;
}

.rtp-bar-container {
    flex: 1;
    height: 8px;
    background: rgba(17, 24, 39, 0.8);
    border-radius: 4px;
    overflow: hidden;
}

.rtp-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

.rtp-value {
    min-width: 60px;
    text-align: right;
    font-weight: 700;
    font-size: 14px;
}

/* Топ игроков */
.player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(75, 85, 99, 0.3);
    transition: all 0.3s ease;
}

.player-item:hover {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(31, 41, 55, 0.7);
}

.player-rank {
    font-size: 20px;
    font-weight: 700;
    min-width: 30px;
}

.player-info {
    flex: 1;
    margin-left: 12px;
}

.player-name {
    font-weight: 600;
    color: #e5e7eb;
}

.player-id {
    font-size: 11px;
    color: #9ca3af;
}

.player-balance {
    font-weight: 700;
    color: #fbbf24;
}
