/* Success Tab Styles */

.success-container {
    text-align: center;
    padding: 40px 20px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Success Animation */
.success-animation {
    margin-bottom: 40px;
    position: relative;
}

.success-circle {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    position: relative;
    animation: scaleIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.success-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.success-circle-bg {
    fill: none;
    stroke: var(--bg-hover);
    stroke-width: 6;
}

.success-circle-fill {
    fill: none;
    stroke: var(--success);
    stroke-width: 6;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    animation: circleProgress 1s ease-out 0.3s forwards;
}

@keyframes circleProgress {
    to {
        stroke-dashoffset: 0;
    }
}

.success-checkmark {
    fill: none;
    stroke: var(--success);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: checkmarkDraw 0.5s ease-out 0.8s forwards;
}

@keyframes checkmarkDraw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Sparkles */
.success-sparkles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    font-size: 24px;
    opacity: 0;
    animation: sparkleFloat 2s ease-out forwards;
}

.sparkle-1 {
    top: 10px;
    left: 20px;
    animation-delay: 1.2s;
}

.sparkle-2 {
    top: 10px;
    right: 20px;
    animation-delay: 1.4s;
}

.sparkle-3 {
    bottom: 20px;
    left: 10px;
    animation-delay: 1.6s;
}

.sparkle-4 {
    bottom: 20px;
    right: 10px;
    animation-delay: 1.8s;
}

@keyframes sparkleFloat {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-20px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0.8);
    }
}

/* Success Content */
.success-content {
    max-width: 500px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.success-message {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
}

/* Success Details - Sequential Animation */
.success-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
    text-align: left;
    background: var(--bg-hover);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-default);
    transition: all 0.5s ease;
}

.success-details.completing {
    animation: detailsComplete 0.5s ease-out forwards;
}

@keyframes detailsComplete {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
    100% {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

.success-details.completed {
    animation: detailsFadeOut 0.6s ease-out forwards;
}

@keyframes detailsFadeOut {
    0% {
        height: auto;
        padding: 24px;
        margin-bottom: 32px;
        opacity: 0.8;
        transform: scale(0.98) translateY(0);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.96) translateY(-10px);
    }
    100% {
        height: 0;
        padding: 0;
        margin: 0;
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
        overflow: hidden;
    }
}

.success-detail-item {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-primary);
    opacity: 0;
    transform: translateX(-30px);
    position: relative;
}

.success-detail-item.animate {
    animation: detailSlideIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes detailSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Checkmark Animation */
.detail-checkmark {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    position: relative;
}

.detail-checkmark svg {
    width: 100%;
    height: 100%;
}

.detail-checkmark circle:first-child {
    opacity: 0.3;
}

.detail-checkmark .check-circle {
    stroke-dasharray: 69;
    stroke-dashoffset: 69;
    transform-origin: center;
    opacity: 0;
}

.success-detail-item.animate .check-circle {
    animation: circleCheck 0.6s ease-out 0.3s forwards;
}

@keyframes circleCheck {
    0% {
        stroke-dashoffset: 69;
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
        transform: scale(1);
    }
}

.detail-checkmark .check-path {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    opacity: 0;
}

.success-detail-item.animate .check-path {
    animation: checkDraw 0.4s ease-out 0.6s forwards;
}

@keyframes checkDraw {
    0% {
        stroke-dashoffset: 20;
        opacity: 0;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

/* Detail Content */
.detail-content {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateX(-10px);
}

.success-detail-item.animate .detail-content {
    animation: contentFadeIn 0.5s ease-out 0.8s forwards;
}

@keyframes contentFadeIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.detail-icon {
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0);
}

.success-detail-item.animate .detail-icon {
    animation: iconPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.9s forwards;
}

@keyframes iconPop {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* Success pulse effect on completion */
.success-detail-item.complete {
    animation: completePulse 0.6s ease-out;
}

@keyframes completePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
        filter: brightness(1.1);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* Glowing pulse effect for checkmarks */
.success-detail-item.animate .detail-checkmark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--success) 0%, transparent 70%);
    opacity: 0;
    border-radius: 50%;
    animation: checkGlow 1.2s ease-out 0.8s;
}

@keyframes checkGlow {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0;
    }
    50% {
        width: 200%;
        height: 200%;
        opacity: 0.4;
    }
    100% {
        width: 300%;
        height: 300%;
        opacity: 0;
    }
}

/* Shimmer effect across detail items */
.success-detail-item.animate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: detailShimmer 1s ease-out 0.5s;
}

@keyframes detailShimmer {
    to {
        left: 100%;
    }
}

/* Username Display - Hidden initially */
.success-username-display {
    position: relative;
    background: var(--bg-active);
    border: 1px solid var(--border-hover);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-username-display.show {
    animation: usernameReveal 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes usernameReveal {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    50% {
        opacity: 1;
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Add a subtle glow effect to the username display */
.success-username-display.show::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--primary-gradient);
    border-radius: 14px;
    opacity: 0;
    z-index: -1;
    animation: usernameGlow 2s ease-out 0.5s;
}

@keyframes usernameGlow {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.02);
    }
    100% {
        opacity: 0;
        transform: scale(1.04);
    }
}

.success-url-preview {
    font-size: 14px;
    color: var(--text-secondary);
}

.success-url-preview strong {
    color: var(--primary-2);
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

/* Success Actions Container */
.success-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-actions.show {
    opacity: 1;
    transform: translateY(0);
}

/* Share Profile Button */
.share-profile-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--bg-active);
    border: 2px solid var(--border-hover);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.share-profile-btn:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: var(--primary-2);
    background: var(--bg-hover);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.share-profile-btn:active {
    transform: translateY(0) scale(0.98);
}

.share-icon {
    transition: transform 0.3s ease;
}

.share-profile-btn:hover .share-icon {
    transform: rotate(15deg);
}

/* Share sparkle effect */
.share-sparkle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--primary-2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
}

.share-profile-btn:hover .share-sparkle {
    animation: shareSparkle 0.8s ease-out;
}

@keyframes shareSparkle {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + 30px), calc(-50% - 30px)) scale(0);
    }
}

/* Share button copied state */
.share-profile-btn.copied {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}

.share-profile-btn.copied .share-icon path {
    d: path("M5 10L8 13L15 6");
}

/* Dashboard Button */
.dashboard-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 36px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    overflow: hidden;
}

.dashboard-btn.show {
    animation: buttonPulse 2s ease-in-out 1.5s;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
    }
}

.dashboard-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}

.dashboard-btn:active {
    transform: translateY(0) scale(0.98);
}

.dashboard-btn-text {
    position: relative;
    z-index: 2;
}

.dashboard-btn-icon {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.dashboard-btn:hover .dashboard-btn-icon {
    transform: translateX(4px);
}

/* Shimmer effect */
.dashboard-btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmerButton 3s ease-in-out infinite;
}

@keyframes shimmerButton {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

/* Success Link */
.success-footer-text {
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-tertiary);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s ease-out;
}

.success-footer-text.show {
    opacity: 1;
    transform: translateY(0);
}

.success-link {
    color: var(--primary-2);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.success-link:hover {
    border-bottom-color: var(--primary-2);
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .success-container {
        padding: 24px 16px;
    }
    
    .success-circle {
        width: 100px;
        height: 100px;
    }
    
    .success-title {
        font-size: 28px;
    }
    
    .success-message {
        font-size: 15px;
    }
    
    .success-details {
        padding: 20px;
    }
    
    .success-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    .share-profile-btn {
        width: 100%;
        padding: 14px 24px;
        font-size: 15px;
    }
    
    .dashboard-btn {
        width: 100%;
        padding: 16px 32px;
    }
    
    .sparkle {
        font-size: 20px;
    }
}

/* Light Theme Adjustments */
[data-theme="light"] .success-details {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .success-username-display {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .share-profile-btn {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .share-profile-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

[data-theme="light"] .dashboard-btn {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
}

[data-theme="light"] .dashboard-btn:hover {
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.35);
}

/* Celebration animation */
@keyframes celebration {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.05) rotate(5deg);
    }
    50% {
        transform: scale(1) rotate(-5deg);
    }
    75% {
        transform: scale(1.05) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.success-animation {
    animation: celebration 1s ease-in-out 2s;
}

/* Particle burst effect for dashboard button */
.dashboard-btn::before {
    content: '✨';
    position: absolute;
    font-size: 20px;
    opacity: 0;
    pointer-events: none;
}

.dashboard-btn.show::before {
    animation: particleBurst1 1.5s ease-out;
}

@keyframes particleBurst1 {
    0% {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        top: -20px;
        left: 20%;
        transform: translate(-50%, -50%) scale(1.5) rotate(360deg);
        opacity: 0;
    }
}

.dashboard-btn::after {
    content: '💫';
    position: absolute;
    font-size: 18px;
    opacity: 0;
    pointer-events: none;
}

.dashboard-btn.show::after {
    animation: particleBurst2 1.5s ease-out 0.2s;
}

@keyframes particleBurst2 {
    0% {
        top: 50%;
        right: 50%;
        transform: translate(50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        top: -20px;
        right: 20%;
        transform: translate(50%, -50%) scale(1.5) rotate(-360deg);
        opacity: 0;
    }
}

/* Glow effect for success circle */
.success-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, var(--success) 0%, transparent 70%);
    opacity: 0;
    animation: glowPulse 2s ease-out 1.3s;
    pointer-events: none;
}

@keyframes glowPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.4);
    }
}