/* UCS Modal Styling - Matching AI Music Generator Modal */
#ucs-buy-credits-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(4px);
    z-index: 1000000 !important;
    display: none !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#ucs-buy-credits-modal.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#ucs-buy-credits-modal .ucs-modal-content {
    background: #000;
    border: 1px solid #000000;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    width: 98vw;
    max-width: 1400px;
    max-height: 76vh;
    overflow-y: auto;
    color: #ffffff;
    padding: 0 2rem;
    justify-items: anchor-center;
}

#ucs-buy-credits-modal .ucs-modal-header {
    border-bottom: 1px solid #404040;
}

#ucs-buy-credits-modal .ucs-modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
    background: linear-gradient(45deg, #7c5cf6, #9b19ff);
    color: #ae00ff;
    background-image: linear-gradient(101deg, #9116ed 24%, #00e1ff8a 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
#ucs-buy-credits-modal .ucs-modal-close {
    background: rgb(62 62 62);
    border: none;
    font-size: 24px;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    right: 2rem;
    margin-top: -4rem;
    top: 4rem;
    z-index: 99999999999;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    justify-self: right;
}

#ucs-buy-credits-modal .ucs-modal-body {
    max-height: 100%;
    overflow-y: auto;
}

/* Package styling */
#ucs-buy-credits-modal .ucs-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 5px;
    padding: 20px 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    justify-items: center;
    align-items: start;
}

#ucs-buy-credits-modal .ucs-package {
    background: #090909;
    border: 1px solid #181818;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    padding: 9px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 320px;
    min-height: 350px;
    justify-content: space-between;
}

#ucs-buy-credits-modal .ucs-package:hover {
    background: #000;
}

#ucs-buy-credits-modal .ucs-package h3 {
    margin: 0 0 10px 0;
    font-size: 1.4em;
    color: #fff;
    padding-top: 0;
    font-weight: 600;
    line-height: 1.3;
}

#ucs-buy-credits-modal .ucs-package .ucs-desc {
    color: #b3b3b3;
    font-size: 0.9em;
    margin-bottom: 15px;
    line-height: 1.4;
    min-height: 40px;
}

/* Price and Credits Row */
#ucs-buy-credits-modal .ucs-price-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 15px 0 20px;
}

#ucs-buy-credits-modal .ucs-price,
#ucs-buy-credits-modal .ucs-credits {
    display: flex;
    align-items: center;
    gap: 8px;
}

#ucs-buy-credits-modal .ucs-price {
    font-size: 28px;
    font-weight: 700;
    color: #6690d5;
	background: linear-gradient(45deg, #7c5cf6, #9b19ff);
    background-image: linear-gradient(101deg, #9116ed 0%, #00e1ff8a 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #ffffff;
}

#ucs-buy-credits-modal .ucs-credits {
    font-size: 16px;
    font-weight: 500;
    color: #a0aec0;
    display: flex;
    align-items: center;
}

/* Diamond Icon Styles */
.diamond-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: linear-gradient(45deg, #8b5cf6, #06b6d4);
    transform: rotate(45deg);
    position: relative;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

.diamond-icon:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: #fff;
    opacity: 0.2;
    border-radius: 1px;
}

/* Specific styles for UCS modal */
#ucs-buy-credits-modal .ucs-credits .diamond-icon {
    width: 12px;
    height: 12px;
    opacity: 0.9;
    margin-right: 6px;
}

#ucs-buy-credits-modal .ucs-credits .diamond-icon:before {
    width: 6px;
    height: 6px;
}

#ucs-buy-credits-modal .ucs-package .ucs-price .diamond-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #8b5cf6, #06b6d4);
    transform: rotate(45deg);
    margin-right: 10px;
    position: relative;
}

#ucs-buy-credits-modal .ucs-package .ucs-price .diamond-icon:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #fff;
    opacity: 0.2;
}

/* Popular badge */
#ucs-buy-credits-modal .ucs-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(45deg, #7c5cf6, #d406ac);
    color: white;
    padding: 4px 12px;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom-left-radius: 8px;
    z-index: 1;
    display: none;
}

/* Diamond Icon Styling */
.ucs-balance .diamond-icon,
.ucs-balance-amount .diamond-icon,
.ucs-buy-btn .diamond-icon {
    display: inline-block;
    width: 9px;
    height: 9px;
    background: linear-gradient(45deg, #8b5cf6, #06b6d4);
    transform: rotate(45deg);
    margin-right: 6px;
    position: relative;
    vertical-align: middle;
    top: -1px;
}

.ucs-buy-btn .diamond-icon {
    margin-right: 8px;
}

/* Professional Diamond Plus Icon with Arrow and Sparkles */
.ucs-diamond-plus-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    position: relative;
    vertical-align: middle;
}

/* Main diamond shape */
.ucs-diamond-plus-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #8b5cf6, #06b6d4);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

/* Upward arrow in center */
.ucs-diamond-plus-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-bottom: 5px solid white;
    margin-top: -1px;
}

/* Sparkle effects - Enhanced for better visibility */
.ucs-diamond-plus-icon .sparkle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: linear-gradient(45deg, #8b5cf6, #06b6d4);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.8);
    animation: sparkle 2s infinite ease-out;
}

.ucs-diamond-plus-icon .sparkle1 {
    top: 1px;
    right: 1px;
    animation-delay: 0s;
}

.ucs-diamond-plus-icon .sparkle2 {
    top: 2px;
    right: 8px;
    animation-delay: 0.4s;
}

.ucs-diamond-plus-icon .sparkle3 {
    top: 8px;
    right: 2px;
    animation-delay: 0.8s;
}

@keyframes sparkle {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.3) rotate(0deg);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px) scale(1) rotate(90deg);
    }
    70% {
        opacity: 0.7;
        transform: translateY(-12px) scale(0.8) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0.4) rotate(270deg);
    }
}

/* Enhanced sparkle burst animation for balance updates */
.ucs-diamond-plus-icon.ucs-sparkle-burst .sparkle {
    animation: sparkleBurst 0.8s ease-in-out infinite;
}

.ucs-diamond-plus-icon.ucs-sparkle-burst .sparkle1 {
    animation-delay: 0s;
}

.ucs-diamond-plus-icon.ucs-sparkle-burst .sparkle2 {
    animation-delay: 0.1s;
}

.ucs-diamond-plus-icon.ucs-sparkle-burst .sparkle3 {
    animation-delay: 0.2s;
}

@keyframes sparkleBurst {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }
    25%, 75% {
        opacity: 1;
        transform: scale(1.5) rotate(90deg);
    }
    50% {
        opacity: 1;
        transform: scale(2) rotate(180deg);
    }
}

.ucs-balance .diamond-icon:before,
.ucs-balance-amount .diamond-icon:before,
.ucs-buy-btn .diamond-icon:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: #fff;
    opacity: 0.2;
}

/* Buy Button Styling */
.ucs-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: rgb(50 50 50 / 34%) 0px 2px 10px;
    gap: 4px;
}

.ucs-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.ucs-buy-btn:active {
    transform: translateY(0);
}

/* Balance Display */
.ucs-balance,
.ucs-balance-amount {
    align-items: center;
    font-weight: 500;
    font-size: 1rem;
    font: inherit;
    color: #d5d5d5;
    background: #000;
    border: 1px solid transparent;
    border-radius: 0 0.4rem;
    padding: 0 0.4rem;
    display: inline-flex !important;
    gap: 0.25rem;
    place-self: baseline;
    margin: 0px 0px 6px 0px;
}

.ucs-balance-amount {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.ucs-unified-balance {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
}

.ucs-balance-label {
    margin-right: 8px;
    color: #777;
}

.ucs-balance-amount {
    font-size: 1.2em;
    color: #8b5cf6;
}

/* Package Features */
#ucs-buy-credits-modal .ucs-features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    flex-grow: 1;
}

#ucs-buy-credits-modal .ucs-feature-item {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    color: #a0aec0;
    font-size: 14px;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

#ucs-buy-credits-modal .ucs-feature-item svg {
    position: absolute;
    left: 0;
    color: #48bb78;
    flex-shrink: 0;
}

/* Popular package styling */
#ucs-buy-credits-modal .ucs-package.ucs-popular {
    border: 2px solid #7c5cf6;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(124, 92, 246, 0.3);
    position: relative;
    overflow: visible;
}

#ucs-buy-credits-modal .ucs-package.ucs-popular:before {
    content: 'MOST POPULAR';
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(45deg, #7c5cf6, #d406ac);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 10px rgba(124, 92, 246, 0.5);
}

#ucs-buy-credits-modal .ucs-buy-package-btn {
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
	background: linear-gradient(45deg, #7c5cf6, #9b19ff);
    color: #ffffff;
    background-image: linear-gradient(101deg, #9116ed 24%, #00e1ff8a 100%);
}
#ucs-buy-credits-modal .ucs-buy-package-btn:hover {
    background: linear-gradient(91deg, #7c5cf6, #9b19ff);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* Currency selector - Make it more visible */
#ucs-buy-credits-modal .ucs-currency-select {
    margin-bottom: 20px;
    text-align: center;
    padding: 15px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

#ucs-buy-credits-modal .ucs-currency-select label {
    color: #e0e0e0;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    font-size: 16px;
}

#ucs-buy-credits-modal .ucs-currency-select select {
    padding: 12px 16px;
    border: 1px solid #8b5cf6;
    border-radius: 6px;
    background: #0e0e0e;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

#ucs-buy-credits-modal .ucs-currency-select select:hover {
    border-color: #a855f7;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

#ucs-buy-credits-modal .ucs-currency-select select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

/* No packages message */
#ucs-buy-credits-modal .ucs-no-packages {
    text-align: center;
    color: #999;
    font-size: 16px;
    padding: 40px 20px;
}

/* Scrollbar styling */
#ucs-buy-credits-modal .ucs-modal-content::-webkit-scrollbar {
    width: 8px;
}

#ucs-buy-credits-modal .ucs-modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

/* Override any dollar sign icons that might be added by other CSS */
.ucs-balance::before,
[data-ucs-balance]::before,
.ucs-balance::after,
[data-ucs-balance]::after {
    content: none !important;
    display: none !important;
}

/* Ensure diamond icon is properly positioned */
.ucs-balance .diamond-icon {
    margin-right: 6px !important;
    vertical-align: middle !important;
}

#ucs-buy-credits-modal .ucs-modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #8b5cf6, #06b6d4);
    border-radius: 4px;
}

#ucs-buy-credits-modal .ucs-modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #7c3aed, #0891b2);
}

/* Animation */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#ucs-buy-credits-modal.active .ucs-modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    #ucs-buy-credits-modal .ucs-modal-content {
        width: 95%;
        margin: 20px auto;
        max-height: 90vh;
    }

    #ucs-buy-credits-modal .ucs-packages-grid {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 15px 0;
    }

    #ucs-buy-credits-modal .ucs-package {
        max-width: 100%;
        min-height: 300px;
    }
    
    /* Mobile Responsive Styles for Diamond Plus Icon - FIX FOR PWA */
    .ucs-diamond-plus-icon {
        width: 12px !important;
        height: 12px !important;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative;
        vertical-align: middle;
    }
    
    .ucs-diamond-plus-icon::before {
        width: 10px !important;
        height: 10px !important;
    }
    
    .ucs-diamond-plus-icon::after {
        border-left: 2px solid transparent;
        border-right: 2px solid transparent;
        border-bottom: 4px solid white;
        margin-top: -1px;
    }
    
    .ucs-diamond-plus-icon .sparkle {
        width: 2px !important;
        height: 2px !important;
    }
    
    .ucs-diamond-plus-icon .sparkle1 {
        top: 1px;
        right: 1px;
    }
    
    .ucs-diamond-plus-icon .sparkle2 {
        top: 1px;
        right: 6px;
    }
    
    .ucs-diamond-plus-icon .sparkle3 {
        top: 6px;
        right: 1px;
    }
}

/* Balance Update Animation */
.ucs-balance-update {
    animation: ucs-balance-sparkle 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    position: relative;
}

.ucs-balance-update .credit-amount {
    animation: ucs-balance-text-sparkle 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes ucs-balance-sparkle {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(139, 92, 246, 0));
    }
    25% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 5px rgba(139, 92, 246, 0.5));
    }
    50% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.8), 0 0 25px rgba(139, 92, 246, 0.6));
    }
    75% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 5px rgba(139, 92, 246, 0.5));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(139, 92, 246, 0));
    }
}

@keyframes ucs-balance-text-sparkle {
    0% {
        transform: scale(1);
        text-shadow: 0 0 0 rgba(139, 92, 246, 0);
        color: #d5d5d5;
    }
    25% {
        transform: scale(1.1);
        text-shadow: 0 0 5px rgba(139, 92, 246, 0.5);
        color: #8b5cf6;
    }
    50% {
        transform: scale(1.2);
        text-shadow: 0 0 15px rgba(139, 92, 246, 0.8), 0 0 25px rgba(139, 92, 246, 0.6);
        color: #8b5cf6;
    }
    75% {
        transform: scale(1.1);
        text-shadow: 0 0 5px rgba(139, 92, 246, 0.5);
        color: #8b5cf6;
    }
    100% {
        transform: scale(1);
        text-shadow: 0 0 0 rgba(139, 92, 246, 0);
        color: #d5d5d5;
    }
}

/* Sparkle Burst Animation for Icons - Only on Balance Change */
.ucs-sparkle-burst .sparkle {
    animation: ucs-sparkle-burst 2s ease-out forwards;
}

@keyframes ucs-sparkle-burst {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    20% {
        opacity: 1;
        transform: scale(1.2);
    }
    40% {
        opacity: 0.8;
        transform: scale(1);
    }
    60% {
        opacity: 1;
        transform: scale(1.1);
    }
    80% {
        opacity: 0.6;
        transform: scale(0.9);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}
