/* Fonts & Variables */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --jd-primary: #2563eb;
    --jd-primary-hover: #1d4ed8;
    --jd-dark-navy: #0f172a;
    --jd-footer-bg: #0b1120;
    --jd-text-light: #f8fafc;
    --jd-text-muted: #94a3b8;
    --jd-border-dark: rgba(255, 255, 255, 0.1);
    --jd-font: 'Plus Jakarta Sans', sans-serif;
}

/* Base Footer Styling */
.jd-footer {
    font-family: var(--jd-font);
    background-color: var(--jd-footer-bg);
    color: var(--jd-text-light);
    margin-top: 60px;
    width: 100%;
}

/* Desktop Container Padding */
.jd-container {
    width: 100%; max-width: 1280px; margin: 0 auto; 
    padding: 0 2rem; box-sizing: border-box;
}

/* ======== TOP NEWSLETTER SECTION ======== */
.jd-footer-newsletter {
    background-color: var(--jd-primary);
    padding: 50px 0;
}

.jd-newsletter-inner {
    display: flex; justify-content: space-between; align-items: center; gap: 30px;
}

.jd-newsletter-text h3 { margin: 0 0 8px 0; font-size: clamp(1.25rem, 2.5vw, 1.75rem); font-weight: 700; color: #fff; letter-spacing: -0.5px; }
.jd-newsletter-text p { margin: 0; color: #e0e7ff; font-size: 1rem; }

.jd-newsletter-form {
    display: flex; gap: 10px; width: 100%; max-width: 500px;
}

.jd-newsletter-form input {
    flex: 1; padding: 14px 20px; border-radius: 8px; border: none;
    font-family: var(--jd-font); font-size: 1rem; outline: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.jd-newsletter-form button {
    background-color: var(--jd-dark-navy); color: #fff; border: none;
    padding: 14px 28px; border-radius: 8px; font-weight: 600; cursor: pointer;
    font-family: var(--jd-font); font-size: 1rem; transition: 0.3s;
    white-space: nowrap; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.jd-newsletter-form button:hover { background-color: #1e293b; transform: translateY(-2px); }

/* ======== MAIN FOOTER GRID ======== */
.jd-footer-main { padding: 70px 0 50px 0; }

.jd-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 50px;
}

/* Column 1: Brand */
.jd-brand-col { max-width: 320px; }
.jd-footer-logo {
    font-size: 2rem; font-weight: 800; color: #fff; text-decoration: none; 
    display: block; margin-bottom: 20px; letter-spacing: -0.5px;
}
.jd-footer-logo span { color: var(--jd-primary); }

.jd-footer-desc { color: var(--jd-text-muted); font-size: 0.95rem; line-height: 1.7; margin-bottom: 25px; }

/* Social Icons */
.jd-social-links { display: flex; flex-wrap: wrap; gap: 12px; }
.jd-social-links a {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; background-color: rgba(255,255,255,0.06);
    border-radius: 50%; color: var(--jd-text-light); transition: all 0.3s ease;
    border: 1px solid transparent;
}
.jd-social-links a svg { width: 20px; height: 20px; }
.jd-social-links a:hover { 
    background-color: var(--jd-primary); 
    border-color: var(--jd-primary);
    transform: translateY(-4px); 
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

/* Link Columns */
.jd-footer-col h4 {
    color: #fff; font-size: 1.15rem; font-weight: 600; margin: 0 0 25px 0;
    position: relative; padding-bottom: 12px; letter-spacing: -0.3px;
}
.jd-footer-col h4::after {
    content: ''; position: absolute; left: 0; bottom: 0;
    width: 45px; height: 3px; background-color: var(--jd-primary); border-radius: 3px;
}

.jd-footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.jd-footer-col ul li a {
    color: var(--jd-text-muted); text-decoration: none; font-size: 0.95rem;
    transition: all 0.3s ease; display: inline-flex; align-items: center;
}
.jd-footer-col ul li a:hover { color: var(--jd-primary); transform: translateX(6px); }

/* ======== BOTTOM COPYRIGHT BAR ======== */
.jd-footer-bottom {
    border-top: 1px solid var(--jd-border-dark); padding: 25px 0; background-color: #080d1a;
}
.jd-bottom-flex { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.jd-bottom-flex p { margin: 0; color: var(--jd-text-muted); font-size: 0.95rem; }

/* ======== SCROLL TO TOP BUTTON (HIDDEN FOR ASTRA THEME COMPATIBILITY) ======== */
.jd-back-to-top {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}


/* ======================================================
   MOBILE UX POLISH (100% CENTERED LAYOUT)
====================================================== */
@media (max-width: 768px) {
    /* 1. Safe Area Padding */
    .jd-container { padding: 0 24px !important; }

    /* 2. Newsletter Mobile Adjustments */
    .jd-footer-newsletter { padding: 45px 0; }
    .jd-newsletter-inner { flex-direction: column; text-align: center; gap: 20px; }
    .jd-newsletter-text h3 { font-size: 1.4rem; }
    .jd-newsletter-text p { font-size: 0.95rem; }
    
    .jd-newsletter-form { flex-direction: column; max-width: 100%; gap: 12px; }
    .jd-newsletter-form input { text-align: center; padding: 15px; }
    .jd-newsletter-form button { width: 100%; padding: 15px; }

    /* 3. Grid Spacing */
    .jd-footer-main { padding: 50px 0 30px 0; }
    .jd-footer-grid { gap: 40px; }
    
    /* ======== 4. FORCE EVERYTHING TO CENTER ======== */
    .jd-brand-col { margin: 0 auto; text-align: center; } 
    .jd-footer-col { text-align: center; } 
    
    /* Centers the blue underline below headings */
    .jd-footer-col h4::after { 
        left: 50%; 
        transform: translateX(-50%); 
    }
    
    /* Centers the Links and Social Icons */
    .jd-footer-col ul { align-items: center; }
    .jd-social-links { justify-content: center; margin-top: 10px; }

    .jd-footer-col h4 { margin: 0 0 20px 0; }
    .jd-footer-desc { margin-bottom: 20px; }

    /* 5. Bottom Copyright Overlap Fix (Provides space for Astra's button) */
    .jd-footer-bottom { 
        padding: 25px 0 90px 0 !important; 
    }
    
    .jd-bottom-flex { flex-direction: column; text-align: center; justify-content: center; gap: 10px; }
    .jd-bottom-flex p { font-size: 0.9rem; text-align: center; width: 100%; }
}