/* ========================================
   ANIMATED SUBSCRIBE SECTION
   Walking Suitcase with 8-frame sprite animation
   ======================================== */

.subscribe-animated-section {
    position: relative;
    padding: 0;
    margin: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    min-height: 320px;
}

/* Suitcase Container */
.suitcase-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* Suitcase Traveler - moves across screen */
.suitcase-traveler {
    position: absolute;
    top: 50%;
    left: -180px;
    transform: translateY(-50%);
    animation: travelAcross 14s linear infinite;
}

@keyframes travelAcross {
    0% {
        left: -180px;
        opacity: 0;
    }
    3% {
        opacity: 1;
    }
    50% {
        left: 50%;
        transform: translateY(-50%) translateX(-50%);
    }
    97% {
        opacity: 1;
    }
    100% {
        left: calc(100% + 180px);
        opacity: 0;
    }
}

/* Walking Suitcase - 8 frame animation */
.suitcase-walker {
    width: 140px;
    height: 110px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: walkCycle 0.6s steps(1) infinite;
    filter: drop-shadow(0 8px 16px rgba(59, 130, 246, 0.6))
            drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    transition: filter 0.3s ease;
}

/* Frame-by-frame walking animation */
@keyframes walkCycle {
    0%      { background-image: url('../images/subscribe-frames/valise-01.svg'); }
    12.5%   { background-image: url('../images/subscribe-frames/valise-02.svg'); }
    25%     { background-image: url('../images/subscribe-frames/valise-03.svg'); }
    37.5%   { background-image: url('../images/subscribe-frames/valise-04.svg'); }
    50%     { background-image: url('../images/subscribe-frames/valise-05.svg'); }
    62.5%   { background-image: url('../images/subscribe-frames/valise-06.svg'); }
    75%     { background-image: url('../images/subscribe-frames/valise-07.svg'); }
    87.5%   { background-image: url('../images/subscribe-frames/valise-08.svg'); }
    100%    { background-image: url('../images/subscribe-frames/valise-01.svg'); }
}

/* Dynamic shadow under suitcase */
.suitcase-shadow {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 24px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.15) 50%, transparent 70%);
    border-radius: 50%;
    animation: shadowWalk 0.3s ease-in-out infinite;
}

@keyframes shadowWalk {
    0%, 100% { 
        transform: translateX(-50%) scaleX(1) scaleY(1); 
        opacity: 0.6;
    }
    25% { 
        transform: translateX(-45%) scaleX(0.9) scaleY(0.8); 
        opacity: 0.5;
    }
    50% { 
        transform: translateX(-50%) scaleX(1.1) scaleY(1.1); 
        opacity: 0.7;
    }
    75% { 
        transform: translateX(-55%) scaleX(0.9) scaleY(0.8); 
        opacity: 0.5;
    }
}

/* Dust particles trail */
.suitcase-trail {
    position: absolute;
    top: 75%;
    left: -60px;
    display: flex;
    gap: 12px;
    transform: translateY(-50%);
}

.trail-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    animation: dustFloat 0.8s ease-out infinite;
}

.trail-dot:nth-child(1) { 
    animation-delay: 0s; 
    width: 4px; height: 4px;
}
.trail-dot:nth-child(2) { 
    animation-delay: 0.15s; 
    width: 5px; height: 5px;
}
.trail-dot:nth-child(3) { 
    animation-delay: 0.3s; 
}
.trail-dot:nth-child(4) { 
    animation-delay: 0.45s; 
    width: 4px; height: 4px;
}
.trail-dot:nth-child(5) { 
    animation-delay: 0.6s; 
    width: 3px; height: 3px;
}

@keyframes dustFloat {
    0% { 
        opacity: 0.6; 
        transform: translateY(0) translateX(0) scale(1); 
    }
    50% { 
        opacity: 0.3; 
        transform: translateY(-8px) translateX(-5px) scale(0.8); 
    }
    100% { 
        opacity: 0; 
        transform: translateY(-15px) translateX(-10px) scale(0.4); 
    }
}

/* Footstep marks */
.footstep-container {
    position: absolute;
    bottom: 15%;
    left: 0;
    width: 100%;
    height: 30px;
    pointer-events: none;
    overflow: hidden;
}

.footstep {
    position: absolute;
    width: 8px;
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 40%;
    animation: footFade 2s ease-out forwards;
}

@keyframes footFade {
    0% { opacity: 0.3; }
    100% { opacity: 0; }
}

@keyframes trailFade {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 0.8; transform: scale(1); }
}

/* Subscribe Content - appears when suitcase arrives */
.subscribe-content-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 40px 20px;
}

.subscribe-content {
    text-align: center;
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
    animation: contentReveal 1s ease forwards;
    animation-delay: 4s;
}

@keyframes contentReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subscribe-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.subscribe-icon i {
    font-size: 1.5rem;
    color: white;
}

.subscribe-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.subscribe-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
}

/* Subscribe Form */
.subscribe-form-animated {
    display: flex;
    gap: 12px;
    max-width: 450px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.subscribe-input-wrapper {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.subscribe-input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
}

.subscribe-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.subscribe-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.subscribe-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.subscribe-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.subscribe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5);
}

.subscribe-btn i {
    transition: transform 0.3s ease;
}

.subscribe-btn:hover i {
    transform: translateX(4px);
}

/* Decorative Elements */
.subscribe-decoration {
    position: absolute;
    pointer-events: none;
}

.decoration-circle {
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.decoration-circle-1 {
    width: 200px;
    height: 200px;
    top: -50px;
    right: 10%;
    animation: floatCircle 8s ease-in-out infinite;
}

.decoration-circle-2 {
    width: 150px;
    height: 150px;
    bottom: -30px;
    left: 5%;
    animation: floatCircle 10s ease-in-out infinite reverse;
}

.decoration-circle-3 {
    width: 80px;
    height: 80px;
    top: 30%;
    left: 15%;
    animation: floatCircle 6s ease-in-out infinite;
    animation-delay: 2s;
}

@keyframes floatCircle {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.1); }
}

/* Stars/Sparkles */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    animation: sparkle 2s ease-in-out infinite;
}

.sparkle-1 { top: 20%; left: 20%; animation-delay: 0s; }
.sparkle-2 { top: 40%; right: 25%; animation-delay: 0.5s; }
.sparkle-3 { bottom: 30%; left: 30%; animation-delay: 1s; }
.sparkle-4 { top: 60%; right: 15%; animation-delay: 1.5s; }
.sparkle-5 { bottom: 20%; right: 35%; animation-delay: 0.3s; }

@keyframes sparkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}

/* Responsive */
@media (max-width: 640px) {
    .subscribe-animated-section {
        min-height: 350px;
    }
    
    .suitcase-walker {
        width: 100px;
        height: 80px;
    }
    
    .suitcase-shadow {
        width: 70px;
        height: 18px;
        bottom: -18px;
    }
    
    .subscribe-form-animated {
        flex-direction: column;
    }
    
    .subscribe-input-wrapper {
        width: 100%;
    }
    
    .subscribe-btn {
        width: 100%;
        justify-content: center;
    }
    
    .subscribe-content {
        animation-delay: 3s;
    }
    
    @keyframes travelAcross {
        0% { left: -120px; opacity: 0; }
        5% { opacity: 1; }
        50% { left: 50%; transform: translateY(-50%) translateX(-50%); }
        95% { opacity: 1; }
        100% { left: calc(100% + 120px); opacity: 0; }
    }
    
    .trail-dot {
        width: 4px;
        height: 4px;
    }
}

/* Plane flying across (alternative decoration) */
.flying-plane {
    position: absolute;
    top: 20%;
    left: -50px;
    animation: flyAcross 15s linear infinite;
    opacity: 0.3;
}

.flying-plane i {
    font-size: 1.5rem;
    color: white;
    transform: rotate(-20deg);
}

@keyframes flyAcross {
    0% { left: -50px; top: 20%; }
    100% { left: 110%; top: 10%; }
}

/* Subscribe Success Message */
.subscribe-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.15) 0%, rgba(32, 201, 151, 0.15) 100%);
    border: 2px solid #28a745;
    border-radius: 50px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
    animation: successPop 0.5s ease-out;
}

.subscribe-success i {
    font-size: 1.5rem;
    color: #28a745;
    animation: checkBounce 0.6s ease-out;
}

@keyframes successPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes checkBounce {
    0%, 20% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* Preload SVG frames for smooth animation */
.suitcase-walker::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    visibility: hidden;
    background-image: 
        url('../images/subscribe-frames/valise-01.svg'),
        url('../images/subscribe-frames/valise-02.svg'),
        url('../images/subscribe-frames/valise-03.svg'),
        url('../images/subscribe-frames/valise-04.svg'),
        url('../images/subscribe-frames/valise-05.svg'),
        url('../images/subscribe-frames/valise-06.svg'),
        url('../images/subscribe-frames/valise-07.svg'),
        url('../images/subscribe-frames/valise-08.svg');
}
