/**
 * Vefey Footer Styles
 * 
 * Architecture:
 * - Chat panel positioned fixed bottom-right, anchored to floating action area
 * - Z-index layering: panel 9998, FABs 9999, overlay 9997
 * - Animations: slide-up reveal for panel, fade for back-to-top
 * - All spacing calibrated for premium enterprise feel
 */

/* ============================================================
   Footer Logo Sizing
   ============================================================ */
.footer-logo {
    width: clamp(132px, 14vw, 188px);
    height: auto;
}

/* ============================================================
   Floating Action Buttons (FAB)
   ============================================================ */
.footer-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.footer-fab__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
}

.footer-fab__btn:hover {
    transform: scale(1.08);
}

.footer-fab__btn:focus-visible {
    outline: 2px solid #00E5FF;
    outline-offset: 2px;
}

/* Back to Top */
.footer-fab__btn--top {
    width: 2.75rem;
    height: 2.75rem;
    background-color: #1E1E24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #C4C4CC;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}

.footer-fab__btn--top:hover {
    background-color: #2D2D35;
    color: #ffffff;
    transform: translateY(0) scale(1.08);
}

.footer-fab__btn--top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* WhatsApp FAB */
.footer-fab__btn--wa {
    width: 3.5rem;
    height: 3.5rem;
    background-color: #25D366;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
}

.footer-fab__btn--wa:hover {
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}

/* ============================================================
   WhatsApp Chat Panel
   ============================================================ */
.wa-panel {
    position: fixed;
    bottom: 6.5rem;
    right: 1.5rem;
    width: 360px;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 8rem);
    border-radius: 16px;
    overflow: hidden;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.05);

    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

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

/* Panel Header */
.wa-panel__header {
    background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
}

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

.wa-panel__avatar {
    width: 2.5rem;
    height: 2.5rem;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wa-panel__title {
    display: block;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.3;
}

.wa-panel__subtitle {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    line-height: 1.3;
}

.wa-panel__close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    border-radius: 4px;
}

.wa-panel__close:hover {
    opacity: 1;
}

.wa-panel__close:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Panel Body */
.wa-panel__body {
    background-color: #ECE5DD;
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

/* Chat bubble */
.wa-panel__bubble {
    background-color: #ffffff;
    padding: 0.875rem 1rem;
    border-radius: 0 12px 12px 12px;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    position: relative;
}

.wa-panel__bubble p {
    color: #333333;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

/* Form */
.wa-panel__form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wa-panel__field {
    width: 100%;
}

.wa-panel__input,
.wa-panel__textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.4;
    background: #ffffff;
    color: #333333;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.wa-panel__input:focus,
.wa-panel__textarea:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.wa-panel__input::placeholder,
.wa-panel__textarea::placeholder {
    color: #999999;
}

.wa-panel__textarea {
    min-height: 72px;
    resize: vertical;
}

/* Validation error state */
.wa-panel__input.is-invalid,
.wa-panel__textarea.is-invalid {
    border-color: #E53935;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

/* Submit button */
.wa-panel__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: #25D366;
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-top: 0.25rem;
}

.wa-panel__submit:hover {
    background-color: #20BA5A;
}

.wa-panel__submit:active {
    transform: scale(0.97);
}

.wa-panel__submit:focus-visible {
    outline: 2px solid #075E54;
    outline-offset: 2px;
}

/* Panel Footer / Brand */
.wa-panel__footer {
    background-color: #F5F5F5;
    border-top: 1px solid #E0E0E0;
    padding: 0.625rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

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

@keyframes waPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.wa-panel__online-text {
    color: #25D366;
    font-weight: 600;
    font-size: 0.6875rem;
}

.wa-panel__divider {
    color: #CCCCCC;
    font-size: 0.6875rem;
    margin: 0 0.125rem;
}

.wa-panel__powered {
    color: #999999;
    font-size: 0.6875rem;
}

.wa-panel__brand-logo {
    width: clamp(72px, 9vw, 96px);
    height: auto;
    margin-left: 0.125rem;
}

/* ============================================================
   Responsive Adjustments
   ============================================================ */
@media (max-width: 480px) {
    .footer-fab {
        bottom: 1rem;
        right: 1rem;
    }

    .wa-panel {
        bottom: 5.5rem;
        right: 0.75rem;
        width: calc(100vw - 1.5rem);
        max-height: calc(100vh - 7rem);
    }

    .footer-fab__btn--wa {
        width: 3rem;
        height: 3rem;
    }

    .footer-fab__btn--top {
        width: 2.5rem;
        height: 2.5rem;
    }
}
