/* ============================================
   FOOTER - DIVINE BLUE SKY THEME (FINAL FIX)
   ============================================ */

/* Main Footer Container */
.footer {
    position: relative;
    padding: 80px 0 40px;
    color: #fff;
    overflow: hidden;
    border-top: 5px solid rgba(255, 255, 255, 0.15);
    /* NỀN CHÍNH: Gradient bầu trời xanh (luôn phủ đầy) */
    background: linear-gradient(180deg,
            #3b82f6 0%,
            #1e3a8a 40%,
            #0f172a 100%) !important;
}

/* Overlay nhẹ */
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(59, 130, 246, 0.2) 0%,
            rgba(15, 23, 42, 0.4) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Container chứa hiệu ứng */
.footer-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

/* ẢNH THÁNH GIÁ - KÍCH THƯỚC HỢP LÝ, CĂN GIỮA */
.footer-real-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Kích thước hợp lý - không quá to */
    width: 500px;
    height: 100%;
    /* Ảnh thánh giá */
    background: url('../images/cross-unsplash-3.jpg') no-repeat center center;
    background-size: contain;
    /* Hoà trộn viền vào nền trời */
    mask-image: radial-gradient(ellipse 60% 80% at center,
            black 30%,
            rgba(0, 0, 0, 0.6) 50%,
            transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 60% 80% at center,
            black 30%,
            rgba(0, 0, 0, 0.6) 50%,
            transparent 80%);
    z-index: 1;
    opacity: 0.85;
}

/* HIỆU ỨNG GLOW */
.footer-glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 200, 0.3) 0%, transparent 70%);
    mix-blend-mode: screen;
    border-radius: 50%;
    animation: pulseGlow 5s ease-in-out infinite;
    z-index: 0;
}

/* TIA SÁNG XOAY */
.footer-rays-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: repeating-conic-gradient(from 0deg,
            rgba(255, 255, 255, 0.06) 0deg 5deg,
            transparent 5deg 15deg);
    mask-image: radial-gradient(circle, black 20%, transparent 60%);
    -webkit-mask-image: radial-gradient(circle, black 20%, transparent 60%);
    animation: rotateRays 120s linear infinite;
    z-index: 0;
    opacity: 0.5;
}

@keyframes pulseGlow {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes rotateRays {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* MÂY BAY */
.footer-cloud-layer-1,
.footer-cloud-layer-2,
.footer-cloud-layer-3 {
    position: absolute;
    left: 0;
    width: 200%;
    z-index: 2;
    pointer-events: none;
}

.footer-cloud-layer-1 {
    top: 10%;
    height: 200px;
    animation: cloudDrift1 50s linear infinite;
    opacity: 0.4;
}

.footer-cloud-layer-2 {
    top: 30%;
    height: 150px;
    left: -50%;
    animation: cloudDrift2 70s linear infinite;
    opacity: 0.3;
}

.footer-cloud-layer-3 {
    top: 50%;
    height: 100px;
    animation: cloudDrift3 40s linear infinite;
    opacity: 0.2;
}

@keyframes cloudDrift1 {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@keyframes cloudDrift2 {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(50%);
    }
}

@keyframes cloudDrift3 {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* Mây tĩnh dưới đáy */
.footer-clouds-1 {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 300px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff' fill-opacity='0.1' d='M0,224L48,213.3C96,203,192,181,288,181.3C384,181,480,203,576,224C672,245,768,267,864,261.3C960,256,1056,224,1152,197.3C1248,171,1344,149,1392,138.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,576,320,480,320C384,320,288,320,192,320C96,320,48,320,0,320Z'%3E%3C/path%3E%3C/svg%3E") bottom/cover;
    z-index: 2;
}

/* ===== NỘI DUNG FOOTER - Z-INDEX CAO NHẤT ===== */
.footer .container {
    position: relative;
    z-index: 10;
}

/* Text Styles */
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 50px;
    padding-bottom: 50px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.footer-logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.footer-logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.footer-desc {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.85);
}

.footer h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.footer h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background: rgba(255, 223, 100, 0.8);
    border-radius: 3px;
}

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

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

.footer ul a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer ul a:hover {
    color: #fff;
    padding-left: 5px;
}

.footer ul a i {
    font-size: 12px;
    color: #93c5fd;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social a {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    transition: all 0.3s;
}

.footer-social a:hover {
    background: #fff;
    color: #3b82f6;
    transform: translateY(-3px);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.contact-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.contact-text {
    font-size: 14px;
    line-height: 1.6;
}

.contact-text a {
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.3s;
}

.contact-text a:hover {
    color: #fff;
}

.footer-bottom {
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    position: relative;
    z-index: 10;
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.7);
}

.footer-copyright a {
    color: #fff;
    font-weight: 600;
}

.footer-links-bottom {
    display: flex;
    gap: 24px;
}

.footer-links-bottom a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    transition: color 0.3s;
}

.footer-links-bottom a:hover {
    color: #fff;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #0084ff, #0066cc);
    color: #fff;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 9999;
    box-shadow: 0 8px 25px rgba(0, 132, 255, 0.35);
}

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

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 132, 255, 0.45);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 90px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    .footer-glow-effect,
    .footer-rays-effect,
    .footer-cloud-layer-1,
    .footer-cloud-layer-2,
    .footer-cloud-layer-3 {
        animation: none !important;
    }
}