/* ========== WAVE DIVIDER (above footer) ========== */
.footer-wave-wrap {
    position: relative;
    width: 100%;
    height: 120px;
    margin-bottom: -1px;
    overflow: hidden;
    background: transparent;
    pointer-events: none;
    z-index: 2;
}

.footer-wave-wrap svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

/* ===== WAVES: layered navy + coral sliding at three speeds ===== */
.wave {
    animation: footerWave 8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    fill: #0F172A;
}

.wave-base {
    fill: #0F172A;
}

#wave2 {
    animation-duration: 11s;
    animation-direction: reverse;
    opacity: .55;
    fill: #FB923C;
}

#wave3 {
    animation-duration: 14s;
    opacity: .28;
    fill: #F97316;
}

/* New wave motion: smoother cascading flow with a staggered vertical drift */
@keyframes footerWave {
    0%   { transform: translateX(0) translateY(0); }
    25%  { transform: translateX(-25%) translateY(-6px); }
    50%  { transform: translateX(-50%) translateY(0); }
    75%  { transform: translateX(-75%) translateY(6px); }
    100% { transform: translateX(-100%) translateY(0); }
}

@media (max-width: 768px) {
    .footer-wave-wrap { height: 80px; }
}

/* ========== FOOTER ========== */
.main-footer {
    background: var(--gradient-navy);
    color: rgba(255,255,255,0.75);
    padding: 60px 0 0;
    margin-top: auto;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* New background effect: Drifting nebula glow instead of pulsing circle */
.main-footer::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    right: -200px;
    bottom: -300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249,115,22,0.22) 0%, rgba(249,115,22,0) 65%);
    pointer-events: none;
    animation: nebulaDrift 18s ease-in-out infinite alternate;
}

.main-footer::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    left: -150px;
    top: -100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251,146,60,0.15) 0%, rgba(251,146,60,0) 70%);
    pointer-events: none;
    animation: nebulaDrift 22s ease-in-out infinite alternate-reverse;
}

@keyframes nebulaDrift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(-30px, -40px) scale(1.1); }
    100% { transform: translate(20px, 30px) scale(0.9); }
}

/* ========== SPARKLE OVERLAY (twinkling stars rising across the footer) ========== */
.footer-sparks {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.footer-sparks svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.spark {
    fill: #FDBA74;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: sparkRise 10s ease-in-out infinite;
    will-change: transform, opacity;
}

.spark.tone-a { fill: #FDBA74; }
.spark.tone-b { fill: #FFFFFF; }
.spark.tone-c { fill: #F97316; }

.spark1  { animation-duration: 10s; animation-delay: 0s;    }
.spark2  { animation-duration: 13s; animation-delay: -2.5s; }
.spark3  { animation-duration: 11s; animation-delay: -6s;   }
.spark4  { animation-duration: 14s; animation-delay: -9s;   }
.spark5  { animation-duration: 12s; animation-delay: -1.5s; }
.spark6  { animation-duration: 15s; animation-delay: -5s;   }
.spark7  { animation-duration: 10s; animation-delay: -8s;   }
.spark8  { animation-duration: 13s; animation-delay: -3.5s; }
.spark9  { animation-duration: 11s; animation-delay: -7s;   }
.spark10 { animation-duration: 14s; animation-delay: -10s;  }
.spark11 { animation-duration: 12s; animation-delay: -0.8s; }
.spark12 { animation-duration: 15s; animation-delay: -4.8s; }

/* New spark motion: Float higher with an elegant sway */
@keyframes sparkRise {
    0% {
        transform: translateY(60px) translateX(0) scale(0.3) rotate(0deg);
        opacity: 0;
    }
    25% { opacity: 0.9; }
    50% {
        transform: translateY(-60px) translateX(15px) scale(1.1) rotate(90deg);
        opacity: 0.4;
    }
    75% { opacity: 0.8; }
    100% {
        transform: translateY(-200px) translateX(-10px) scale(0.2) rotate(180deg);
        opacity: 0;
    }
}

.spark2, .spark5, .spark8, .spark11 {
    animation-name: sparkOrbit;
}

/* New orbit animation for variety */
@keyframes sparkOrbit {
    0%, 100% { transform: translateY(0) translateX(0) scale(0.4); opacity: 0.1; }
    25%      { transform: translateY(-30px) translateX(-15px) scale(1.2); opacity: 1; }
    50%      { transform: translateY(-70px) translateX(10px) scale(0.6) rotate(45deg); opacity: 0.4; }
    75%      { transform: translateY(-110px) translateX(-5px) scale(1.1) rotate(-20deg); opacity: 0.8; }
}

@media (prefers-reduced-motion: reduce) {
    .wave, .spark, .main-footer::before, .main-footer::after { animation: none; }
    .spark { opacity: 0.4; }
}

/* ========== FOOTER GRID ========== */
.footer-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr 1.3fr;
    gap: 38px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    transition: transform .4s ease;
}

.footer-logo:hover {
    transform: translateY(-3px) scale(1.02);
}

.footer-logo-img {
    height: 100px;
    border-radius: var(--radius-sm);
    padding: 3px;
    transition: box-shadow .4s ease, transform .4s ease;
}

.footer-logo:hover .footer-logo-img {
    box-shadow: 0 12px 26px -6px rgba(249,115,22,0.7);
    transform: rotate(-6deg);
}

.footer-logo-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    display: block;
    line-height: 1;
}

.footer-logo-tag {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.5px;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
    gap: 12px;
}

/* New social interaction: Magnetic pop with rotating glow */
.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.7);
    transition: all .4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-social a:hover {
    background: var(--gradient-primary);
    color: #fff;
    transform: translateY(-6px) rotate(8deg) scale(1.15);
    box-shadow: 0 12px 24px -8px rgba(249,115,22,0.8);
}

.footer-col h4 {
    position: relative;
    color: #fff;
    font-size: 1rem;
    margin-bottom: 22px;
    padding-bottom: 10px;
}

/* New underline effect: Gradient expands from center */
.footer-col h4::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 3px;
    border-radius: 3px;
    background: var(--gradient-primary);
    transform: translateX(-50%);
    transition: width .4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .4s ease;
}

.footer-col:hover h4::after {
    width: 48px;
    box-shadow: 0 0 14px rgba(249,115,22,0.8);
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul a {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.65);
    display: inline-block;
    transition: color .3s ease, transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-col ul a:hover {
    color: #FB923C;
    transform: translateX(6px) scale(1.02);
}

.contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.contact-list i {
    color: #F97316;
    margin-top: 3px;
    width: 16px;
    transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.contact-list li:hover i {
    transform: scale(1.3) rotate(-10deg);
}

.newsletter-form {
    display: flex;
    gap: 0;
    margin-top: 12px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 10px 0 0 10px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
    transition: border-color .3s ease, background .3s ease, box-shadow .3s ease;
}

.newsletter-form input:focus {
    outline: none;
    border-color: rgba(249,115,22,0.6);
    background: rgba(255,255,255,0.14);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}

.newsletter-form input::placeholder {
    color: rgba(255,255,255,0.4);
}

.newsletter-form button {
    padding: 12px 20px;
    background: var(--gradient-primary);
    background-size: 200% 100%;
    color: #fff;
    font-weight: 600;
    border-radius: 0 10px 10px 0;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: background-position .5s ease, filter .3s ease, transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.newsletter-form button:hover {
    background-position: -100% 0;
    filter: brightness(1.1);
    transform: scale(1.02);
}

.footer-bottom {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.10);
}

.footer-bottom p {
    color: rgba(255,255,255,0.6);
}

.footer-bottom-links {
    display: flex;
    gap: 20px;
}

.footer-bottom-links a {
    color: rgba(255,255,255,0.5);
    transition: color .3s ease, transform .3s ease;
    display: inline-block;
}

.footer-bottom-links a:hover {
    color: #F97316;
    transform: translateY(-3px);
}

/* ========== BACK TO TOP ========== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 30px -10px rgba(0,0,0,.25);
    opacity: 0;
    visibility: hidden;
    transition: all .4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 999;
    border: none;
    cursor: pointer;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--secondary);
    transform: translateY(-6px) rotate(360deg) scale(1.1);
    box-shadow: 0 25px 40px -12px rgba(249,115,22,0.6);
}