/* 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;
    }
}
