/**
 * MVMHardware Footer Styles
 * 
 * Design tokens from DNA.md:
 * - Primary (Steel Blue): #1A2B3C, #0D1820 (950), #243B4D (800)
 * - CTA (Industrial Orange): #E67E22, #D35400 (hover)
 * - Accent (Copper): #B87333
 * - Neutral scale for text/backgrounds
 * - Fonts: Rajdhani (heading), Source Sans 3 (body)
 */

/* ==========================================================================
   Footer Base Layout
   ========================================================================== */

.site-footer {
    position: relative;
    font-family: 'Source Sans 3', system-ui, sans-serif;
}

.footer-main {
    padding: 4rem 0 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .footer-container {
        padding: 0 1.25rem;
    }
}

@media (min-width: 1024px) {
    .footer-container {
        padding: 0 1.5rem;
    }
}

/* Footer Grid */
.footer-main .footer-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .footer-main .footer-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
}

@media (min-width: 1024px) {
    .footer-main .footer-container {
        grid-template-columns: 1.4fr 1fr 1fr 1fr;
        gap: 3.5rem;
    }
}

/* ==========================================================================
   Brand Column
   ========================================================================== */

.footer-brand {
    max-width: 320px;
}

@media (min-width: 768px) {
    .footer-brand {
        grid-column: span 2;
    }
}

@media (min-width: 1024px) {
    .footer-brand {
        grid-column: span 1;
        max-width: none;
    }
}

.footer-logo-link {
    display: inline-block;
    margin-bottom: 1.25rem;
    transition: opacity 0.2s ease;
}

.footer-logo-link:hover {
    opacity: 0.85;
}

.footer-logo {
    height: 36px;
    width: auto;
}

@media (min-width: 640px) {
    .footer-logo {
        height: 40px;
    }
}

/* Logo color variants for background contrast */
.footer-logo-light {
    display: block;
}

.footer-logo-dark {
    display: none;
}

/* If footer uses light background, swap logos */
.site-footer.footer-light .footer-logo-light {
    display: none;
}

.site-footer.footer-light .footer-logo-dark {
    display: block;
}

.footer-tagline {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

.footer-contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.footer-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-contact-link:hover {
    color: #E67E22;
}

.footer-contact-link svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* ==========================================================================
   Navigation Columns
   ========================================================================== */

.footer-nav-column {
    min-width: 0;
}

.footer-nav-title {
    font-family: 'Rajdhani', system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #E67E22;
    display: inline-block;
}

.footer-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-nav-list a {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
    display: inline-block;
}

.footer-nav-list a:hover {
    color: #E67E22;
    padding-left: 4px;
}

/* ==========================================================================
   Footer Bottom Bar
   ========================================================================== */

.footer-bottom {
    padding: 1.5rem 0;
    background: rgba(0, 0, 0, 0.15);
}

.footer-bottom-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-bottom-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-copyright {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.footer-brand-credit {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

.footer-brand-name {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

/* ==========================================================================
   Floating Action Buttons
   ========================================================================== */

.floating-actions {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
}

@media (min-width: 640px) {
    .floating-actions {
        bottom: 2rem;
        right: 2rem;
    }
}

.floating-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
}

.floating-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.floating-btn:active {
    transform: translateY(0);
}

/* Back to Top Button */
.floating-btn-secondary {
    background: #1A2B3C;
    color: #ffffff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.floating-btn-secondary.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.floating-btn-secondary:hover {
    background: #243B4D;
}

/* WhatsApp Button */
.floating-btn-whatsapp {
    background: #25D366;
    color: #ffffff;
    width: 56px;
    height: 56px;
}

.floating-btn-whatsapp:hover {
    background: #20c35e;
}

/* Pulse animation for WhatsApp button */
.floating-btn-whatsapp::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #25D366;
    animation: wa-pulse 2s ease-out infinite;
    z-index: -1;
}

@keyframes wa-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ==========================================================================
   WhatsApp Chat Panel
   ========================================================================== */

.wa-chat-panel {
    position: fixed;
    bottom: 6.5rem;
    right: 1.5rem;
    width: 360px;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 8rem);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    
    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

@media (min-width: 640px) {
    .wa-chat-panel {
        bottom: 7rem;
        right: 2rem;
    }
}

.wa-chat-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Panel Header */
.wa-panel-header {
    background: #075E54;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.wa-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wa-avatar {
    width: 44px;
    height: 44px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
}

.wa-header-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.wa-title {
    font-family: 'Rajdhani', system-ui, sans-serif;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #ffffff;
}

.wa-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
}

.wa-status-dot {
    width: 8px;
    height: 8px;
    background: #25D366;
    border-radius: 50%;
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.wa-close-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.wa-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Panel Body */
.wa-panel-body {
    padding: 1.25rem;
    background: #ECE5DD;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Message Bubbles */
.wa-message {
    max-width: 85%;
    padding: 0.875rem 1rem;
    border-radius: 0 12px 12px 12px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #1A2B3C;
}

.wa-message p {
    margin: 0;
}

.wa-message p + p {
    margin-top: 0.5rem;
}

.wa-message-incoming {
    align-self: flex-start;
}

/* Lead Form */
.wa-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #ffffff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wa-form-field {
    width: 100%;
}

.wa-form input,
.wa-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9375rem;
    color: #1A2B3C;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.wa-form input::placeholder,
.wa-form textarea::placeholder {
    color: #9CA3AF;
}

.wa-form input:focus,
.wa-form textarea:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.wa-form textarea {
    resize: vertical;
    min-height: 80px;
}

.wa-form input.error,
.wa-form textarea.error {
    border-color: #DC2626;
}

.wa-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #25D366;
    color: #ffffff;
    border: none;
    border-radius: 24px;
    font-family: 'Rajdhani', system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    margin-top: 0.25rem;
}

.wa-submit-btn:hover {
    background: #20c35e;
}

.wa-submit-btn:active {
    transform: scale(0.98);
}

.wa-submit-btn svg {
    flex-shrink: 0;
}

/* Panel Footer */
.wa-panel-footer {
    padding: 0.875rem 1.25rem;
    background: #F5F5F5;
    border-top: 1px solid #E5E5E5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wa-footer-logo {
    height: 18px;
    width: auto;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.wa-footer-logo:hover {
    opacity: 0.8;
}

/* ==========================================================================
   Background Color Utilities
   ========================================================================== */

.bg-primary-950 {
    background-color: #0D1820;
}

.bg-primary-900 {
    background-color: #1A2B3C;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 480px) {
    .wa-chat-panel {
        bottom: 5.5rem;
        right: 1rem;
        left: 1rem;
        width: auto;
        max-width: none;
    }
    
    .floating-actions {
        bottom: 1rem;
        right: 1rem;
    }
    
    .floating-btn {
        width: 48px;
        height: 48px;
    }
    
    .floating-btn-whatsapp {
        width: 52px;
        height: 52px;
    }
}
