/**
 * NWA Rotator – Frontend Styles
 * Modern WhatsApp button with floating and inline modes
 *
 * © 2026 Nuha Labs Indonesia (Nuha.pro)
 */

/* ═══════════════════════════════════════════════
   BASE BUTTON
   ═══════════════════════════════════════════════ */

.nwa-rotator-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background-color: #25D366;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-decoration: none;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.35);
    line-height: 1.2;
}

.nwa-rotator-btn:hover {
    background-color: #128C7E;
    box-shadow: 0 6px 25px rgba(18, 140, 126, 0.45);
    transform: translateY(-2px);
    color: #fff;
    text-decoration: none;
}

.nwa-rotator-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(37, 211, 102, 0.3);
}

/* Icon */
.nwa-wa-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    fill: currentColor;
}

/* Text */
.nwa-btn-text {
    white-space: nowrap;
}

/* Custom Icon */
.nwa-custom-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   ALIGNMENT UTILITIES (ELEMENTOR)
   ═══════════════════════════════════════════════ */

.elementor-align-justify .nwa-rotator-wrap {
    display: flex;
    width: 100%;
}
.elementor-align-justify .nwa-rotator-btn {
    flex-basis: 100%;
    width: 100%;
    justify-content: center;
}

@media (max-width: 1024px) {
    .elementor-tablet-align-justify .nwa-rotator-wrap {
        display: flex;
        width: 100%;
    }
    .elementor-tablet-align-justify .nwa-rotator-btn {
        flex-basis: 100%;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .elementor-mobile-align-justify .nwa-rotator-wrap {
        display: flex;
        width: 100%;
    }
    .elementor-mobile-align-justify .nwa-rotator-btn {
        flex-basis: 100%;
        width: 100%;
        justify-content: center;
    }
}

/* ═══════════════════════════════════════════════
   FLOATING MODE
   ═══════════════════════════════════════════════ */

.nwa-floating {
    position: fixed;
    z-index: 99999;
    bottom: 25px;
}

.nwa-floating .nwa-rotator-btn {
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
}

/* Positions */
.nwa-float-bottom-right {
    right: 25px;
}

.nwa-float-bottom-left {
    left: 25px;
}

/* Pulse animation for floating */
.nwa-floating .nwa-rotator-btn {
    animation: nwa-pulse 2s infinite;
}

.nwa-floating .nwa-rotator-btn:hover {
    animation: none;
}

@keyframes nwa-pulse {
    0% {
        box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
    }
    50% {
        box-shadow: 0 6px 30px rgba(37, 211, 102, 0.2), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
    100% {
        box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
    }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 767px) {
    .nwa-floating {
        bottom: 15px;
    }

    .nwa-float-bottom-right {
        right: 15px;
    }

    .nwa-float-bottom-left {
        left: 15px;
    }

    .nwa-rotator-btn {
        padding: 12px 22px;
        font-size: 14px;
    }

    .nwa-wa-icon {
        width: 20px;
        height: 20px;
    }
}

/* ═══════════════════════════════════════════════
   PRE-CHAT MODAL FORM
   ═══════════════════════════════════════════════ */

.nwa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nwa-modal-overlay.nwa-show {
    display: flex;
    opacity: 1;
}

.nwa-modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.nwa-modal-overlay.nwa-show .nwa-modal-content {
    transform: translateY(0);
}

.nwa-modal-header {
    background: #25D366;
    color: #fff;
    padding: 20px 24px;
    position: relative;
}

.nwa-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.nwa-modal-desc {
    margin: 6px 0 0;
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
}

.nwa-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.nwa-modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

.nwa-modal-body {
    padding: 24px;
}

.nwa-modal-group {
    margin-bottom: 16px;
}

.nwa-modal-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 6px;
}

.nwa-modal-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    background: #f8fafc;
    transition: all 0.2s;
    box-sizing: border-box;
}

.nwa-modal-input:focus {
    outline: none;
    border-color: #25D366;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.nwa-modal-submit {
    width: 100%;
    padding: 12px;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
    margin-top: 8px;
}

.nwa-modal-submit:hover {
    background: #128C7E;
}

.nwa-modal-submit:active {
    transform: scale(0.98);
}
