/**
 * FLOATING WIDGETS CSS
 * Floating contact buttons, CTA bar, Quick contact modal
 * Extracted from footer.css for Reland theme compatibility
 */

/* ==========================================================================
   FLOATING CONTACT WIDGET - Desktop Premium Design
   ========================================================================== */
.floating-contact-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    z-index: 999;
}

.fcw-btn {
    display: flex;
    align-items: center;
    gap: 0;
    height: 48px;
    padding: 0;
    border-radius: 24px;
    text-decoration: none;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fcw-btn:hover {
    color: #fff;
    transform: translateX(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.1);
}

.fcw-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.fcw-btn:hover .fcw-icon {
    transform: scale(1.1);
}

.fcw-label {
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    padding-right: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.fcw-btn:hover .fcw-label {
    max-width: 100px;
    opacity: 1;
    padding-right: 18px;
}

.fcw-top {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) translateX(0);
}

.fcw-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) translateX(0);
}

.fcw-top:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    transform: translateY(0) translateX(-4px);
}

.fcw-top:hover .fcw-icon i {
    transform: translateY(-2px);
}

.fcw-zalo {
    background: linear-gradient(135deg, #0068ff 0%, #0052cc 100%);
    animation: fcwPulse 3s ease-in-out infinite;
}

.fcw-zalo:hover {
    background: linear-gradient(135deg, #0052cc 0%, #003d99 100%);
    box-shadow: 0 8px 24px rgba(0, 104, 255, 0.35), 0 4px 8px rgba(0, 104, 255, 0.2);
    animation: none;
}

@keyframes fcwPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(0, 104, 255, 0.25), 0 2px 4px rgba(0, 104, 255, 0.15); }
    50% { box-shadow: 0 6px 20px rgba(0, 104, 255, 0.4), 0 3px 8px rgba(0, 104, 255, 0.25); }
}

.fcw-phone {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.fcw-phone:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.35), 0 4px 8px rgba(34, 197, 94, 0.2);
}

/* ==========================================================================
   MOBILE: Back to Top Button
   ========================================================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 48px;
    height: 48px;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0066b3, #00aeef);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 999;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 102, 179, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: linear-gradient(135deg, #00aeef, #0066b3);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 174, 239, 0.4);
    color: #fff;
}

/* ==========================================================================
   MOBILE: Floating Contact Buttons
   ========================================================================== */
.floating-contact {
    position: fixed;
    bottom: 100px;
    right: 20px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 998;
    transition: bottom 0.3s ease, opacity 0.3s ease;
}

.floating-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.floating-btn:hover {
    transform: scale(1.1) translateY(-3px);
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.floating-btn.phone {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.floating-btn.phone:hover {
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.4);
}

.floating-btn.zalo {
    background: linear-gradient(135deg, #0068ff, #0052cc);
}

.floating-btn.zalo:hover {
    box-shadow: 0 8px 24px rgba(0, 104, 255, 0.4);
}

/* ==========================================================================
   VIEWPORT REDUCED STATE
   ========================================================================== */
body.viewport-reduced .floating-contact,
body.viewport-reduced .floating-contact-widget,
body.viewport-reduced .back-to-top {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ==========================================================================
   DESKTOP (>=992px)
   ========================================================================== */
@media (min-width: 992px) {
    .floating-contact-widget {
        display: flex;
    }
    .floating-contact,
    .back-to-top {
        display: none !important;
    }
}

/* ==========================================================================
   TABLET/MOBILE (<992px)
   ========================================================================== */
@media (max-width: 991.98px) {
    .floating-contact-widget {
        display: none !important;
    }
    .back-to-top {
        display: flex;
    }
    body.has-floating-cta .floating-contact {
        display: none !important;
    }
    body:not(.has-floating-cta) .floating-contact {
        display: flex;
        bottom: 20px;
    }
    body:not(.has-floating-cta) .back-to-top.visible {
        bottom: 138px;
        right: 26px;
    }
    body.has-floating-cta .back-to-top.visible {
        bottom: 90px;
        right: 10px;
    }
}

/* ==========================================================================
   FLOATING CTA BAR - Mobile Only
   ========================================================================== */
.floating-cta-bar {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 1050;
    display: none;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05), 0 -4px 16px rgba(0, 0, 0, 0.08), 0 -12px 40px rgba(0, 0, 0, 0.04);
    transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.floating-cta-bar.visible {
    bottom: 0;
}

.floating-cta-bar.viewport-hidden {
    bottom: -100px !important;
    opacity: 0;
    pointer-events: none;
    transition: bottom 0.2s ease, opacity 0.2s ease;
}

body.viewport-reduced.has-floating-cta {
    padding-bottom: 0 !important;
}

.floating-cta-bar .cta-btn {
    flex: 1;
    max-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.floating-cta-bar .cta-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.floating-cta-bar .cta-btn:active::before {
    opacity: 1;
}

.floating-cta-bar .cta-phone {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3), 0 4px 16px rgba(34, 197, 94, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.floating-cta-bar .cta-phone:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4), 0 8px 24px rgba(34, 197, 94, 0.2);
}

.floating-cta-bar .cta-zalo {
    background: linear-gradient(135deg, #0068ff 0%, #0052cc 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 104, 255, 0.3), 0 4px 16px rgba(0, 104, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.floating-cta-bar .cta-zalo:hover {
    background: linear-gradient(135deg, #0052cc 0%, #003d99 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 104, 255, 0.4), 0 8px 24px rgba(0, 104, 255, 0.2);
}

.floating-cta-bar .cta-form {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3), 0 4px 16px rgba(249, 115, 22, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: subtlePulse 3s ease-in-out infinite;
}

.floating-cta-bar .cta-form:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4), 0 8px 24px rgba(249, 115, 22, 0.2);
}

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

.floating-cta-bar .cta-btn i {
    font-size: 15px;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}

@keyframes subtlePulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3), 0 4px 16px rgba(249, 115, 22, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
    50% { box-shadow: 0 2px 12px rgba(249, 115, 22, 0.45), 0 6px 20px rgba(249, 115, 22, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
}

@media (max-width: 991px) {
    .floating-cta-bar {
        display: flex;
    }
    body.has-floating-cta {
        padding-bottom: 85px;
    }
}

@media (max-width: 480px) {
    .floating-cta-bar {
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        gap: 8px;
    }
    .floating-cta-bar .cta-btn {
        padding: 11px 10px;
        font-size: 12px;
        border-radius: 10px;
        gap: 5px;
    }
    .floating-cta-bar .cta-btn i {
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .floating-cta-bar .cta-btn {
        padding: 12px 10px;
        font-size: 11px;
    }
    .floating-cta-bar .cta-btn span {
        display: none;
    }
    .floating-cta-bar .cta-btn i {
        font-size: 18px;
    }
}

@media (min-width: 992px) {
    .floating-cta-bar {
        display: none !important;
    }
}

/* ==========================================================================
   QUICK CONTACT MODAL
   ========================================================================== */
.quick-contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.quick-contact-modal.active {
    display: flex;
}

.quick-contact-modal .modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-contact-modal.active .modal-overlay {
    opacity: 1;
}

.quick-contact-modal .modal-content {
    position: relative;
    width: 95%;
    max-width: 440px;
    background: #fff;
    border-radius: 24px;
    padding: 32px 28px 36px;
    transform: translateY(60px);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0.1s;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 12px 24px -8px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.quick-contact-modal.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.quick-contact-modal .modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, #0066b3, #00aeef);
    border-radius: 0 0 4px 4px;
}

.quick-contact-modal .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-contact-modal .modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.quick-contact-modal .modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.quick-contact-modal .modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.quick-contact-modal .modal-header h3 i {
    color: #0066b3;
    margin-right: 8px;
}

.quick-contact-modal .modal-header p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.quick-contact-form .form-group {
    margin-bottom: 15px;
}

.quick-contact-form .form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.quick-contact-form .form-control:focus {
    outline: none;
    border-color: #0066b3;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0,102,179,0.1);
}

.quick-contact-form .form-control::placeholder {
    color: #94a3b8;
}

.quick-contact-form select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.quick-contact-form .btn-submit {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #0066b3 0%, #004a8f 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.quick-contact-form .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,102,179,0.3);
}

.quick-contact-form .btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.quick-contact-form .form-trust {
    text-align: center;
    margin-top: 15px;
    font-size: 13px;
    color: #64748b;
}

.quick-contact-form .form-trust i {
    color: #22c55e;
    margin-right: 5px;
}

.form-alert {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.form-alert.success {
    display: block;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.form-alert.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

@media (min-width: 992px) {
    .quick-contact-modal .modal-content {
        max-width: 480px;
        padding: 40px 36px 44px;
    }
}

@media (max-width: 767px) {
    .quick-contact-modal {
        align-items: flex-start;
        padding-top: 15vh;
    }
    .quick-contact-modal .modal-content {
        width: 95%;
        max-width: none;
        padding: 28px 24px 32px;
        border-radius: 20px;
    }
}

@media (max-width: 400px) {
    .quick-contact-modal {
        padding: 12px;
        padding-top: 10vh;
    }
    .quick-contact-modal .modal-content {
        padding: 24px 20px 28px;
        border-radius: 16px;
    }
    .quick-contact-modal .modal-header h3 {
        font-size: 18px;
    }
}

/* ==========================================================================
   FOOTER FORM - Alert & Validation styles
   ========================================================================== */
.footer-form-alert {
    margin-top: 12px;
}

.footer-alert {
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: fadeInAlert 0.3s ease;
}

.footer-alert.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.footer-alert.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.footer-field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

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