/**
 * Token System Styles
 * Styles for token balance display, purchase modal, and notifications
 */

/* Token Balance Display */
.token-balance-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    position: absolute;
    right: 60px; /* Position before the profile button */
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    flex-shrink: 0;
}

.token-balance-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.token-icon {
    font-size: 24px;
    animation: coin-spin 3s infinite;
}

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

.token-info {
    display: flex;
    flex-direction: column;
}

.token-label {
    font-size: 11px;
    color: #8B4513;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.token-amount {
    font-size: 18px;
    font-weight: 700;
    color: #8B4513;
}

.buy-tokens-btn {
    padding: 6px 12px;
    background: #8B4513;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.buy-tokens-btn:hover {
    background: #A0522D;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(139, 69, 19, 0.3);
}

/* Token Purchase Modal */
.token-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.token-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.token-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 800px;
    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 {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.token-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid #e0e0e0;
}

.token-modal-header h2 {
    margin: 0;
    font-size: 28px;
    color: #333;
}

.token-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.token-modal-close:hover {
    color: #333;
}

.token-modal-body {
    padding: 28px;
}

.token-info-text {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.current-balance-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 16px;
}

.current-balance-info strong {
    font-size: 20px;
    color: #8B4513;
}

/* Token Packages List */
.token-packages-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.token-package {
    position: relative;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.token-package:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: #FFD700;
}

.token-package.featured {
    border-color: #FFD700;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
}

.bonus-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #FF4444;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
}

.package-header h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.package-desc {
    font-size: 12px;
    color: #666;
    margin: 0;
}

.package-tokens {
    margin: 16px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.package-tokens .token-icon {
    font-size: 28px;
}

.token-count {
    font-size: 32px;
    font-weight: 700;
    color: #FFD700;
}

.token-text {
    font-size: 14px;
    color: #666;
}

.package-price {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 12px 0 4px 0;
}

.package-per-token {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}

.buy-package-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #8B4513;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.buy-package-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

/* Payment Modal (Stripe) */
.payment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.payment-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.payment-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    padding: 24px;
}

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

.payment-modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.payment-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
}

.payment-modal-body {
    margin-top: 20px;
}

#token-payment-element {
    margin-bottom: 20px;
}

.submit-payment-btn {
    width: 100%;
    padding: 14px 24px;
    background: #FFD700;
    color: #8B4513;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-payment-btn:hover:not(:disabled) {
    background: #FFA500;
    transform: translateY(-2px);
}

.submit-payment-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success Notification */
.token-success-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 10002;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
}

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

.success-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.success-icon {
    font-size: 32px;
}

.success-text h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: #333;
}

.success-text p {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #FFD700;
}

/* Gift Success Modal */
.gift-success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10003;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.gift-success-modal .success-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: popIn 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-animation {
    position: relative;
}

.success-checkmark {
    font-size: 64px;
    animation: checkmarkPop 0.5s ease;
}

@keyframes checkmarkPop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.floating-hearts {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    animation: floatUp 2s ease infinite;
}

@keyframes floatUp {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(-50px);
        opacity: 0;
    }
}

.gift-success-modal h2 {
    margin: 0;
    font-size: 32px;
    color: #333;
}

.success-message {
    font-size: 18px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.reward-photo {
    width: 100%;
    max-width: 300px;
    border-radius: 12px;
    overflow: hidden;
}

.reward-photo img {
    width: 100%;
    height: auto;
    display: block;
}

.success-close-btn {
    padding: 12px 32px;
    background: #FFD700;
    color: #8B4513;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.success-close-btn:hover {
    background: #FFA500;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .token-packages-list {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }

    .token-package {
        padding: 16px;
    }

    .token-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .token-balance-display {
        padding: 6px 10px;
        gap: 6px;
        right: 50px; /* Adjust for mobile profile button */
        border-radius: 16px;
    }

    .token-label {
        font-size: 9px;
    }

    .token-amount {
        font-size: 14px;
    }
    
    .token-icon {
        font-size: 20px;
    }

    .buy-tokens-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .buy-tokens-btn i {
        font-size: 10px;
    }
}

/* No packages message */
.no-packages {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

