/* ==================== GIFT SYSTEM STYLES ==================== */

/* Стили для подарков в профиле */
.gift-item-profile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin: 8px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 145, 77, 0.1));
    border: 2px solid rgba(255, 107, 107, 0.3);
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gift-item-profile:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
    border-color: rgba(255, 107, 107, 0.6);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(255, 145, 77, 0.2));
}

.gift-item-profile:active {
    transform: scale(0.95);
}

/* Анимация появления подарка */
@keyframes giftAppear {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    50% {
        transform: scale(1.1) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.gift-item-profile {
    animation: giftAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Анимация падения подарка */
@keyframes giftFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(0) rotate(360deg);
        opacity: 1;
    }
}

.gift-falling {
    animation: giftFall 0.8s ease-out;
}

/* Анимация блеска подарка */
@keyframes giftShine {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 214, 0, 0), inset 0 0 5px rgba(255, 255, 255, 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 214, 0, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.4);
    }
}

.gift-shine {
    animation: giftShine 1.5s ease-in-out infinite;
}

/* Анимация встряски */
@keyframes giftShake {
    0%, 100% { transform: rotate(0deg) translateX(0); }
    25% { transform: rotate(-2deg) translateX(-2px); }
    75% { transform: rotate(2deg) translateX(2px); }
}

.gift-shake {
    animation: giftShake 0.4s ease-in-out;
}

/* Анимация огня для подарка 🔥 */
@keyframes fireBurn {
    0% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 1;
        filter: brightness(1);
    }
    25% {
        transform: scale(1.05) translateY(-5px) rotate(2deg);
        opacity: 0.95;
        filter: brightness(1.2);
    }
    50% {
        transform: scale(1.1) translateY(-10px) rotate(-2deg);
        opacity: 1;
        filter: brightness(1.1);
    }
    75% {
        transform: scale(1.05) translateY(-5px) rotate(1deg);
        opacity: 0.95;
        filter: brightness(1.3);
    }
    100% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 1;
        filter: brightness(1);
    }
}

.gift-fire {
    animation: fireBurn 0.8s ease-in-out infinite;
}

/* Интенсивная анимация огня при отправке */
@keyframes fireIntense {
    0% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 1;
        filter: brightness(1) drop-shadow(0 0 5px rgba(255, 107, 0, 0.5));
    }
    20% {
        transform: scale(1.1) translateY(-8px) rotate(-3deg);
        opacity: 1;
        filter: brightness(1.4) drop-shadow(0 0 15px rgba(255, 145, 0, 0.8));
    }
    40% {
        transform: scale(1.15) translateY(-15px) rotate(3deg);
        opacity: 0.95;
        filter: brightness(1.5) drop-shadow(0 0 25px rgba(255, 107, 0, 1));
    }
    60% {
        transform: scale(1.1) translateY(-10px) rotate(-2deg);
        opacity: 1;
        filter: brightness(1.3) drop-shadow(0 0 20px rgba(255, 145, 0, 0.9));
    }
    80% {
        transform: scale(1.05) translateY(-5px) rotate(2deg);
        opacity: 0.98;
        filter: brightness(1.2) drop-shadow(0 0 10px rgba(255, 107, 0, 0.6));
    }
    100% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 1;
        filter: brightness(1) drop-shadow(0 0 5px rgba(255, 107, 0, 0.3));
    }
}

.gift-fire-intense {
    animation: fireIntense 0.6s ease-in-out infinite;
}

/* Огонь взлетает вверх и исчезает (при отправке подарка) */
@keyframes fireShootUp {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 1;
    }
    20% {
        transform: translateY(-30px) scale(1.1) rotate(10deg);
        opacity: 1;
        filter: brightness(1.5);
    }
    40% {
        transform: translateY(-60px) scale(1.05) rotate(20deg);
        opacity: 0.9;
        filter: brightness(1.3);
    }
    70% {
        transform: translateY(-100px) scale(0.8) rotate(30deg);
        opacity: 0.5;
        filter: brightness(1.1);
    }
    100% {
        transform: translateY(-150px) scale(0) rotate(45deg);
        opacity: 0;
        filter: brightness(0.8);
    }
}

.gift-fire-shoot {
    animation: fireShootUp 1s ease-out forwards;
}

/* Анимация множественного огня (когда несколько языков пламени) */
@keyframes fireFlicker {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: scale(1.15) rotate(-5deg);
        opacity: 1;
    }
    50% {
        transform: scale(0.95) rotate(5deg);
        opacity: 0.8;
    }
    75% {
        transform: scale(1.1) rotate(-3deg);
        opacity: 1;
    }
}

.gift-fire-flicker {
    animation: fireFlicker 0.5s ease-in-out infinite;
}

/* Радиальное расширение огня */
@keyframes fireExpand {
    0% {
        transform: scale(0.5);
        opacity: 0;
        filter: brightness(0.5);
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
        filter: brightness(1.5);
    }
    100% {
        transform: scale(1);
        opacity: 0;
        filter: brightness(1);
    }
}

.gift-fire-expand {
    animation: fireExpand 0.8s ease-out forwards;
}

/* Комбинированная анимация для карточки подарка огонь */
.gift-card.fire-gift {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8e35 50%, #ffaa35 100%) !important;
}

.gift-card.fire-gift:hover {
    animation: fireIntense 0.6s ease-in-out infinite;
    box-shadow: 0 15px 40px rgba(255, 107, 53, 0.6), 
                0 0 20px rgba(255, 145, 53, 0.4);
}

/* ==================== GIFT MARKETPLACE ==================== */

.gift-marketplace {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    padding: 20px;
}

.gift-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

.gift-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.gift-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
}

.gift-card:active {
    transform: translateY(-4px) scale(1.02);
}

.gift-card-emoji {
    font-size: 40px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.gift-card-name {
    font-size: 12px;
    color: white;
    text-align: center;
    font-weight: 600;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.gift-card-price {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: bold;
    position: relative;
    z-index: 1;
}

/* ==================== GIFT BUTTON ==================== */

.gift-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gift-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(245, 87, 108, 0.4);
}

.gift-btn:active {
    transform: scale(0.95);
}

/* ==================== RECEIVED GIFTS SECTION ==================== */

.received-gifts-container {
    margin-top: 20px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.received-gifts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.received-gifts-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
}

.received-gifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
}

.received-gift-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.received-gift-item:hover {
    border-color: #667eea;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    transform: translateY(-4px);
}

.gift-emoji {
    font-size: 32px;
    margin-bottom: 4px;
}

.gift-from {
    font-size: 11px;
    color: #666;
    text-align: center;
    word-break: break-word;
}

.gift-date {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
}

.gift-hidden-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

/* Темная тема для подарков */
body.dark-theme .received-gifts-container {
    background: rgba(102, 126, 234, 0.15);
    border-left-color: #8492d9;
}

body.dark-theme .received-gifts-title {
    color: #8492d9;
}

body.dark-theme .received-gift-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(102, 126, 234, 0.3);
}

body.dark-theme .received-gift-item:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

body.dark-theme .gift-from {
    color: #aaa;
}

body.dark-theme .gift-date {
    color: #666;
}

/* ==================== GIFT MODAL ==================== */

.gift-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
}

.gift-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.gift-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

body.dark-theme .gift-modal-content {
    background: #2c3e50;
    color: #ecf0f1;
}

.gift-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.gift-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
}

.gift-modal-close {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.gift-modal-close:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

/* ==================== GIFT ACTIONS ==================== */

.gift-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.gift-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.gift-exchange-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
}

.gift-exchange-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.gift-hide-btn {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    flex: 1;
}

.gift-hide-btn:hover {
    background: rgba(0, 0, 0, 0.2);
}

body.dark-theme .gift-hide-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
}

body.dark-theme .gift-hide-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== GIFT NOTIFICATION ANIMATION ==================== */

@keyframes giftNotification {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(1.5) rotate(360deg) translateY(-100px);
    }
}

.gift-notification {
    position: fixed;
    font-size: 60px;
    pointer-events: none;
    animation: giftNotification 1.5s ease-out forwards;
    z-index: 9998;
}

/* ==================== WALLET STYLES ==================== */

.wallet-container {
    text-align: center;
    padding: 20px 0;
}

.wallet-balance {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 32px;
    font-weight: bold;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.wallet-balance-emoji {
    font-size: 40px;
    animation: giftShine 2s ease-in-out infinite;
}

.wallet-info {
    margin-top: 20px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.wallet-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.wallet-info-label {
    color: #666;
    font-weight: 600;
}

body.dark-theme .wallet-info {
    background: rgba(102, 126, 234, 0.15);
}

body.dark-theme .wallet-info-label {
    color: #aaa;
}

/* ==================== MY GIFTS MODAL ==================== */

.my-gifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.my-gift-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1), rgba(245, 87, 108, 0.1));
    border: 2px solid rgba(245, 87, 108, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 100px;
}

.my-gift-card:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 12px 30px rgba(245, 87, 108, 0.3);
    border-color: rgba(245, 87, 108, 0.6);
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.2), rgba(245, 87, 108, 0.2));
}

.my-gift-emoji {
    font-size: 36px;
    margin-bottom: 6px;
}

.my-gift-info {
    font-size: 12px;
    text-align: center;
    color: #666;
}

body.dark-theme .my-gift-info {
    color: #aaa;
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 768px) {
    .gift-marketplace {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
        padding: 15px;
    }

    .gift-modal-content {
        padding: 20px;
        max-width: 90vw;
    }

    .gift-card {
        min-height: 100px;
    }

    .gift-card-emoji {
        font-size: 32px;
    }

    .received-gifts-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }

    .my-gifts-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .gift-marketplace {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }

    .gift-modal-content {
        padding: 15px;
        border-radius: 12px;
    }

    .gift-modal-title {
        font-size: 20px;
    }

    .wallet-balance {
        font-size: 24px;
        padding: 15px;
    }

    .wallet-balance-emoji {
        font-size: 32px;
    }

    .gift-item-profile {
        width: 50px;
        height: 50px;
        margin: 6px;
        font-size: 24px;
    }

    .received-gifts-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 6px;
    }

    .my-gifts-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }
}

/* ==================== ANIMATION UTILITIES ==================== */

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
