/**
 * emadbrz – Footer: glass neumorphism dark, full advanced responsive.
 * Breakpoints: 1200+ (xl), 992–1199 (lg), 768–991 (md), 576–767 (sm), 0–575 (xs).
 */

.emadbrz-footer {
    /* Responsive tokens – overridden in media queries */
    --footer-margin: 20px;
    --footer-margin-block: 2rem;
    --footer-padding-block: 2rem 1.5rem;
    --footer-padding-inline: 1.75rem;
    --footer-radius: 20px;
    --footer-inner-max: 1200px;
    --footer-top-gap: 2rem;
    --footer-top-padding-bottom: 1.5rem;
    --footer-logo-size: 1.35rem;
    --footer-logo-spacing: 0.5rem;
    --footer-about-size: 0.875rem;
    --footer-about-max: 280px;
    --footer-links-size: 0.9rem;
    --footer-links-gap: 0.4rem;
    --footer-enamad-size: 80px;
    --footer-enamad-radius: 12px;
    --footer-social-gap: 0.5rem;
    --footer-social-size: 2.25rem;
    --footer-social-icon: 20px;
    --footer-social-padding: 1.25rem 0;
    --footer-bottom-gap: 0.75rem;
    --footer-bottom-padding-top: 1rem;
    --footer-bottom-size: 0.8rem;
    /* Safe area for notched / home-indicator devices */
    padding-bottom: max(var(--footer-margin), env(safe-area-inset-bottom, 0px));
    margin: var(--footer-margin-block) var(--footer-margin) var(--footer-margin);
    padding: var(--footer-padding-block) var(--footer-padding-inline);
    background: linear-gradient(
        135deg,
        rgba(20, 20, 22, 0.85) 0%,
        rgba(12, 12, 14, 0.9) 50%,
        rgba(18, 18, 20, 0.85) 100%
    );
    backdrop-filter: blur(20px) saturate(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(1.1);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--footer-radius);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.2) inset,
        0 1px 0 0 rgba(255, 255, 255, 0.04),
        0 4px 24px rgba(0, 0, 0, 0.35);
}

.emadbrz-footer__inner {
    max-width: var(--footer-inner-max);
    margin: 0 auto;
}

/* Scroll-in animation */
.emadbrz-footer .emadbrz-footer__inner > * {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s ease-out, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.emadbrz-footer .emadbrz-footer__inner > *:nth-child(1) { transition-delay: 0.05s; }
.emadbrz-footer .emadbrz-footer__inner > *:nth-child(2) { transition-delay: 0.12s; }
.emadbrz-footer .emadbrz-footer__inner > *:nth-child(3) { transition-delay: 0.19s; }
.emadbrz-footer .emadbrz-footer__inner > *:nth-child(4) { transition-delay: 0.26s; }

.emadbrz-footer.emadbrz-footer--visible .emadbrz-footer__inner > * {
    opacity: 1;
    transform: translateY(0);
}

/* Top row: brand | links | enamad – desktop 3 columns */
.emadbrz-footer__top {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: var(--footer-top-gap);
    align-items: start;
    padding-bottom: var(--footer-top-padding-bottom);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.emadbrz-footer__brand {
    min-width: 0;
}

.emadbrz-footer__logo {
    display: inline-block;
    color: #fff;
    text-decoration: none;
    font-size: var(--footer-logo-size);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--footer-logo-spacing);
    padding: 0.15em 0;
}

.emadbrz-footer__logo:hover {
    color: rgba(255, 255, 255, 0.9);
}

.emadbrz-footer__logo-img {
    display: block;
    max-height: 2rem;
    width: auto;
    height: auto;
    object-fit: contain;
}

.emadbrz-footer__about {
    margin: 0;
    font-size: var(--footer-about-size);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.75);
    max-width: var(--footer-about-max);
}

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

.emadbrz-footer__links-list li {
    margin: 0 0 var(--footer-links-gap);
}

.emadbrz-footer__links-list a {
    display: inline-block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: var(--footer-links-size);
    transition: color 0.2s ease;
    padding: 0.2em 0;
}

.emadbrz-footer__links-list a:hover {
    color: #fff;
}

.emadbrz-footer__enamad-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--footer-enamad-size);
    height: var(--footer-enamad-size);
    min-width: var(--footer-enamad-size);
    min-height: var(--footer-enamad-size);
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--footer-enamad-radius);
    overflow: hidden;
    transition: background 0.2s ease;
}

.emadbrz-footer__enamad-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.emadbrz-footer__enamad-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.emadbrz-footer__enamad-placeholder {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Social row */
.emadbrz-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: var(--footer-social-gap);
    padding: var(--footer-social-padding);
}

.emadbrz-footer__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--footer-social-size);
    height: var(--footer-social-size);
    min-width: var(--footer-social-size);
    min-height: var(--footer-social-size);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.emadbrz-footer__social-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.08);
}

.emadbrz-footer__social-link svg {
    width: var(--footer-social-icon);
    height: var(--footer-social-icon);
}

/* Bottom: copyright + programmer */
.emadbrz-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--footer-bottom-gap);
    padding-top: var(--footer-bottom-padding-top);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: var(--footer-bottom-size);
    color: rgba(255, 255, 255, 0.6);
}

.emadbrz-footer__copyright {
    margin: 0;
}

.emadbrz-footer__programmer {
    margin: 0;
}

.emadbrz-footer__programmer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.emadbrz-footer__programmer a:hover {
    color: #fff;
}

.emadbrz-footer__programmer-sep {
    color: rgba(255, 255, 255, 0.4);
}

/* ========== RESPONSIVE: Tablet (md) 768px – 991px ========== */
@media (max-width: 991px) {
    .emadbrz-footer {
        --footer-margin: 16px;
        --footer-margin-block: 1.75rem;
        --footer-padding-block: 1.75rem 1.35rem;
        --footer-padding-inline: 1.5rem;
        --footer-radius: 18px;
        --footer-top-gap: 1.75rem;
        --footer-top-padding-bottom: 1.35rem;
        --footer-logo-size: 1.25rem;
        --footer-about-size: 0.8125rem;
        --footer-about-max: 260px;
        --footer-links-size: 0.875rem;
        --footer-enamad-size: 72px;
        --footer-enamad-radius: 10px;
        --footer-social-size: 2.25rem;
        --footer-social-padding: 1.1rem 0;
        --footer-bottom-padding-top: 0.9rem;
        --footer-bottom-size: 0.7875rem;
    }

    .emadbrz-footer__top {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand links"
            "brand enamad";
        gap: 1.5rem 2rem;
    }

    .emadbrz-footer__brand {
        grid-area: brand;
    }

    .emadbrz-footer__links {
        grid-area: links;
    }

    .emadbrz-footer__enamad {
        grid-area: enamad;
        align-self: start;
    }

    .emadbrz-footer__logo-img {
        max-height: 1.85rem;
    }
}

/* ========== RESPONSIVE: Small tablet / large phone (sm) 576px – 767px ========== */
/* From 767px down: all footer content center-aligned (both RTL & LTR) */
@media (max-width: 767px) {
    .emadbrz-footer {
        --footer-margin: 14px;
        --footer-margin-block: 1.5rem;
        --footer-padding-block: 1.5rem 1.25rem;
        --footer-padding-inline: 1.25rem;
        --footer-radius: 16px;
        --footer-top-gap: 1.5rem;
        --footer-top-padding-bottom: 1.25rem;
        --footer-logo-size: 1.2rem;
        --footer-logo-spacing: 0.45rem;
        --footer-about-size: 0.8125rem;
        --footer-about-max: none;
        --footer-links-size: 0.875rem;
        --footer-links-gap: 0.35rem;
        --footer-enamad-size: 64px;
        --footer-enamad-radius: 10px;
        --footer-social-size: 2.5rem;
        --footer-social-icon: 22px;
        --footer-social-gap: 0.6rem;
        --footer-social-padding: 1rem 0;
        --footer-bottom-gap: 0.65rem;
        --footer-bottom-padding-top: 0.85rem;
        --footer-bottom-size: 0.75rem;
    }

    .emadbrz-footer__inner {
        text-align: center;
    }

    .emadbrz-footer__top {
        grid-template-columns: 1fr;
        grid-template-areas:
            "brand"
            "links"
            "enamad";
        gap: 1.35rem;
        align-items: center;
        justify-items: center;
    }

    .emadbrz-footer__brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .emadbrz-footer__about {
        margin-inline: auto;
    }

    .emadbrz-footer__links-list {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .emadbrz-footer__links-list a {
        min-height: 44px;
        padding: 0.5em 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .emadbrz-footer__enamad {
        align-self: center;
        justify-self: center;
    }

    .emadbrz-footer__social {
        justify-content: center;
    }

    .emadbrz-footer__bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .emadbrz-footer__logo-img {
        max-height: 1.75rem;
    }
}

/* ========== RESPONSIVE: Mobile (xs) 0 – 575px ========== */
@media (max-width: 575px) {
    .emadbrz-footer {
        --footer-margin: 12px;
        --footer-margin-block: 1.25rem;
        --footer-padding-block: 1.35rem 1.15rem;
        --footer-padding-inline: 1rem;
        --footer-radius: 14px;
        --footer-top-gap: 1.25rem;
        --footer-top-padding-bottom: 1.1rem;
        --footer-logo-size: 1.1rem;
        --footer-logo-spacing: 0.4rem;
        --footer-about-size: 0.8rem;
        --footer-links-size: 0.85rem;
        --footer-links-gap: 0.25rem;
        --footer-enamad-size: 56px;
        --footer-enamad-radius: 8px;
        --footer-social-size: 2.75rem;
        --footer-social-icon: 22px;
        --footer-social-gap: 0.5rem;
        --footer-social-padding: 0.9rem 0;
        --footer-bottom-gap: 0.5rem;
        --footer-bottom-padding-top: 0.75rem;
        --footer-bottom-size: 0.7375rem;
    }

    .emadbrz-footer__inner {
        max-width: 100%;
    }

    .emadbrz-footer__logo-img {
        max-height: 1.6rem;
    }

    .emadbrz-footer__programmer {
        line-height: 1.45;
    }
}

/* ========== RTL: logical spacing (no layout change) ========== */
[dir="rtl"] .emadbrz-footer__links-list li {
    margin: 0 0 var(--footer-links-gap);
}

/* ========== Reduced motion ========== */
@media (prefers-reduced-motion: reduce) {
    .emadbrz-footer .emadbrz-footer__inner > * {
        transition-duration: 0.01ms;
    }
}

/* ========== Large desktop (xl) – optional tweaks ========== */
@media (min-width: 1200px) {
    .emadbrz-footer__inner {
        padding-inline: 0;
    }
}
