/* Footer */
.footer {
    position: relative;
    z-index: 20;
    background: #0f172a;
    color: white;
    padding-top: 4rem;
    padding-bottom: 8rem;
    /* Extra padding for mobile bottom nav overlap */
    min-height: 50vh;
    border-top-left-radius: 3rem;
    border-top-right-radius: 3rem;
    scroll-snap-align: start;
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.5);
    margin-top: 0;
}

@media (min-width: 768px) {
    .footer {
        padding-bottom: 2rem;
        /* Reset for desktop */
    }
}

/* Fix grid to ensure links aren't misplaced */
.footer-grid {
    display: flex;
    flex-direction: column-reverse;
    /* Put links above logo on mobile if preferred, or column for standard stacking */
    gap: 3rem;
    width: 100%;
    align-items: center;
    /* Center items on mobile */
    text-align: center;
    /* Center text on mobile */
}

/* On mobile, we might want the links first or standard order. Let's stick to standard column. */
.footer-grid {
    flex-direction: column;
}

@media (min-width: 768px) {
    .footer-grid {
        display: grid;
        grid-template-columns: 1.5fr 1fr;
        /* Desktop: Grid */
        gap: 4rem;
        align-items: start;
        text-align: left;
        /* Reset text align for desktop */
    }
}

/* RTL Support for Grid */
[dir="rtl"] .footer-grid {
    /* RTL adjustments if needed */
}

@media (min-width: 768px) {
    [dir="rtl"] .footer-grid {
        text-align: right;
    }
}

/* Ensure column layout for footer items */
.footer-grid>div {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

@media (min-width: 768px) {
    .footer-grid>div {
        align-items: flex-start;
        text-align: left;
    }

    [dir="rtl"] .footer-grid>div {
        align-items: flex-start;
        /* Still flex-start relative to direction, but text-align handles text */
        text-align: right;
    }
}

.footer-logo {
    height: 3rem;
    filter: brightness(0) invert(1);
    margin-bottom: 1.5rem;
}

.footer-desc {
    color: #cbd5e1;
    font-size: 1.125rem;
    line-height: 1.6;
}

/* Social Links */
.footer-socials {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.social-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: 0.2s;
    font-size: 1.2rem;
}

/* Brand Colors */
.social-btn.whatsapp {
    background: #25D366;
}

.social-btn.linkedin {
    background: #0077b5;
}

.social-btn.discord {
    background: #5865F2;
}

.social-btn.x-twitter {
    background: black;
}

.social-btn.tiktok {
    background: black;
}

.social-btn.viber {
    background: #665CAC;
}

.social-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

/* Footer Links */
.footer-heading {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
    display: inline-block;
    min-width: 150px;
    /* Ensure visual stability */
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-inline-start: 0;
    /* Remove default ul indentation */

    /* Fix for conflict with navbar .nav-links */
    position: static !important;
    transform: none !important;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-links a.highlight {
    color: #60a5fa;
    font-weight: bold;
}

/* Ecosystem Grid */
.footer-ecosystem {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    margin-top: 2rem;
}

.footer-ecosystem-title {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.footer-ecosystem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.ecosystem-card {
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    text-align: center;
    text-decoration: none;
    transition: 0.3s;
    display: block;
}

.ecosystem-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.ecosystem-card .title {
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.ecosystem-card .desc {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Copyright */
.footer-copyright {
    text-align: center;
    margin-top: 2rem;
    color: #64748b;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}