/**
 * Footer Styles
 * 
 * @package Clevertech_Astra_Child
 */

/* COMPLETE FOOTER RESET - Isolate from ALL page styles */
.site-footer {
    /* Reset only for main footer container */
    all: revert;
    /* Re-apply our box model */
    box-sizing: border-box;
}

.site-footer * {
    /* Don't reset all properties for child elements */
    box-sizing: border-box;
}

/* Ensure footer has proper CSS variable access */
.site-footer {
    --gradient-cta: linear-gradient(90deg, #E74C3C 0%, #F39C12 100%);
    background: var(--background-dark, #1A1A1A);
    color: var(--white, #FFFFFF);
    margin-top: var(--space-2xl, 8rem);
    /* Reset any inherited styles */
    position: relative;
    width: 100%;
    clear: both;
    /* Block any inheritance from parent containers */
    display: block !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    flex: none !important;
}

.footer-top {
    padding: var(--space-2xl) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    /* Force consistent width regardless of parent containers */
    width: 100% !important;
    box-sizing: border-box !important;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 2fr;
    gap: var(--space-xl);
}

/* Footer Logo and Company Info */
.footer-logo {
    color: var(--white);
    font-size: var(--fs-xl);
    margin-bottom: var(--space-md);
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--space-md);
    line-height: 1.6;
}

/* Footer Contact Info */
.footer-contact-info {
    margin: var(--space-md) 0;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.footer-contact-item svg {
    flex-shrink: 0;
    color: #F39C12;
    stroke: #F39C12;
    fill: #F39C12;
}

.footer-contact-item a,
.footer-contact-item a:link,
.footer-contact-item a:visited,
.footer-contact-item a:hover,
.footer-contact-item a:active,
.footer-contact-item a:focus {
    color: #F39C12 !important;
    text-decoration: none !important;
    transition: opacity var(--transition-base);
}

.footer-contact-item a:hover {
    opacity: 0.8;
}

.footer-social {
    display: flex;
    gap: var(--space-sm);
}

.footer-social a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    position: relative !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.footer-social a svg {
    width: 20px !important;
    height: 20px !important;
    fill: #FFFFFF !important;
    display: block !important;
}

/* LinkedIn styling */
.social-linkedin {
    background: #0077B5 !important;
}

.social-linkedin:hover {
    background: #005885 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 119, 181, 0.4);
}

/* Twitter/X styling */
.social-twitter {
    background: #000000 !important;
}

.social-twitter:hover {
    background: #1DA1F2 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(29, 161, 242, 0.4);
}

/* GitHub styling */
.social-github {
    background: #333333 !important;
}

.social-github:hover {
    background: #6e5494 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(110, 84, 148, 0.4);
}

/* Footer Links */
.footer-title {
    color: var(--white);
    font-size: var(--fs-lg);
    margin-bottom: var(--space-md);
}

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

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition-base);
}

.footer-links a:hover {
    color: var(--white);
}

/* Newsletter Form */
.footer-newsletter .newsletter-form {
    margin: var(--space-md) 0;
    max-width: 320px;
}

.newsletter-input-group {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 42px;
}

.newsletter-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    color: var(--white);
    font-size: 0.9rem;
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.newsletter-submit {
    padding: 0 0.75rem;
    background: var(--gradient-cta);
    border: none;
    color: var(--white);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
}

.newsletter-submit svg {
    width: 20px;
    height: 20px;
}

.newsletter-submit:hover {
    opacity: 0.9;
}

/* Newsletter Feedback */
.newsletter-feedback {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: none;
    animation: slideDown 0.3s ease;
}

.newsletter-feedback.show {
    display: block;
}

.newsletter-feedback.success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #28A745;
}

.newsletter-feedback.error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #DC3545;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Certifications */
.footer-certifications {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.cert-badge {
    display: inline-block;
    transition: all var(--transition-base);
    opacity: 0.8;
}

.cert-badge:hover {
    opacity: 1;
    transform: translateY(-3px);
}

.footer-certifications img,
.footer-certifications a img,
.cert-badge img,
a.cert-badge img,
.footer-newsletter img {
    display: block !important;
    height: 40px !important;
    width: auto !important;
    max-height: 40px !important;
}

/* Footer Bottom */
.footer-bottom {
    background: rgba(0, 0, 0, 0.3);
    padding: var(--space-md) 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.footer-legal {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition-base);
}

.footer-legal a:hover {
    color: var(--white);
}

.separator {
    color: rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: var(--space-lg);
    }
    
    .footer-column.footer-company {
        grid-column: 1 / -1;
        margin-bottom: var(--space-md);
    }
    
    .footer-column.footer-newsletter {
        grid-column: 1 / -1;
        margin-top: var(--space-md);
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .footer-column {
        text-align: center;
    }
    
    .footer-contact-info {
        margin: var(--space-lg) auto;
        max-width: 300px;
    }
    
    .footer-contact-item {
        justify-content: center;
    }
    
    .footer-social {
        justify-content: center;
        margin: var(--space-md) auto;
    }
    
    .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .footer-certifications {
        justify-content: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    .footer-legal {
        margin-top: var(--space-sm);
    }
    
    .footer-legal .separator {
        display: inline-block;
        margin: 0 var(--space-xs);
    }
}

@media (max-width: 480px) {
    .footer-top {
        padding: var(--space-xl) 0;
    }
    
    .footer-container {
        padding: 0 var(--space-sm);
    }
    
    .newsletter-input-group {
        flex-direction: column;
    }
    
    .newsletter-input {
        border-radius: var(--radius-md);
        margin-bottom: var(--space-sm);
    }
    
    .newsletter-submit {
        width: 100%;
        padding: 0.75rem;
        border-radius: var(--radius-md);
        justify-content: center;
    }
    
    .footer-legal {
        display: flex;
        flex-direction: column;
        gap: var(--space-xs);
    }
    
    .footer-legal .separator {
        display: none;
    }
    
    .footer-certifications img,
    .footer-certifications a img,
    .cert-badge img,
    a.cert-badge img {
        height: 35px !important;
        max-height: 35px !important;
    }
    
    .footer-newsletter .newsletter-form {
        max-width: 100%;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 48px;
    height: 48px;
    background: var(--gradient-cta);
    border: none;
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Force contact info link colors - absolute override */
.site-footer .footer-contact-info a,
.footer-column .footer-contact-item a,
.footer-contact-info p a,
a[href^="tel:"],
a[href^="mailto:"] {
    color: #F39C12 !important;
}

/* Force certification badge sizes - absolute override */
.site-footer .footer-certifications img,
.site-footer .cert-badge img,
.site-footer a[href*="certificeringen"] img {
    height: 40px !important;
    max-height: 40px !important;
    width: auto !important;
    object-fit: contain !important;
}

@media (max-width: 480px) {
    .site-footer .footer-certifications img,
    .site-footer .cert-badge img,
    .site-footer a[href*="certificeringen"] img {
        height: 35px !important;
        max-height: 35px !important;
    }
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Responsive */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-lg);
    }
    
    .footer-company,
    .footer-newsletter {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-company,
    .footer-newsletter {
        grid-column: span 1;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    .back-to-top {
        bottom: var(--space-md);
        right: var(--space-md);
    }
}