/* ========================================
   FOOTER STYLES - SIGNATURE THEME
   OPTIMIZED: Mobile-first, Design Tokens, 4 Breakpoints
   ======================================== */

/* Footer Container - Mobile-first */
.footer {
    position: relative;
    width: 100%;
    background: #FFE8DB;
    /* Fallback color */
    background: var(--color-background-light, #FFE8DB) !important;
    /* Light peach background */
    display: flex;
    justify-content: center;
    padding: var(--spacing-8) 0;
    /* 32px mobile */
}

/* Inner Container - Align with header */
.footer-inner {
    max-width: var(--container-max-width);
    /* 1440px */
    width: 100%;
    padding: 0 var(--spacing-4);
    /* 16px mobile */
    display: flex;
    flex-direction: column;
    /* Mobile: vertical stack */
    align-items: center;
    /* Mobile: center everything */
    gap: var(--spacing-4);
    /* 16px - reduced from 24px */
}

/* Decorative background - hidden */
.footer::after {
    content: '';
    position: absolute;
    width: 123.91%;
    height: 249.54%;
    left: -22.43%;
    top: -152.71%;
    background-size: cover;
    pointer-events: none;
    display: none;
}

/* Footer Brand Section - Mobile-first */
.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Mobile: center */
    text-align: center;
    /* Mobile: center text */
    gap: var(--spacing-2);
    /* 8px mobile - reduced from 12px */
    flex: 1;
    max-width: 100%;
}

/* Logo Row (vertical on mobile, horizontal on desktop) */
.footer-brand>a {
    display: flex;
    flex-direction: column;
    /* Mobile: vertical */
    align-items: center;
    gap: var(--spacing-2);
    /* 8px */
    text-decoration: none;
    transition: var(--transition-normal);
}

.footer-brand>a:hover {
    opacity: 0.8;
}

.footer-logo {
    max-width: 180px;
    /* Mobile size */
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
}

.footer-description {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-14);
    /* 14px mobile */
    line-height: var(--line-height-tight);
    /* 1.4 */
    color: var(--color-gray-700);
    max-width: 300px;
    /* Limit width on mobile */
}

/* Footer Navigation - Mobile-first */
.footer-navigation {
    display: flex;
    flex-direction: column;
    /* Mobile: vertical */
    align-items: center;
    /* Mobile: center items */
    gap: var(--spacing-3);
    /* 12px mobile */
    width: 100%;
    /* Mobile: full width */
    flex-shrink: 0;
}

.footer-nav-item {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-14);
    /* 14px mobile */
    color: var(--color-gray-700);
    text-decoration: none;
    padding: var(--spacing-1) 0;
    /* 4px 0 mobile */
    transition: var(--transition-normal);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.footer-nav-item.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.footer-nav-item:hover {
    color: var(--color-primary);
}

.footer-nav-item:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* Footer Divider - Horizontal line */
.footer-divider {
    width: 100%;
    max-width: 280px;
    /* Mobile: limited width */
    height: 1px !important;
    min-height: 1px !important;
    max-height: 1px !important;
    background: var(--color-gray-300);
    /* rgba(0, 0, 0, 0.12) */
    order: 2;
    flex-basis: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

/* Hide inner divider elements */
.footer-divider-inner,
.footer-divider img {
    display: none;
}

/* Footer Copyright - Mobile-first */
.footer-copyright {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-12);
    /* 12px mobile */
    line-height: var(--line-height-normal);
    /* 1.5 */
    color: var(--color-gray-500);
    text-align: center;
}

/* Mobile: Show mobile copyright below divider */
.footer-copyright-mobile {
    display: block;
    width: 100%;
}

.footer-copyright-desktop {
    display: none;
}

/* Footer Social - Hidden */
.footer-social,
.social-icon {
    display: none;
}

/* ========================================
   RESPONSIVE BREAKPOINTS - MOBILE-FIRST
   ======================================== */

/* Tablet: 768px+ */
@media (min-width: 768px) {
    .footer {
        padding: var(--spacing-10) 0;
        /* 40px tablet */
    }

    .footer-inner {
        padding: 0 var(--spacing-5);
        /* 20px tablet */
    }

    .footer-brand {
        gap: var(--spacing-3);
        /* 12px tablet - reduced from 16px */
    }

    .footer-logo {
        max-width: 160px;
        height: 36px;
    }

    .footer-description {
        font-size: var(--font-size-14);
        line-height: var(--line-height-relaxed);
        /* 1.6 */
        max-width: 320px;
    }

    .footer-navigation {
        gap: var(--spacing-4);
        /* 16px tablet */
    }

    .footer-nav-item {
        font-size: var(--font-size-14);
        padding: var(--spacing-2) 0;
        /* 8px 0 */
    }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    .footer {
        padding: var(--spacing-12) 0;
        /* 48px desktop */
    }

    .footer-inner {
        padding: 0 var(--spacing-6);
        /* 24px desktop */
        flex-direction: row;
        /* Desktop: horizontal layout */
        justify-content: space-between;
        align-items: flex-start;
        flex-wrap: wrap;
        row-gap: var(--spacing-4);
        /* 16px - reduced from 24px */
        column-gap: var(--spacing-8);
        /* 32px - reduced from 40px */
    }

    /* Desktop: Left-align brand */
    .footer-brand {
        align-items: flex-start;
        text-align: left;
        max-width: 500px;
        gap: var(--spacing-3);
        /* 12px - reduced from 16px */
    }

    .footer-brand>a {
        flex-direction: row;
        /* Desktop: horizontal logo */
        align-items: center;
    }

    .footer-logo {
        max-width: 124px;
        height: 48px;
    }

    .footer-description {
        text-align: left;
        max-width: 100%;
        font-size: var(--font-size-14);
        line-height: var(--line-height-relaxed);
    }

    /* Desktop: Horizontal navigation */
    .footer-navigation {
        flex-direction: row;
        /* Desktop: horizontal */
        align-items: center;
        gap: var(--spacing-6);
        /* 24px desktop */
        width: auto;
        /* Desktop: auto width */
    }

    .footer-nav-item {
        padding: var(--spacing-2) 0;
        /* 8px 0 */
    }

    /* Desktop: Full-width divider */
    .footer-divider {
        max-width: 100%;
        order: 2;
    }

    /* Desktop: Show desktop copyright, hide mobile */
    .footer-copyright-desktop {
        display: block;
        order: 3;
        width: 100%;
        text-align: left;
    }

    .footer-copyright-mobile {
        display: none !important;
    }
}

/* Wide: 1440px+ */
@media (min-width: 1440px) {
    .footer-inner {
        padding: 0 var(--spacing-8);
        /* 32px wide */
    }
}

/* ========================================
   ACCESSIBILITY & FOCUS STATES
   ======================================== */

.footer-nav-item:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.footer-brand>a:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    .footer-nav-item,
    .footer-brand>a {
        transition: none;
    }
}

/* ========================================
   DYNAMIC FOOTER SUPPORT (From Database)
   Support for "news" theme style footer and custom database footer
   ======================================== */

/* Generic footer from database - only apply when NOT using default .footer-inner */
footer.footer:not(:has(.footer-inner)):not(.footer-dark) {
    position: relative;
    width: 100%;
    padding: var(--spacing-8) var(--spacing-4);
    /* 32px 16px mobile */
    box-sizing: border-box;
}

/* Footer container - center and constrain width */
footer.footer:not(:has(.footer-inner)):not(.footer-dark)>div:first-child,
footer.footer:not(:has(.footer-inner)):not(.footer-dark)>section:first-child {
    max-width: var(--container-max-width, 1440px);
    margin: 0 auto;
    width: 100%;
}

/* Logo in dynamic footer */
footer.footer:not(:has(.footer-inner)):not(.footer-dark) img[alt*="Telecom"],
footer.footer:not(:has(.footer-inner)):not(.footer-dark) img[alt*="Logo"],
footer.footer:not(:has(.footer-inner)):not(.footer-dark) img[src*="logo"] {
    max-width: 180px;
    height: auto;
    margin-bottom: 8px;
}

/* Company name/title */
footer.footer:not(:has(.footer-inner)):not(.footer-dark)>div:first-child>*:first-child:not(img) {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--color-text-dark, #333);
}

/* Company info section */
footer.footer:not(:has(.footer-inner)):not(.footer-dark) p {
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 14px;
    color: var(--color-gray-700, #555);
}

/* Icons in footer (location, email, phone) */
footer.footer:not(:has(.footer-inner)):not(.footer-dark) p img {
    vertical-align: middle;
    margin-right: 8px;
    width: 18px;
    height: 18px;
}

/* Government badge */
footer.footer:not(:has(.footer-inner)):not(.footer-dark) img[alt*="thông báo"],
footer.footer:not(:has(.footer-inner)):not(.footer-dark) img[alt*="THÔNG BÁO"],
footer.footer:not(:has(.footer-inner)):not(.footer-dark) img[alt*="Bộ Công Thương"] {
    display: block;
    max-width: 150px;
    height: auto;
    margin: 20px 0;
}

/* Footer navigation headings (bold text like "Về FPT Telecom") */
footer.footer:not(:has(.footer-inner)):not(.footer-dark) strong,
footer.footer:not(:has(.footer-inner)):not(.footer-dark) b {
    display: block;
    font-weight: 700;
    font-size: 16px;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--color-text-dark, #333);
}

/* First heading closer to top */
footer.footer:not(:has(.footer-inner)):not(.footer-dark) strong:first-of-type,
footer.footer:not(:has(.footer-inner)):not(.footer-dark) b:first-of-type {
    margin-top: 20px;
}

/* Footer links in dynamic footer */
footer.footer:not(:has(.footer-inner)):not(.footer-dark) a {
    display: block;
    color: var(--color-gray-700, #555);
    text-decoration: none;
    padding: 6px 0;
    font-size: 14px;
    transition: color 0.3s ease;
}

footer.footer:not(:has(.footer-inner)):not(.footer-dark) a:hover {
    color: var(--color-primary, #002391);
}

/* Responsive padding for dynamic footer */
@media (min-width: 768px) {
    footer.footer:not(:has(.footer-inner)):not(.footer-dark) {
        padding: var(--spacing-8) var(--spacing-5);
        /* 40px 20px tablet */
    }
}

@media (min-width: 1024px) {
    footer.footer:not(:has(.footer-inner)):not(.footer-dark) {
        padding: var(--spacing-12) var(--spacing-6);
        /* 48px 24px desktop */
    }

    /* Multi-column layout on desktop */
    footer.footer:not(:has(.footer-inner)):not(.footer-dark)>div:first-child {
        display: grid;
        gap: 40px;
        align-items: start;
    }
}

@media (min-width: 1440px) {
    footer.footer:not(:has(.footer-inner)):not(.footer-dark) {
        padding: var(--spacing-12) var(--spacing-6);
        /* 48px 32px wide */
    }
}

/* News Theme Footer Styles - Dark variant */
footer.footer.footer-dark {
    background: #000000;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0;
    margin: 0;
    position: relative;
}

footer.footer-dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1;
}

footer.footer-dark>* {
    position: relative;
    z-index: 2;
}

footer.footer-dark .rowfull-margin {
    padding: 40px 50px 40px;
    display: block;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Desktop Footer Links */
.link-footer-desktop {
    display: block;
}

/* Logo Section */
footer.footer-dark .row-fptlogo {
    padding: 0 0 12px 0;
    margin-bottom: 0;
    border-bottom: none;
}

footer.footer-dark .row-fptlogo img {
    height: 45px;
    width: auto;
    margin-bottom: 8px;
}

/* Footer Content Row */
footer.footer-dark .row-link-foot {
    border-bottom: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* Left Column - Company Info */
footer.footer-dark .row-link-foot .col-left {
    width: 50%;
    padding-right: 60px;
    flex: 0 0 50%;
}

footer.footer-dark .row-link-foot .col-left p {
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 400;
    line-height: 24px;
    color: #E0E0E0;
    display: flex;
    align-items: flex-start;
}

footer.footer-dark .row-link-foot .col-left p img {
    margin-right: 12px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

footer.footer-dark .row-link-foot .col-left p a {
    color: #5B9EFF;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

footer.footer-dark .row-link-foot .col-left p a:hover {
    color: #82B5FF;
    border-bottom: 1px solid #5B9EFF;
}

/* Right Column - Navigation Links */
footer.footer-dark .row-link-foot .col-right {
    width: 50%;
    flex: 0 0 50%;
    display: flex;
    padding-left: 40px;
}

footer.footer-dark .row-link-foot .col-right>div {
    width: 50%;
    padding-left: 0;
}

/* Footer Titles */
.foot-title {
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 16px;
    line-height: 24px;
}

/* Footer Links */
.link-footer {
    list-style: none;
    padding: 0;
    margin: 0;
}

.link-footer li {
    margin-bottom: 10px;
}

.link-footer li h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 400;
    line-height: 24px;
}

.link-footer a {
    font-size: 15px;
    line-height: 24px;
    color: #E0E0E0;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    display: inline-block;
}

.link-footer a:hover {
    color: #FFFFFF;
}

/* Government Badge */
.online-gov-vn {
    margin-top: 20px;
}

.online-gov-vn img {
    max-width: 150px;
    height: auto;
}

/* Mobile Footer */
.link-footer-mobile {
    display: none;
    padding: 30px 15px;
}

.link-footer-mobile>div:first-child {
    padding: 0 0 20px 0;
    border-bottom: 1px solid #333333;
    margin-bottom: 20px;
}

.link-footer-mobile img {
    height: 40px;
    width: auto;
}

/* Mobile License Text */
.license-text-mobile {
    margin-top: 0;
    padding: 0 0 20px 0;
    border-bottom: 1px solid #333333;
    margin-bottom: 20px;
}

.license-text-mobile p {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 22px;
    color: #E0E0E0;
}

.license-text-mobile p img {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.license-text-mobile p a {
    color: #5B9EFF;
    text-decoration: none;
    transition: all 0.3s ease;
}

.license-text-mobile p a:hover {
    color: #82B5FF;
    text-decoration: underline;
}

/* Mobile Accordion */
.accor-link-foot {
    padding-top: 0;
}

.accor-link-foot .tab {
    border-bottom: 1px solid #333333;
    padding: 16px 0;
}

.accor-link-foot .tab input {
    position: absolute;
    opacity: 0;
    z-index: -1;
}

.accor-link-foot .tab__label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    color: #000000;
    cursor: pointer;
    position: relative;
    padding-right: 30px;
}

.accor-link-foot .tab__label::after {
    content: "▼";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.accor-link-foot .tab input:checked+.tab__label::after {
    transform: translateY(-50%) rotate(180deg);
}

.accor-link-foot .tab__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.accor-link-foot .tab input:checked~.tab__content {
    max-height: 800px;
    padding-top: 16px;
}

.accor-link-foot .tab__content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.accor-link-foot .tab__content li {
    margin-bottom: 10px;
}

.accor-link-foot .tab__content a {
    font-size: 14px;
    line-height: 22px;
    color: #E0E0E0;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.accor-link-foot .tab__content a:hover {
    color: #FFFFFF;
    border-bottom: 1px solid #5B9EFF;
}

/* Bootstrap Grid Support */
.row {
    margin-left: -15px;
    margin-right: -15px;
    display: flex;
    flex-wrap: wrap;
}

.row::after {
    content: "";
    display: table;
    clear: both;
}

.col-sm-5,
.col-sm-6,
.col-sm-7 {
    position: relative;
    min-height: 1px;
    padding-left: 15px;
    padding-right: 15px;
}

@media (min-width: 768px) {
    .col-sm-5 {
        width: 41.66666667%;
        float: left;
    }

    .col-sm-6 {
        width: 50%;
        float: left;
    }

    .col-sm-7 {
        width: 58.33333333%;
        float: left;
    }
}

/* Responsive for Dynamic Footer */
@media screen and (max-width: 1199px) {
    footer.footer-dark .rowfull-margin {
        padding: 35px 30px;
    }

    footer.footer-dark .row-link-foot .col-left {
        width: 45%;
        flex: 0 0 45%;
        padding-right: 30px;
    }

    footer.footer-dark .row-link-foot .col-right {
        width: 55%;
        flex: 0 0 55%;
        padding-left: 20px;
    }

    footer.footer-dark .row-link-foot .col-left p,
    .link-footer a,
    .link-footer li h4 {
        font-size: 14px;
        line-height: 22px;
    }

    .foot-title {
        font-size: 16px;
    }
}

@media screen and (max-width: 767px) {
    footer.footer-dark .rowfull-margin {
        padding: 0;
    }

    .link-footer-desktop {
        display: none;
    }

    .link-footer-mobile {
        display: block;
    }

    footer.footer-dark .row-link-foot {
        flex-direction: column;
    }

    footer.footer-dark .row-link-foot .col-left,
    footer.footer-dark .row-link-foot .col-right {
        width: 100%;
        flex: 0 0 100%;
        padding: 0;
    }
}
