/* Welcome Screen Animation Styles */

/* Welcome Overlay */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a1f 0%, #1a1a3e 50%, #0f1b35 100%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeOut 0.5s ease-out 3s forwards;
    pointer-events: none;
}

.welcome-overlay.hide {
    opacity: 0;
    pointer-events: none;
}

/* Animated Welcome Teddy Bear - Running Animation */
.welcome-teddy {
    width: 120px;
    height: 120px;
    position: absolute;
    left: -150px;
    top: 50%;
    transform: translateY(-50%);
    animation: teddyRun 2s ease-in-out forwards;
    z-index: 10001;
}

/* Teddy runs from left to right */
@keyframes teddyRun {
    0% {
        left: -150px;
        transform: translateY(-50%) scaleX(1);
    }
    60% {
        left: calc(100% - 200px);
        transform: translateY(-50%) scaleX(1);
    }
    70% {
        left: calc(100% - 200px);
        transform: translateY(-50%) scaleX(1) rotate(0deg);
    }
    75% {
        transform: translateY(-50%) scaleX(1) rotate(-10deg);
    }
    80% {
        transform: translateY(-50%) scaleX(1) rotate(5deg);
    }
    85% {
        transform: translateY(-50%) scaleX(1) rotate(-5deg);
    }
    90%, 100% {
        left: calc(100% - 200px);
        transform: translateY(-50%) scaleX(1) rotate(0deg) scale(1.1);
    }
}

/* Teddy Bear Body */
.welcome-teddy .teddy-body {
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, #c19a6b, #a67c52);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 10px 20px rgba(139, 111, 71, 0.4),
                inset 0 -3px 10px rgba(0, 0, 0, 0.3);
    animation: bodyBounce 0.3s ease-in-out infinite;
}

@keyframes bodyBounce {
    0%, 100% { transform: translate(-50%, -50%) scaleY(1); }
    50% { transform: translate(-50%, -48%) scaleY(0.95); }
}

/* Teddy Head */
.welcome-teddy .teddy-head {
    width: 65px;
    height: 65px;
    background: linear-gradient(145deg, #c19a6b, #a67c52);
    border-radius: 50%;
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 8px 20px rgba(139, 111, 71, 0.5);
    animation: headBob 0.3s ease-in-out infinite;
}

@keyframes headBob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-3px); }
}

/* Teddy Ears */
.welcome-teddy .teddy-ear {
    width: 22px;
    height: 22px;
    background: linear-gradient(145deg, #c19a6b, #a67c52);
    border-radius: 50%;
    position: absolute;
    top: -3px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.welcome-teddy .teddy-ear.left {
    left: 5px;
}

.welcome-teddy .teddy-ear.right {
    right: 5px;
}

.welcome-teddy .teddy-ear::after {
    content: '';
    width: 12px;
    height: 12px;
    background: linear-gradient(145deg, #f4a460, #d4894a);
    border-radius: 50%;
    position: absolute;
    top: 5px;
    left: 5px;
}

/* Teddy Eyes */
.welcome-teddy .teddy-eye {
    width: 8px;
    height: 8px;
    background: #2c1810;
    border-radius: 50%;
    position: absolute;
    top: 22px;
    animation: eyeBlink 3s ease-in-out infinite;
}

.welcome-teddy .teddy-eye.left {
    left: 18px;
}

.welcome-teddy .teddy-eye.right {
    right: 18px;
}

@keyframes eyeBlink {
    0%, 48%, 52%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(0.1);
    }
}

.welcome-teddy .teddy-eye::after {
    content: '';
    width: 4px;
    height: 4px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    animation: eyeSparkle 2s ease-in-out infinite;
}

@keyframes eyeSparkle {
    0%, 85%, 100% { opacity: 1; }
    90% { opacity: 0.3; }
}

/* Teddy Snout */
.welcome-teddy .teddy-snout {
    width: 28px;
    height: 20px;
    background: linear-gradient(145deg, #f4a460, #d4894a);
    border-radius: 50% 50% 60% 60%;
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Teddy Nose */
.welcome-teddy .teddy-nose {
    width: 10px;
    height: 8px;
    background: #2c1810;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
}

.welcome-teddy .teddy-nose::after {
    content: '';
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
}

/* Teddy Mouth */
.welcome-teddy .teddy-mouth {
    width: 18px;
    height: 10px;
    position: absolute;
    top: 11px;
    left: 50%;
    transform: translateX(-50%);
}

.welcome-teddy .teddy-mouth::before,
.welcome-teddy .teddy-mouth::after {
    content: '';
    width: 8px;
    height: 5px;
    border: 1.5px solid #2c1810;
    border-top: none;
    border-radius: 0 0 10px 10px;
    position: absolute;
}

.welcome-teddy .teddy-mouth::before {
    left: 0;
}

.welcome-teddy .teddy-mouth::after {
    right: 0;
}

/* Teddy Arms */
.welcome-teddy .teddy-arm {
    width: 15px;
    height: 35px;
    background: linear-gradient(145deg, #c19a6b, #a67c52);
    border-radius: 50%;
    position: absolute;
    top: 40%;
}

.welcome-teddy .teddy-arm.left {
    left: -5px;
    transform-origin: top center;
    animation: armRunLeft 0.3s ease-in-out infinite;
}

.welcome-teddy .teddy-arm.right {
    right: -5px;
    transform-origin: top center;
    animation: armRunRight 0.3s ease-in-out infinite;
}

/* Running arm animations */
@keyframes armRunLeft {
    0%, 100% { transform: rotate(-30deg); }
    50% { transform: rotate(30deg); }
}

@keyframes armRunRight {
    0%, 100% { transform: rotate(30deg); }
    50% { transform: rotate(-30deg); }
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    color: #ffffff;
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: messageAppear 0.5s ease-out 0.5s both;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

.welcome-message h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4ff 0%, #a855f7 50%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: textGlow 2s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.8));
    }
}

.welcome-message p {
    font-size: 1rem;
    color: #e5e7eb;
}

/* Laptop that appears on the right */
.laptop {
    position: absolute;
    right: 100px;
    top: 50%;
    transform: translateY(-50%);
    width: 150px;
    height: 100px;
    opacity: 0;
    animation: laptopAppear 0.5s ease-out 1.5s both;
}

@keyframes laptopAppear {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.5) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1) rotate(0deg);
    }
}

/* Laptop screen */
.laptop-screen {
    width: 140px;
    height: 90px;
    background: linear-gradient(135deg, #1a1a3e 0%, #0f1b35 100%);
    border: 3px solid #00d4ff;
    border-radius: 8px 8px 2px 2px;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6),
                inset 0 0 20px rgba(0, 212, 255, 0.2);
    overflow: hidden;
}

/* Code on laptop screen */
.laptop-code {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    font-family: 'Courier New', monospace;
    font-size: 8px;
    color: #00ff00;
    line-height: 1.4;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8);
}

.laptop-code div {
    opacity: 0;
    animation: codeType 0.3s ease-out forwards;
}

.laptop-code div:nth-child(1) { animation-delay: 1.7s; }
.laptop-code div:nth-child(2) { animation-delay: 1.8s; }
.laptop-code div:nth-child(3) { animation-delay: 1.9s; }
.laptop-code div:nth-child(4) { animation-delay: 2.0s; }
.laptop-code div:nth-child(5) { animation-delay: 2.1s; }

@keyframes codeType {
    to { opacity: 1; }
}

/* Laptop base */
.laptop-base {
    width: 150px;
    height: 8px;
    background: linear-gradient(145deg, #c19a6b, #8b6f47);
    border-radius: 0 0 10px 10px;
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Sparkle effect when teddy catches laptop */
.catch-sparkle {
    position: absolute;
    right: 120px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    opacity: 0;
    animation: sparkle 0.5s ease-out 2s both;
}

@keyframes sparkle {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.5) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-50%) scale(0.5) rotate(360deg);
    }
}

.catch-sparkle::before,
.catch-sparkle::after {
    content: '✨';
    position: absolute;
    font-size: 30px;
    animation: sparkleRotate 0.5s ease-out infinite;
}

.catch-sparkle::before {
    top: 0;
    left: 0;
}

.catch-sparkle::after {
    bottom: 0;
    right: 0;
}

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

/* Coding Vibe - Hidden for running animation */
.coding-vibe {
    display: none;
}

/* Loading Progress - Hidden for running animation */
.loading-progress {
    display: none;
}

/* Fade out entire overlay */
@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .welcome-teddy {
        width: 150px;
        height: 150px;
    }
    
    .welcome-message h1 {
        font-size: 2rem;
    }
    
    .welcome-message p {
        font-size: 1rem;
    }
    
    .loading-progress {
        width: 200px;
    }
}
