/* Footer Styling */
footer {
    background-color: var(--footer-bg, #1a1a1a);
    color: var(--footer-text, #e0e0e0);
    padding: 1px;
    text-align: center;
    font-size: 10px;
    line-height: 1.6;
    border-top: 1px solid var(--footer-text, #e0e0e0);
    box-shadow: 0 -2px 15px rgba(22, 163, 74, 0.2);
}

footer p {
    color: var(--secondary-text);
    margin: 0;
    font-weight: 300;
    letter-spacing: 0.5px;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--accent-hover);
}

/* Mobile Footer Navigation */
.mobile-footer-nav {
    display: none; /* Hidden by default */
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--background-body); /* Follows theme background */
    padding: 16px 0;
    border-top: 1px solid var(--accent-color);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.5s ease-out;
}

[data-theme="light"] .footer-links {
    border-top: 1px solid var(--accent-color);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
}

.footer-links li {
    flex: 1;
    text-align: center;
}

.footer-links a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: all 0.2s ease;
}

/* Active indicator (neon badge) */
.footer-links a.active::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--neon-accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--neon-accent), 0 0 12px var(--neon-accent);
    animation: breatheBadge 1.4s infinite ease-in-out;
}

/* Footer Icon Styles */
.footer-icon-home,
.footer-icon-ai,
.footer-icon-earn,
.footer-icon-audit {
    font-size: 20px;
    width: 55px;
    height: 30px;
    line-height: 30px; /* Adjusted to match height */
    border-radius: 12px;
    color: #ffffff; /* White icons in dark mode */
    background: linear-gradient(145deg, rgba(22, 163, 74, 0.3), rgba(59, 130, 246, 0.3));
    border: 1px solid var(--neon-accent);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    animation: popInIcon 0.6s ease-out forwards;
    animation-delay: calc(0.1s * var(--icon-index));
    position: relative;
    overflow: hidden;
}

/* Ripple effect on hover/tap */
.footer-icon-home::after,
.footer-icon-ai::after,
.footer-icon-earn::after,
.footer-icon-audit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--ripple-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
}

.footer-links a:hover .footer-icon-home::after,
.footer-links a:hover .footer-icon-ai::after,
.footer-links a:hover .footer-icon-earn::after,
.footer-links a:hover .footer-icon-audit::after {
    width: 80px;
    height: 80px;
    opacity: 0.3;
}

.footer-links li:nth-child(1) .footer-icon-home { --icon-index: 1; }
.footer-links li:nth-child(2) .footer-icon-ai { --icon-index: 2; }
.footer-links li:nth-child(3) .footer-icon-earn { --icon-index: 3; }
.footer-links li:nth-child(4) .footer-icon-audit { --icon-index: 4; }

.footer-links a:hover .footer-icon-home,
.footer-links a:hover .footer-icon-ai,
.footer-links a:hover .footer-icon-earn,
.footer-links a:hover .footer-icon-audit {
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--neon-accent), 0 0 25px var(--neon-accent);
    background: linear-gradient(145deg, rgba(22, 163, 74, 0.5), rgba(59, 130, 246, 0.5));
}

.footer-links a.active .footer-icon-home,
.footer-links a.active .footer-icon-ai,
.footer-links a.active .footer-icon-earn,
.footer-links a.active .footer-icon-audit {
    color: var(--neon-accent);
    background: linear-gradient(145deg, rgba(22, 163, 74, 0.6), rgba(59, 130, 246, 0.6));
    box-shadow: 0 0 12px var(--neon-accent);
    transform: scale(1.05);
}

/* Light mode specific styles */
[data-theme="light"] .footer-icon-home {
    color: var(--home-icon-color); /* #d97706 */
    background: #ffffff;
    border: 1px solid var(--card-glow);
}

[data-theme="light"] .footer-icon-ai {
    color: var(--ai-icon-color); /* #7e22ce */
    background: #ffffff;
    border: 1px solid var(--card-glow);
}

[data-theme="light"] .footer-icon-earn {
    color: var(--earn-icon-color); /* #747eff */
    background: #ffffff;
    border: 1px solid var(--card-glow);
}

[data-theme="light"] .footer-icon-audit {
    color: var(--trending-icon-color); /* #b91c1c */
    background: #ffffff;
    border: 1px solid var(--card-glow);
}

[data-theme="light"] .footer-links a:hover .footer-icon-home,
[data-theme="light"] .footer-links a:hover .footer-icon-ai,
[data-theme="light"] .footer-links a:hover .footer-icon-earn,
[data-theme="light"] .footer-links a:hover .footer-icon-audit {
    background: #f0f0f0; /* Slightly darker white on hover */
    box-shadow: 0 0 10px var(--card-glow), 0 0 20px var(--card-glow);
}

[data-theme="light"] .footer-links a.active .footer-icon-home,
[data-theme="light"] .footer-links a.active .footer-icon-ai,
[data-theme="light"] .footer-links a.active .footer-icon-earn,
[data-theme="light"] .footer-links a.active .footer-icon-audit {
    color: var(--neon-accent);
    background: #ffffff; /* Keep white background for active */
    box-shadow: 0 0 10px var(--card-glow);
}

/* Hide text for premium mobile app feel */
.footer-links a span {
    display: none;
}

/* Slide-in Animation for Footer Nav */
@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Pop-in Animation for Icons */
@keyframes popInIcon {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Breathe Animation for Active Badge */
@keyframes breatheBadge {
    0% {
        box-shadow: 0 0 8px var(--neon-accent);
    }
    50% {
        box-shadow: 0 0 12px var(--neon-accent), 0 0 18px var(--neon-accent);
    }
    100% {
        box-shadow: 0 0 8px var(--neon-accent);
    }
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .mobile-footer-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
    }

    footer {
        padding-bottom: 80px; /* Space for premium footer nav */
    }
}