/* Currency Widget Styles and JavaScript */

/* Widget Container */
.currency-widget {
    position: fixed;
    top: 80px;  /* Moved down to avoid header overlap */
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.currency-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.currency-icon {
    font-size: 24px;
    animation: coin-spin 3s ease-in-out infinite;
}

@keyframes coin-spin {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

.currency-amount {
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.currency-label {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Currency Modal */
.currency-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.currency-modal.active {
    display: flex;
}

.currency-modal-content {
    background: #1a1f3a;
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.currency-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.currency-modal-header h2 {
    color: #ffffff;
    margin: 0;
    font-size: 24px;
}

.currency-close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.currency-close-btn:hover {
    background: rgba(255,255,255,0.1);
}

.currency-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.currency-stat {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.currency-stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #fbbf24;
    margin-bottom: 5px;
}

.currency-stat-label {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
}

.currency-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.currency-tab {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.currency-tab.active {
    color: #a78bfa;
}

.currency-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #a78bfa;
}

.currency-tab-content {
    display: none;
}

.currency-tab-content.active {
    display: block;
}

.transaction-list {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.transaction-info {
    flex: 1;
}

.transaction-description {
    color: #ffffff;
    font-size: 14px;
    margin-bottom: 4px;
}

.transaction-time {
    color: #9ca3af;
    font-size: 12px;
}

.transaction-amount {
    font-size: 16px;
    font-weight: bold;
}

.transaction-amount.positive {
    color: #10b981;
}

.transaction-amount.negative {
    color: #ef4444;
}

.earn-ways {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.earn-way {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 15px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.earn-way:hover {
    border-color: #a78bfa;
    background: rgba(167,139,250,0.1);
}

.earn-way-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.earn-way-reward {
    color: #fbbf24;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
}

.earn-way-description {
    color: #9ca3af;
    font-size: 13px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .currency-widget {
        top: 10px;
        right: 10px;
        padding: 8px 16px;
    }
    
    .currency-amount {
        font-size: 18px;
    }
    
    .currency-modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .currency-stats {
        grid-template-columns: 1fr;
    }
}

/* ---- Shop / Marketplace ---- */

.shop-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.shop-filter {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    color: #9ca3af;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.shop-filter:hover {
    background: rgba(167,139,250,0.15);
    color: #c4b5fd;
}

.shop-filter.active {
    background: rgba(167,139,250,0.25);
    border-color: #a78bfa;
    color: #ffffff;
}

.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 14px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.shop-item-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
}

.shop-item-card:hover {
    border-color: #a78bfa;
    background: rgba(167,139,250,0.08);
    transform: translateY(-2px);
}

.shop-item-card.shop-item-locked {
    opacity: 0.55;
}

.shop-item-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.shop-item-name {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.shop-item-desc {
    color: #9ca3af;
    font-size: 12px;
    flex: 1;
    margin-bottom: 12px;
}

.shop-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shop-item-price {
    color: #fbbf24;
    font-size: 15px;
    font-weight: 700;
}

.shop-buy-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.shop-buy-btn:hover:not(.disabled) {
    filter: brightness(1.15);
}

.shop-buy-btn.disabled {
    background: rgba(255,255,255,0.1);
    color: #6b7280;
    cursor: not-allowed;
}

/* ---- Buy Coins Packs ---- */

.coin-packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.coin-pack-card {
    background: linear-gradient(145deg, rgba(251,191,36,0.08), rgba(167,139,250,0.08));
    border: 2px solid rgba(251,191,36,0.2);
    border-radius: 14px;
    padding: 20px 14px;
    text-align: center;
    transition: all 0.3s ease;
}

.coin-pack-card:hover {
    border-color: #fbbf24;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(251,191,36,0.15);
}

.coin-pack-amount {
    font-size: 22px;
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 4px;
}

.coin-pack-bonus {
    color: #10b981;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.coin-pack-price {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
}

.coin-pack-buy-btn {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: none;
    border-radius: 8px;
    color: #1a1f3a;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    width: 100%;
}

.coin-pack-buy-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(251,191,36,0.3);
}

.coin-pack-buy-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Scrollbar for shop grid */
.shop-items-grid::-webkit-scrollbar {
    width: 6px;
}

.shop-items-grid::-webkit-scrollbar-track {
    background: transparent;
}

.shop-items-grid::-webkit-scrollbar-thumb {
    background: rgba(167,139,250,0.3);
    border-radius: 3px;
}

@media (max-width: 768px) {
    .shop-items-grid {
        grid-template-columns: 1fr;
    }
    .coin-packs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .currency-tabs {
        flex-wrap: wrap;
    }
    .currency-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
}
