/* Public footer — منصة مشاركة / shared.sa */

.fb-footer {
    --fb-foot-bg: #071428;
    --fb-foot-panel: rgba(255, 255, 255, 0.035);
    --fb-foot-text: #f2f6fc;
    --fb-foot-muted: #e8f0fc;
    --fb-foot-heading: #ffffff;
    --fb-foot-link: #e8f0fc;
    --fb-foot-link-hover: #ffffff;
    --fb-foot-legal: #d6e2f5;
    --fb-foot-line: rgba(125, 162, 218, 0.28);
    --fb-foot-accent: var(--primaryColor, #0045ad);
    --fb-foot-deep: var(--secondaryColor, #002369);
    position: relative;
    margin-top: auto;
    overflow: hidden;
    color: var(--fb-foot-text);
    background:
        radial-gradient(ellipse 70% 55% at 100% 0%, rgba(0, 69, 173, 0.28) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 0% 100%, rgba(0, 35, 105, 0.45) 0%, transparent 50%),
        linear-gradient(165deg, #0a1a33 0%, var(--fb-foot-bg) 48%, #050d1a 100%);
    border-top: 0;
    padding: 0 0 0.55rem;
}

.fb-footer-accent {
    height: 3px;
    background: linear-gradient(90deg, var(--fb-foot-deep), var(--fb-foot-accent), #3d7dff, var(--fb-foot-accent));
    background-size: 200% 100%;
    animation: fbFooterAccent 14s ease-in-out infinite;
}

.fb-footer-inner {
    position: relative;
    z-index: 1;
    padding-top: clamp(0.95rem, 2vw, 1.35rem);
}

.fb-footer-main {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: clamp(0.85rem, 1.8vw, 1.25rem) clamp(0.9rem, 1.8vw, 1.5rem);
    padding-bottom: clamp(0.75rem, 1.6vw, 1.05rem);
    border-bottom: 1px solid var(--fb-foot-line);
}

.fb-footer-brand {
    position: relative;
    max-width: 20rem;
    padding: 0.55rem 0.75rem 0.6rem;
    border: 1px solid var(--fb-foot-line);
    border-radius: 0.75rem;
    background: var(--fb-foot-panel);
}

.fb-footer-frame {
    position: absolute;
    width: 0.7rem;
    height: 0.7rem;
    border: 2px solid rgba(61, 125, 255, 0.75);
    pointer-events: none;
}

.fb-footer-frame--tl {
    top: 0.4rem;
    inset-inline-start: 0.4rem;
    border-inline-end: 0;
    border-bottom: 0;
}

.fb-footer-frame--br {
    bottom: 0.4rem;
    inset-inline-end: 0.4rem;
    border-inline-start: 0;
    border-top: 0;
}

.fb-footer-logo {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.35rem;
    padding: 0.4rem 0.55rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(125, 162, 218, 0.18);
    transition: transform 0.35s ease, opacity 0.25s ease, background 0.25s ease;
}

.fb-footer-logo:hover {
    transform: translateY(-2px);
    opacity: 0.95;
    background: rgba(255, 255, 255, 0.07);
}

.fb-footer-logo-img {
    display: block;
    height: 48px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
}

.fb-footer-name {
    margin: 0 0 0.15rem;
    color: #fff;
    font-size: clamp(0.98rem, 1.7vw, 1.15rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.fb-footer-tagline {
    margin: 0;
    color: #e8f0fc !important;
    font-size: 0.8rem;
    line-height: 1.4;
    max-width: 28ch;
    opacity: 1;
}

.fb-footer-mail {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.4rem;
    color: #e8f0fc !important;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.25s ease, transform 0.25s ease;
}

.fb-footer-mail i {
    color: #9ec1ff;
}

.fb-footer-mail:hover {
    color: #ffffff !important;
    transform: translateX(var(--fb-foot-nudge, 3px));
}

[dir="rtl"] .fb-footer-mail:hover {
    --fb-foot-nudge: -3px;
}

.fb-footer-col {
    min-width: 0;
}

.fb-footer-heading {
    position: relative;
    margin: 0 0 0.45rem;
    padding-bottom: 0.28rem;
    color: #ffffff !important;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 1;
}

.fb-footer-heading::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    bottom: 0;
    width: 1.5rem;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--fb-foot-accent), #3d7dff);
    transition: width 0.35s ease;
}

.fb-footer-col:hover .fb-footer-heading::after {
    width: 2.35rem;
}

.fb-footer-links,
.fb-footer .footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    margin: 0;
}

.fb-footer-link,
.fb-footer .footer-link {
    margin: 0;
}

/*
 * Beat global `a, a:hover { color: var(--primaryColor) }` (#0045AD on navy)
 * and late `[data-theme="dark"] a` from theme-rtl.css (loads after footer.css).
 */
.fb-footer .fb-footer-link a,
.fb-footer .footer-link a,
.fb-footer .fb-footer-links a,
.fb-footer .footer-links a,
html[data-theme="dark"] .fb-footer .fb-footer-link a,
html[data-theme="dark"] .fb-footer .footer-link a,
body[data-theme="dark"] .fb-footer .fb-footer-link a,
body[data-theme="dark"] .fb-footer .footer-link a {
    position: relative;
    display: inline-block;
    padding: 0.08rem 0;
    color: #e8f0fc !important;
    font-size: 0.84rem;
    font-weight: 500;
    text-decoration: none;
    opacity: 1;
    transition: color 0.25s ease, transform 0.25s ease;
}

.fb-footer .fb-footer-link a::after,
.fb-footer .footer-link a::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    bottom: 0.1rem;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.3s ease, background-color 0.25s ease;
}

[dir="rtl"] .fb-footer .fb-footer-link a::after,
[dir="rtl"] .fb-footer .footer-link a::after {
    transform-origin: left center;
}

.fb-footer .fb-footer-link a:hover,
.fb-footer .footer-link a:hover,
.fb-footer .fb-footer-links a:hover,
.fb-footer .footer-links a:hover,
.fb-footer .fb-footer-link a:focus-visible,
.fb-footer .footer-link a:focus-visible,
.fb-footer .fb-footer-links a:focus-visible,
.fb-footer .footer-links a:focus-visible,
html[data-theme="dark"] .fb-footer .fb-footer-link a:hover,
html[data-theme="dark"] .fb-footer .footer-link a:hover,
body[data-theme="dark"] .fb-footer .fb-footer-link a:hover,
body[data-theme="dark"] .fb-footer .footer-link a:hover {
    color: #ffffff !important;
    transform: translateX(var(--fb-foot-nudge, 4px));
}

.fb-footer .fb-footer-link a:hover::after,
.fb-footer .footer-link a:hover::after,
.fb-footer .fb-footer-links a:hover::after,
.fb-footer .footer-links a:hover::after,
.fb-footer .fb-footer-link a:focus-visible::after,
.fb-footer .footer-link a:focus-visible::after,
.fb-footer .fb-footer-links a:focus-visible::after,
.fb-footer .footer-links a:focus-visible::after {
    transform: scaleX(1);
    transform-origin: left center;
    background: var(--fb-foot-accent, #0045ad);
}

[dir="rtl"] .fb-footer .fb-footer-link a:hover,
[dir="rtl"] .fb-footer .footer-link a:hover,
[dir="rtl"] .fb-footer .fb-footer-link a:focus-visible,
[dir="rtl"] .fb-footer .footer-link a:focus-visible {
    --fb-foot-nudge: -4px;
}

[dir="rtl"] .fb-footer .fb-footer-link a:hover::after,
[dir="rtl"] .fb-footer .footer-link a:hover::after,
[dir="rtl"] .fb-footer .fb-footer-link a:focus-visible::after,
[dir="rtl"] .fb-footer .footer-link a:focus-visible::after {
    transform-origin: right center;
}

.fb-footer-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.85rem;
    padding-top: 0.5rem;
}

.fb-footer-copy {
    color: #d6e2f5 !important;
    font-size: 0.76rem;
    line-height: 1.35;
    opacity: 1;
}

.fb-footer-copy-sep {
    margin-inline: 0.2rem;
    opacity: 0.75;
    color: var(--fb-foot-muted);
}

.fb-footer .fb-footer-terms {
    color: #e8f0fc !important;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
    opacity: 1;
    transition: color 0.25s ease;
}

.fb-footer .fb-footer-terms:hover,
.fb-footer .fb-footer-terms:focus-visible {
    color: #ffffff !important;
}

/* Template homepage: keep tpl color hooks without fighting structure */
body.tpl-body .fb-footer {
    --fb-foot-accent: var(--tpl-primary, var(--primaryColor, #0045ad));
    --fb-foot-deep: var(--tpl-secondary, var(--secondaryColor, #002369));
}

/* Soften legacy .footer padding from application.css */
.footer.fb-footer {
    padding-top: 0;
    padding-bottom: 0.55rem;
}

.footer.fb-footer .text-muted,
.fb-footer .text-muted,
.fb-footer .text-muted a {
    color: #e8f0fc !important;
    opacity: 1 !important;
}

@keyframes fbFooterAccent {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@media (max-width: 767.98px) {
    .fb-footer-main {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .fb-footer-brand {
        max-width: none;
        padding: 0.5rem 0.7rem 0.55rem;
    }

    .fb-footer-logo-img {
        height: 36px;
        max-width: 200px;
    }

    .fb-footer-legal {
        flex-direction: column;
        align-items: flex-start;
        padding-top: 0.45rem;
        gap: 0.25rem;
    }

    .fb-footer-links,
    .fb-footer .footer-links {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fb-footer-accent,
    .fb-footer-logo,
    .fb-footer-mail,
    .fb-footer .fb-footer-link a,
    .fb-footer .footer-link a,
    .fb-footer-heading::after {
        animation: none !important;
        transition: none !important;
    }

    .fb-footer-logo:hover,
    .fb-footer-mail:hover,
    .fb-footer .fb-footer-link a:hover,
    .fb-footer .footer-link a:hover {
        transform: none;
    }
}
