/* =====================================================================
   FOOTER - WCAG 2.2 Compliant, Accessible
   ===================================================================== */

footer {
    position: relative;
    background: transparent;
    border-top: 1px solid rgba(0, 201, 111, 0.15);
    padding: 80px 0 40px;
    margin-top: 60px;
    overflow: hidden;
}

/* Light theme footer */
:not(.dark) footer {
    border-top-color: rgba(0, 201, 111, 0.2);
}

/* Subtle glow at top */
footer::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(0, 201, 111, 0.05) 0%, transparent 70%);
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

:not(.dark) footer::before {
    background: radial-gradient(ellipse, rgba(0, 201, 111, 0.03) 0%, transparent 70%);
}

.dark footer,
footer {
    background: transparent;
    border-top-color: rgba(0, 201, 111, 0.15);
}

/* Footer Brand */
footer .logo-container,
footer .footer-brand {
    max-width: 320px;
}

footer .logo-image,
.footer-logo {
    height: 40px;
    width: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 8px rgba(0, 201, 111, 0.2));
}

:not(.dark) footer .logo-image,
:not(.dark) .footer-logo {
    filter: none;
}

/* Footer logo visibility based on theme */
footer .logo-light { display: block; }
footer .logo-dark { display: none; }
.dark footer .logo-light { display: none; }
.dark footer .logo-dark { display: block; }

footer p,
.footer-brand p {
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 1rem;
    color: var(--text-secondary, #C9D1D9);
    line-height: 1.7;
    margin-bottom: 24px;
}

:not(.dark) footer p,
:not(.dark) .footer-brand p {
    color: #4A5568;
}

.payment-badge {
    height: 36px;
    width: auto;
    opacity: 0.85;
    transition: all 200ms ease;
}

.payment-badge:hover {
    opacity: 1;
    transform: scale(1.03);
}

/* Footer Column Headers */
footer h4 {
    font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary, #00C96F);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

:not(.dark) footer h4 {
    color: #059669;
}

footer h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 32px;
    height: 3px;
    background: var(--primary, #00C96F);
    border-radius: 3px;
}

:not(.dark) footer h4::after {
    background: #059669;
}

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

footer li {
    margin-bottom: 12px;
}

footer a {
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary, #C9D1D9);
    transition: all 200ms ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

:not(.dark) footer a {
    color: #4A5568;
}

footer a:hover {
    color: var(--primary, #00C96F);
    transform: translateX(4px);
    text-decoration: none;
}

:not(.dark) footer a:hover {
    color: #059669;
}

footer a::before {
    content: '';
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 200ms ease;
}

:not(.dark) footer a::before {
    background: #00b464;
}

footer a:hover::before {
    width: 12px;
}

/* Footer Legal Links Row */
.footer-legal-links,
footer li.flex {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.footer-legal-links a,
footer li.flex a {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 14px;
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 100px;
    transition: all 200ms ease;
}

:not(.dark) .footer-legal-links a,
:not(.dark) footer li.flex a {
    color: #64748b;
    background: rgba(0, 180, 100, 0.08);
    border-color: rgba(0, 180, 100, 0.2);
}

.footer-legal-links a::before,
footer li.flex a::before {
    display: none;
}

.footer-legal-links a:hover,
footer li.flex a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #0a0f1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
}

:not(.dark) .footer-legal-links a:hover,
:not(.dark) footer li.flex a:hover {
    background: #00b464;
    border-color: #00b464;
    box-shadow: 0 4px 20px rgba(0, 180, 100, 0.2);
}

/* Footer Contact */
.footer-contact a,
footer a[href^="mailto"],
footer a[href^="tel"] {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.footer-contact svg,
footer a[href^="mailto"] svg,
footer a[href^="tel"] svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

:not(.dark) .footer-contact svg,
:not(.dark) footer a[href^="mailto"] svg,
:not(.dark) footer a[href^="tel"] svg {
    color: #00b464;
}

/* Footer Legal Company Info */
.footer-legal-info,
footer ul.space-y-2.text-gray-600 {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 20px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.footer-legal-info li,
footer ul.space-y-2.text-gray-600 li {
    margin-bottom: 6px;
    font-size: 13px;
}

/* Footer Bottom */
footer .border-t,
.footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 32px;
    margin-top: 48px;
    border-top: 1px solid rgba(0, 255, 136, 0.15) !important;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

footer .border-t a,
.footer-bottom a {
    color: var(--primary);
}

/* Large brand watermark background - uses CSS variable for flexibility */
:root {
    --footer-brand-text: 'CROCKYHOST';
}

footer .grid::before {
    content: var(--footer-brand-text, 'CROCKYHOST');
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(60px, 15vw, 180px);
    font-weight: 900;
    color: rgba(0, 255, 136, 0.03);
    letter-spacing: -0.02em;
    pointer-events: none;
    white-space: nowrap;
}

/* Light theme footer watermark - make it very subtle */
:not(.dark) footer .grid::before {
    color: rgba(0, 180, 100, 0.04);
}

.dark footer .grid::before {
    color: rgba(0, 255, 136, 0.05);
}

/* Responsive Footer */
@media (max-width: 768px) {
    footer {
        padding: 60px 0 32px;
        margin-top: 80px;
    }
    
    footer .grid {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }
    
    footer .logo-container,
    footer .footer-brand {
        max-width: 100%;
        text-align: center;
    }
    
    footer h4 {
        margin-bottom: 20px;
    }
    
    footer h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    footer .border-t,
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    footer .grid::before {
        font-size: 40px;
        bottom: 40px;
    }
}

@media (max-width: 480px) {
    .footer-legal-links,
    footer li.flex {
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-legal-links a,
    footer li.flex a {
        text-align: center;
        justify-content: center;
    }
}
