/**
 * Fancy Buy Now Success Modal Styles
 * Beautiful animated success popup for domain purchases
 */

/* Success Animation Container */
.success-animation-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

/* Animated Checkmark */
.success-checkmark {
    width: 80px;
    height: 80px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #4CAF50;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 
        0 10px 40px rgba(76, 175, 80, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

.icon-line {
    height: 5px;
    background-color: white;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s 0.5s ease-in-out forwards;
}

.icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s 0.5s ease-in-out forwards;
}

.icon-circle {
    top: -4px;
    left: -4px;
    z-index: 10;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: absolute;
    box-sizing: content-box;
    border: 4px solid rgba(76, 175, 80, .5);
}

.icon-fix {
    top: 8px;
    width: 5px;
    left: 26px;
    z-index: 1;
    height: 85px;
    position: absolute;
    transform: rotate(-45deg);
    background-color: #2e7d32;
}

/* Success Stars Animation */
.success-stars {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.star {
    position: absolute;
    font-size: 1.5rem;
    animation: star-burst 1.5s ease-out forwards;
    opacity: 0;
}

.star-1 { top: -10px; left: 50%; animation-delay: 0.6s; }
.star-2 { top: 20%; right: -10px; animation-delay: 0.7s; font-size: 1.2rem; }
.star-3 { bottom: 10%; right: 10%; animation-delay: 0.8s; }
.star-4 { bottom: 0; left: -5px; animation-delay: 0.9s; font-size: 1rem; }
.star-5 { top: 30%; left: -10px; animation-delay: 1s; }

@keyframes star-burst {
    0% {
        opacity: 0;
        transform: scale(0) translate(0, 0);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) translate(var(--star-x, 0), var(--star-y, 0));
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translate(calc(var(--star-x, 0) * 1.5), calc(var(--star-y, 0) * 1.5));
    }
}

.star-1 { --star-x: -20px; --star-y: -30px; }
.star-2 { --star-x: 30px; --star-y: -10px; }
.star-3 { --star-x: 20px; --star-y: 20px; }
.star-4 { --star-x: -30px; --star-y: -20px; }
.star-5 { --star-x: -40px; --star-y: 10px; }

/* Checkmark Animations */
@keyframes rotate-circle {
    0% { transform: rotate(-45deg); }
    5% { transform: rotate(-45deg); }
    12% { transform: rotate(-405deg); }
    100% { transform: rotate(-405deg); }
}

@keyframes icon-line-tip {
    0% { width: 0; left: 1px; top: 19px; }
    54% { width: 0; left: 1px; top: 19px; }
    70% { width: 50px; left: -8px; top: 37px; }
    84% { width: 17px; left: 21px; top: 48px; }
    100% { width: 25px; left: 14px; top: 45px; }
}

@keyframes icon-line-long {
    0% { width: 0; right: 46px; top: 54px; }
    65% { width: 0; right: 46px; top: 54px; }
    84% { width: 55px; right: 0; top: 35px; }
    100% { width: 47px; right: 8px; top: 38px; }
}

/* Success Title Animation */
.success-title {
    animation: success-title-bounce 0.6s ease-out 0.5s both;
}

@keyframes success-title-bounce {
    0% { opacity: 0; transform: scale(0.8) translateY(10px); }
    50% { transform: scale(1.05) translateY(-5px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Purchase Details Styling */
.success-details {
    position: relative;
}

.purchased-domain {
    text-align: center;
    margin-bottom: 1.5rem;
    animation: fade-in-up 0.6s ease-out 0.8s both;
}

@keyframes fade-in-up {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 100px;
    padding: 0.75rem 1.5rem;
    backdrop-filter: blur(10px);
}

.domain-icon {
    font-size: 1.5rem;
    animation: rotate-globe 3s linear infinite;
}

@keyframes rotate-globe {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.domain-name-success {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Purchase Info */
.purchase-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    animation: fade-in-up 0.6s ease-out 1s both;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.info-value {
    font-weight: 600;
    color: white;
}

.price-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.2);
    }
}

/* Success Message */
.success-message {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    animation: fade-in-up 0.6s ease-out 1.2s both;
}

.message-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.success-message p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* Confetti Animation */
.confetti-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    top: 0;
    left: 0;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    animation: confetti-fall 3s ease-out forwards;
}

.confetti:nth-child(2n) {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.confetti:nth-child(3n) {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.confetti:nth-child(4n) {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    width: 8px;
    height: 8px;
}

.confetti:nth-child(5n) {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    width: 12px;
    height: 12px;
}

.confetti-1 { left: 10%; animation-delay: 0.5s; }
.confetti-2 { left: 25%; animation-delay: 0.7s; }
.confetti-3 { left: 40%; animation-delay: 0.6s; }
.confetti-4 { left: 55%; animation-delay: 0.8s; }
.confetti-5 { left: 70%; animation-delay: 0.5s; }
.confetti-6 { left: 85%; animation-delay: 0.9s; }
.confetti-7 { left: 50%; animation-delay: 0.6s; }
.confetti-8 { left: 95%; animation-delay: 0.7s; }

@keyframes confetti-fall {
    0% {
        opacity: 1;
        top: -10%;
        transform: translateX(0) rotateZ(0deg);
    }
    100% {
        opacity: 0;
        top: 100%;
        transform: translateX(var(--confetti-x, 100px)) rotateZ(720deg);
    }
}

.confetti-1 { --confetti-x: -50px; }
.confetti-2 { --confetti-x: 50px; }
.confetti-3 { --confetti-x: -30px; }
.confetti-4 { --confetti-x: 30px; }
.confetti-5 { --confetti-x: -70px; }
.confetti-6 { --confetti-x: 20px; }
.confetti-7 { --confetti-x: -40px; }
.confetti-8 { --confetti-x: 60px; }

/* Messages Button Animation */
.btn-messages {
    animation: pulse-button 2s ease-in-out infinite;
}

@keyframes pulse-button {
    0%, 100% {
        box-shadow: 
            0 10px 40px rgba(99, 102, 241, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 
            0 15px 50px rgba(99, 102, 241, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

/* Error Modal Styling */
.modal-error .error-message {
    text-align: center;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .success-animation-container {
        width: 100px;
        height: 100px;
    }
    
    .success-checkmark,
    .check-icon {
        width: 60px;
        height: 60px;
    }
    
    .domain-name-success {
        font-size: 1.1rem;
    }
    
    .price-value {
        font-size: 1.1rem;
    }
}

/* Dark Mode Override */
.buy-now-success-modal .modal-content,
.buy-now-error-modal .modal-content {
    background: rgba(15, 15, 15, 0.95);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Accessibility Animations */
@media (prefers-reduced-motion: reduce) {
    .star,
    .domain-icon,
    .status-dot,
    .confetti,
    .btn-messages {
        animation: none;
    }
    
    .success-title,
    .purchased-domain,
    .purchase-info,
    .success-message {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
