/* assets/css/footer.css */

/* --- FOOTER VARIABLES --- */
:root {
    --footer-bg-dark: #131A22;
    --footer-bg-light: #232F3E;
    --footer-bg-hover: #37475A;
    --footer-text-color: #DDD;
    --footer-link-hover: #FFF;
    --border-color: #3A4553;
}

/* --- BACK TO TOP --- */
#footer-back-to-top {
    background-color: var(--footer-bg-hover);
    color: #fff;
    text-align: center;
    padding: 15px 0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    user-select: none;
}

#footer-back-to-top:hover {
    background-color: #485769;
}

/* --- MAIN FOOTER --- */
#main-footer {
    background-color: var(--footer-bg-light);
    color: var(--footer-text-color);
    font-family: 'Poppins', sans-serif;
    width: 100%;
}

.footer__links-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px;
}

.footer__column {
    display: flex;
    flex-direction: column;
}

.footer__heading {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    white-space: nowrap;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default; /* Default cursor on desktop */
}

/* Hide arrow on desktop */
.mobile-arrow {
    display: none;
}

.footer__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer__list li {
    margin-bottom: 10px;
}

.footer__column a {
    color: var(--footer-text-color);
    font-size: 14px;
    text-decoration: none;
    transition: text-decoration 0.2s;
}

.footer__column a:hover {
    text-decoration: underline;
    color: #fff;
}

/* --- MIDDLE SECTION (Logo & Language) --- */
.footer__middle {
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    background-color: var(--footer-bg-light);
    display: flex;
    justify-content: center;
}

.footer__middle-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer__logo {
    height: 70px;
    margin-right: 40px;
    filter: brightness(0) invert(1);
}

.language-selector,
.country-selector {
    border: 1px solid #848688;
    border-radius: 4px;
    padding: 6px 18px 6px 8px;
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: border-color 0.2s;
}

.language-selector:hover,
.country-selector:hover {
    border-color: #fff;
    color: #fff;
}

/* --- LEGAL SECTION --- */
#footer-legal {
    background-color: var(--footer-bg-dark);
    padding: 30px 0;
    font-size: 12px;
    text-align: center;
}

#footer-legal ul {
    display: flex;
    justify-content: center;
    gap: 20px;
    list-style: none;
    margin-bottom: 10px;
    padding: 0;
    flex-wrap: wrap;
}

#footer-legal ul li a {
    color: #ddd;
    text-decoration: none;
}

#footer-legal ul li a:hover {
    text-decoration: underline;
}

#footer-legal p {
    color: #999;
    margin-top: 5px;
}

/* =========================================
   APP-LIKE MOBILE RESPONSIVENESS
   ========================================= */

@media (max-width: 992px) {
    .footer__links-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 40px 30px;
    }
}

@media (max-width: 768px) {
    /* Stack columns vertically */
    .footer__links-container {
        display: block;
        padding: 0;
        grid-template-columns: 1fr;
    }

    .footer__column {
        border-bottom: 1px solid var(--border-color);
    }

    /* Make Headings Clickable Buttons */
    .footer__heading {
        margin: 0;
        padding: 20px;
        font-size: 15px;
        cursor: pointer;
        background-color: var(--footer-bg-light);
        transition: background-color 0.2s;
    }
    
    .footer__heading:active {
        background-color: var(--footer-bg-hover);
    }

    /* Show Mobile Arrow */
    .mobile-arrow {
        display: block;
        font-size: 12px;
        color: #999;
        transition: transform 0.3s ease;
    }

    /* ACCORDION LOGIC */
    
    /* Default: Hide list */
    .footer__list {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        background-color: #1a2430; /* Slightly darker inner bg */
    }
    
    .footer__list li {
        margin: 0;
    }

    .footer__list li a {
        display: block;
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        color: #ccc;
    }

    /* ACTIVE STATE (Toggled via JS) */
    .footer__column.active .footer__list {
        max-height: 500px; /* Arbitrary large height */
    }

    .footer__column.active .mobile-arrow {
        transform: rotate(180deg);
        color: #fff;
    }

    /* Rest of Footer Elements */
    .footer__middle-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer__logo {
        margin-right: 0;
        margin-bottom: 10px;
    }

    #footer-legal ul {
        flex-direction: column;
        gap: 15px;
    }
}