/* Global Footer Styles */
.site-footer {
    background: #050505;
    color: #e0e0e0;
    padding: 80px 0 30px;
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Background Glow */
.site-footer::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 100%;
    background: radial-gradient(circle, rgba(123, 63, 242, 0.15), transparent 70%);
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    /* Matched to main container padding */
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 40px;
    position: relative;
    z-index: 1;
}

/* Column 1: Brand */
.footer-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.footer-brand .logo-img {
    height: 40px;
}

.footer-brand .logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    font-family: var(--font-heading, sans-serif);
    transition: all 0.3s ease;
    cursor: default;
}

.footer-brand:hover .logo-text {
    color: #7B3FF2;
    text-shadow: 0 0 15px rgba(123, 63, 242, 0.5);
}

.footer-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #a0a0a0;
    margin-bottom: 25px;
    max-width: 300px;
    transition: color 0.3s ease;
}

.footer-brand:hover .footer-desc {
    color: #d0d0d0;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.social-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-btn {
    position: relative;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    /* Base shape: rounded square */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    overflow: hidden;
    /* Clips the 'filled' element */
    z-index: 1;
}

/* The Rising Background Fill */
.social-btn .filled {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    /* Rising up from 0 */
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: -1;
    /* Behind the icon SVG */
}

/* Base Icon Color Shift */
.social-btn svg {
    position: relative;
    z-index: 2;
    transition: all 0.5s ease;
}

/* Tooltip Base */
.social-tooltip {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    color: #fff;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    white-space: nowrap;
    z-index: 20;
}

/* Global Hover State - Triggered from Item */
.social-item:hover .social-btn {
    transform: translateY(10px);
    border-radius: 50%;
    /* Shape Morph */
    border-color: transparent;
    color: #fff;
}

.social-item:hover .filled {
    height: 100%;
}

.social-item:hover .social-tooltip {
    opacity: 1;
    top: -45px;
    /* Popup bubble higher relative to item */
}

/* ---- Brand Specific Colors ---- */

/* Twitter */
.social-item:hover .btn-twitter .filled,
.social-item:hover .btn-twitter~.social-tooltip {
    background: #1da1f2;
}

.social-item:hover .btn-twitter {
    box-shadow: 0 10px 20px rgba(29, 161, 242, 0.3);
}

/* GitHub */
.social-item:hover .btn-github .filled,
.social-item:hover .btn-github~.social-tooltip {
    background: #24262a;
}

.social-item:hover .btn-github {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

/* LinkedIn */
.social-item:hover .btn-linkedin .filled,
.social-item:hover .btn-linkedin~.social-tooltip {
    background: #0274b3;
}

.social-item:hover .btn-linkedin {
    box-shadow: 0 10px 20px rgba(2, 116, 179, 0.3);
}

/* Instagram */
.social-item:hover .btn-instagram .filled,
.social-item:hover .btn-instagram~.social-tooltip {
    background: linear-gradient(45deg, #405de6, #5b51db, #b33ab4, #c135b4, #e1306c, #fd1f1f);
}

.social-item:hover .btn-instagram {
    box-shadow: 0 10px 20px rgba(220, 39, 67, 0.3);
}

/* WhatsApp */
.social-item:hover .btn-whatsapp .filled,
.social-item:hover .btn-whatsapp~.social-tooltip {
    background: #25D366;
}

.social-item:hover .btn-whatsapp {
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3);
}

/* Light Mode Support */
[data-theme="light"] .social-btn {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

[data-theme="light"] .social-item:hover .social-btn {
    color: #fff;
}

/* Light Mode Support */
[data-theme="light"] .social-btn {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

[data-theme="light"] .social-btn:hover {
    color: #fff;
}

/* Columns 2 & 3: Links */
.footer-heading {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 25px;
    font-weight: 700;
    transition: all 0.3s ease;
    width: fit-content;
}

.footer-group:hover .footer-heading {
    color: #7B3FF2;
    transform: translateX(5px);
}

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

.footer-links li {
    margin-bottom: 15px;
}

.footer-links a {
    color: #a0a0a0;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: inline-block;
}

.footer-links a:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(123, 63, 242, 0.8);
    transform: translateX(8px);
}

/* Column 4: Newsletter (3D Ribbon Component) */

.subscribe-card-3d {
    position: relative;
    padding: 25px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    color: #fff;
    box-shadow: 0px 10px 40px -10px rgba(0, 0, 0, 0.5);
    max-width: 320px;
    margin-left: auto;
    /* Push to right on desktop, center handled by grid */
}

.subscribe-card-3d h4 {
    text-align: left;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 1px;
    color: #fff;
}

.subscribe-card-3d p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 25px;
}

/* Ribbond Fold Effect Base */
.subscribe-card-3d::after {
    position: absolute;
    content: "";
    right: -10px;
    bottom: 18px;
    width: 0;
    height: 0;
    border-left: 0px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #2D0044;
    /* Darker Deep Purple for Shadow */
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: -1;
}

/* Sync Fold with Button Hover */
.subscribe-card-3d:hover::after {
    transform: translateY(-4px);
}

/* Input Field */
.subscribe-input-3d {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 0;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.subscribe-input-3d:focus {
    border-bottom-color: #7B3FF2;
    padding-left: 5px;
    /* Slight movement */
}

.subscribe-input-3d::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Sync Button & Fold on Card Hover */
.subscribe-card-3d:hover .submit-btn-3d {
    transform: translateY(-4px) scale(1.05);
    box-shadow:
        -8px 15px 30px rgba(0, 0, 0, 0.5),
        inset 0 3px 3px rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, #5E0091 0%, #5E0091 70%, #FFA500 100%);
}

.subscribe-card-3d:hover::after {
    transform: translateY(-4px);
}

/* 3D Ribbon Button */
.submit-btn-3d {
    position: absolute;
    right: -10px;
    bottom: -20px;
    /* Deep Purple Dominant Gradient */
    background: linear-gradient(135deg, #4A0072 0%, #4A0072 75%, #FF8C00 100%);
    color: #fff;
    padding: 12px 25px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 30px;
    border-top-right-radius: 0;
    /* Flat corner for fold */
    border-bottom-right-radius: 0;

    /* Enhanced 3D Shadows: Outer Glow + Inner Highlight */
    box-shadow:
        -5px 10px 20px rgba(0, 0, 0, 0.4),
        inset 0 2px 2px rgba(255, 255, 255, 0.3),
        inset 0 -2px 2px rgba(0, 0, 0, 0.3);

    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
}

/* Light Mode Overrides for 3D Card */
[data-theme="light"] .subscribe-card-3d {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0px 10px 30px -5px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .subscribe-card-3d h4 {
    color: #111;
}

[data-theme="light"] .subscribe-card-3d p {
    color: #666;
}

[data-theme="light"] .subscribe-input-3d {
    color: #111;
    border-bottom-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .subscribe-input-3d::placeholder {
    color: #aaa;
}

/* Bottom Bar */
.footer-bottom {
    max-width: 1200px;
    margin: 60px auto 0;
    padding: 25px 5% 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #777;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.footer-bottom p:hover {
    color: #aaa;
}

.legal-links a {
    color: inherit;
    text-decoration: none;
    margin-left: 20px;
    transition: all 0.3s ease;
}

.legal-links a:hover {
    color: #7B3FF2;
    text-decoration: underline;
}

/* Light Mode Overrides */
[data-theme="light"] .site-footer {
    background: #f8f9fa;
    color: #444;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .site-footer::before {
    background: radial-gradient(circle, rgba(123, 63, 242, 0.05), transparent 70%);
}

[data-theme="light"] .footer-brand .logo-text,
[data-theme="light"] .footer-heading {
    color: #111;
}

[data-theme="light"] .footer-desc,
[data-theme="light"] .footer-links a,
[data-theme="light"] .footer-newsletter p {
    color: #666;
}

[data-theme="light"] .social-icon {
    background: white;
    color: #111;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .footer-brand:hover .logo-text {
    color: #4A0072;
    text-shadow: 0 0 10px rgba(123, 63, 242, 0.2);
}

[data-theme="light"] .footer-brand:hover .footer-desc {
    color: #333;
}

[data-theme="light"] .footer-group:hover .footer-heading {
    color: #4A0072;
}

[data-theme="light"] .footer-links a:hover {
    color: #111;
    text-shadow: none;
    font-weight: 600;
}

[data-theme="light"] .social-icon:hover {
    background: #4A0072;
    color: #ffffff;
    box-shadow: 0 5px 15px rgba(74, 0, 114, 0.3);
}

[data-theme="light"] .subscribe-card-3d:hover {
    box-shadow: 0px 15px 40px -5px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-color: rgba(74, 0, 114, 0.3);
}

[data-theme="light"] .newsletter-input {
    background: white;
    border-color: rgba(0, 0, 0, 0.1);
    color: #111;
}

[data-theme="light"] .footer-bottom {
    border-top-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .legal-links a:hover {
    color: #4A0072;
}

/* Responsiveness */
@media (max-width: 991px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .footer-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* Two equal columns */
        gap: 20px;
        text-align: center;
        padding: 0 1.5rem;
        /* Slightly more padding on mobile */
    }

    /* Brand Section: Span full width (2 columns) */
    .footer-brand {
        grid-column: 1 / -1;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 20px;
    }

    .footer-brand .footer-logo,
    .logo-area {
        justify-content: center;
    }

    .footer-desc {
        margin-left: auto;
        margin-right: auto;
        max-width: 100%;
    }

    .social-links {
        justify-content: center;
        width: 100%;
    }

    /* Link Groups: Company & Solutions - Sit side by side naturally (1fr each) */
    .footer-group {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-heading {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 15px;
        text-align: center;
    }

    .footer-links li {
        text-align: center;
    }

    /* Newsletter: Span full width (2 columns) */
    .footer-newsletter {
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 20px;
    }

    .subscribe-card-3d {
        margin: 0 auto;
        /* Retain original max-width of 320px from desktop styles */
        width: 100%;
        /* Keeps it responsive but bounded by max-width */
        max-width: 320px;
    }

    .subscribe-card-3d h4 {
        text-align: left;
        /* Restore original left align inside the card */
    }

    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        margin-top: 40px;
    }

    .seo-keywords-block {
        text-align: center !important;
    }

    .legal-links {
        margin-top: 10px;
    }
}