/* ==========================================================================
   Footer Module Styles
   - Positioning, animations, and WhatsApp chat panel
   - Complements Tailwind utility classes used in footer.php
   ========================================================================== */

/* --------------------------------------------------------------------------
   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: 1000;
    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;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

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

.footer-fab__btn:active {
    transform: scale(0.96);
}

/* Back to top */
.footer-fab__btn--top {
    width: 44px;
    height: 44px;
    background-color: #1A2332;
    color: #ffffff;
    font-size: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.footer-fab__btn--top:hover {
    background-color: #243447;
    transform: translateY(-1px);
}

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

/* WhatsApp trigger */
.footer-fab__btn--wa {
    width: 56px;
    height: 56px;
    background-color: #25D366;
    color: #ffffff;
    font-size: 1.625rem;
}

.footer-fab__btn--wa:hover {
    background-color: #20b858;
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.35);
}

/* --------------------------------------------------------------------------
   WhatsApp Chat Panel
   -------------------------------------------------------------------------- */
.wa-panel {
    position: fixed;
    bottom: 100px;
    right: 1.5rem;
    width: 360px;
    max-width: calc(100vw - 2rem);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.04);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.wa-panel.is-open {
    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;
}

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

.wa-panel__avatar {
    width: 40px;
    height: 40px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #ffffff;
}

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

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

.wa-panel__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
    line-height: 1;
}

.wa-panel__close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Panel body */
.wa-panel__body {
    background: #f0ede8;
    padding: 1.25rem;
    flex: 1;
}

/* Conversational bubble */
.wa-panel__bubble {
    background: #ffffff;
    padding: 0.875rem 1rem;
    border-radius: 0 12px 12px 12px;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-size: 0.875rem;
    line-height: 1.5;
    color: #334155;
}

.wa-panel__bubble p {
    margin: 0;
}

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

.wa-panel__field {
    position: relative;
}

.wa-panel__input,
.wa-panel__textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #ffffff;
    color: #334155;
    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: #94a3b8;
}

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

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

.wa-panel__submit:hover {
    background: #20b858;
    transform: translateY(-1px);
}

.wa-panel__submit:active {
    transform: translateY(0);
}

.wa-panel__submit i {
    font-size: 1.125rem;
}

/* Panel footer */
.wa-panel__footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 0.625rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    color: #94a3b8;
}

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

@keyframes wa-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.wa-panel__online-label {
    color: #25D366;
    font-weight: 600;
}

.wa-panel__divider {
    color: #cbd5e1;
    margin: 0 0.125rem;
}

.wa-panel__powered {
    color: #94a3b8;
}

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

/* --------------------------------------------------------------------------
   Responsive adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .wa-panel {
        bottom: 80px;
        right: 0.75rem;
        width: calc(100vw - 1.5rem);
    }

    .footer-fab {
        bottom: 1rem;
        right: 1rem;
    }

    .footer-fab__btn--wa {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .footer-fab__btn--top {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
