/* ===================================
   Footer & Mobile Navigation Styles
   =================================== */

/* Footer */
footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: 60px 0 20px;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    footer {
        padding: 40px 0 90px;
        margin-bottom: 0;
    }
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 64px;
    max-width: 1400px;
    margin: 0 auto 40px;
    padding: 0 40px;
}

/* Footer About - company name on single line */
.footer-about h3 {
    white-space: nowrap;
}

@media (max-width: 968px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 600px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
        padding: 0 20px;
    }

    .footer-content > div {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .footer-content ul {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-content p,
    .footer-content h3,
    .footer-content h4 {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 480px) {
    .footer-content {
        padding: 0 15px !important;
    }

    .footer-content > div {
        align-items: center !important;
        justify-content: center !important;
    }

    .footer-content ul li a {
        justify-content: center !important;
        text-align: center !important;
    }
}

.footer-content h3,
.footer-content h4 {
    color: var(--white);
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

@media (max-width: 600px) {
    .footer-content h3,
    .footer-content h4 {
        margin-bottom: 15px;
        font-size: 1rem;
        white-space: normal;
    }
}

.footer-content p {
    line-height: 1.7;
    margin-bottom: 15px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.footer-content ul {
    list-style: none;
    padding: 0;
}

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

.footer-content ul li a {
    color: var(--gray-300);
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Circle bullet before links (Quick Links & Services) */
.footer-links ul:not(.social-links) li a::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--gray-500);
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

@media (max-width: 600px) {
    .footer-content ul li a {
        justify-content: center;
    }
}

.footer-content ul li a:hover {
    color: #f97316;
}

/* Change bullet color on hover */
.footer-links ul:not(.social-links) li a:hover::before {
    background-color: #f97316;
}

/* Services list - display inline on single line */
.footer-links:nth-child(3) ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 15px;
}

.footer-links:nth-child(3) ul li {
    margin-bottom: 0;
    white-space: nowrap;
}

.footer-links:nth-child(3) ul li a {
    display: inline-flex;
}

@media (max-width: 968px) {
    .footer-links:nth-child(3) ul {
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .footer-links:nth-child(3) ul {
        justify-content: center;
        flex-direction: row;
    }
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 40px 0;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-bottom p {
    margin: 0;
    color: var(--gray-500);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .footer-bottom {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .footer-bottom {
        padding: 0 15px;
    }
}

/* Social Links */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.social-links li {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 0;
}

.social-icon {
    width: 32px;
    height: 32px;
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1);
}

@media (max-width: 600px) {
    .social-links {
        flex-direction: row !important;
        justify-content: center;
        align-items: center;
    }

    .social-links li {
        margin-right: 0;
    }
}

/* Social Icons Contact */
.social-icons-contact {
    text-align: center;
    margin-top: 20px;
}

.social-icons-contact a {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 1px;
    margin: 0 5px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.social-icons-contact a:hover {
    transform: scale(1.1);
}

.social-icons-contact img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    transition: opacity 0.4s ease;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 85%;
    max-height: 85vh;
    animation: zoom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoom {
    from {transform:scale(0.8)}
    to {transform:scale(1)}
}

.lightbox-close {
    position: absolute;
    top: 35px;
    right: 55px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    line-height: 1;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
    z-index: 999;
    font-size: 20px;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(72, 219, 251, 0.5);
}

.back-to-top:active {
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* ========================================
   MOBILE BOTTOM NAVIGATION BAR
   ======================================== */
.mobile-bottom-nav {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: white !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15) !important;
    z-index: 99999 !important;
    display: none;
    justify-content: space-around !important;
    align-items: center !important;
    height: 70px !important;
    padding: 0 3px !important;
    padding-bottom: env(safe-area-inset-bottom, 10px) !important;
    border-top: 2px solid rgba(0, 0, 0, 0.1) !important;
}

/* Show only on mobile devices (max-width: 968px) */
@media (max-width: 968px) {
    .mobile-bottom-nav {
        display: flex !important;
    }

    /* Add padding to body to prevent content from hiding behind bottom nav */
    body {
        padding-bottom: 70px;
    }

    /* Adjust back-to-top button position on mobile */
    .back-to-top {
        bottom: 90px;
    }

    .back-to-top.show {
        bottom: 90px;
    }
}

/* Individual bottom nav items */
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 4px;
    text-decoration: none;
    color: var(--gray-600);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    gap: 4px;
}

/* Active state indicator - top border */
.bottom-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 0 0 3px 3px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active state background */
.bottom-nav-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.05), rgba(249, 115, 22, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

/* Hover effect */
.bottom-nav-item:hover {
    color: var(--primary);
    background: rgba(30, 64, 175, 0.05);
}

.bottom-nav-item:hover .bottom-nav-icon {
    transform: scale(1.1);
}

/* Active state styling */
.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active::before {
    width: 80%;
}

.bottom-nav-item.active::after {
    opacity: 1;
}

.bottom-nav-item.active .bottom-nav-icon {
    transform: scale(1.15);
    color: var(--primary);
}

.bottom-nav-item.active .bottom-nav-label {
    font-weight: 700;
    color: var(--primary);
}

/* Bottom nav icon */
.bottom-nav-icon {
    font-size: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    line-height: 1;
}

/* Bottom nav label */
.bottom-nav-label {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

body.th .bottom-nav-label {
    font-size: 9px;
}

/* Focus visible state for accessibility */
.bottom-nav-item:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: -3px;
    border-radius: 8px;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        height: 65px;
    }

    body {
        padding-bottom: 65px;
    }

    .back-to-top {
        bottom: 85px;
    }

    .back-to-top.show {
        bottom: 85px;
    }

    .bottom-nav-icon {
        font-size: 19px;
    }

    .bottom-nav-label {
        font-size: 10.5px;
    }

    body.th .bottom-nav-label {
        font-size: 9.5px;
    }
}

@media (max-width: 480px) {
    .mobile-bottom-nav {
        height: 60px;
    }

    body {
        padding-bottom: 60px;
    }

    .back-to-top {
        bottom: 80px;
    }

    .back-to-top.show {
        bottom: 80px;
    }

    .bottom-nav-item {
        padding: 6px 1px;
        gap: 2px;
    }

    .bottom-nav-icon {
        font-size: 17px;
    }

    .bottom-nav-label {
        font-size: 10px;
    }

    body.th .bottom-nav-label {
        font-size: 9px;
    }
}

/* Extra small screens - even more compact */
@media (max-width: 375px) {
    .bottom-nav-icon {
        font-size: 16px;
    }

    .bottom-nav-label {
        font-size: 10px;
    }
}

/* Hide bottom nav on desktop */
@media (min-width: 969px) {
    .mobile-bottom-nav {
        display: none !important;
    }

    body {
        padding-bottom: 0 !important;
    }
}

/* Animation when bottom nav appears */
@media (max-width: 968px) {
    .mobile-bottom-nav {
        animation: slideUpNav 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

@keyframes slideUpNav {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile Bottom Nav Auto-hide on Scroll */
@media (max-width: 968px) {
    .mobile-bottom-nav {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    }

    .mobile-bottom-nav.nav-hidden {
        transform: translateY(100%) !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .mobile-bottom-nav.nav-visible {
        transform: translateY(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

