/* ================================
   FLOATING BUTTONS GROUP
   ================================ */
.floating-buttons-group {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* Hide plugin version if theme version exists */
body:has(.floating-buttons-group:not(.plugin-version)) .floating-buttons-group.plugin-version {
    display: none !important;
}

/* ================================
   BADGE MIỄN PHÍ
   ================================ */
.floating-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.badge-icon {
    font-size: 16px;
}

/* ================================
   FLOATING BUTTONS
   ================================ */
.float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: none;
    position: relative;
    text-decoration: none;
}

.float-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Nút Tư Vấn */
.btn-consultation {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
}

.btn-icon-svg {
    width: 28px;
    height: 28px;
}

/* Nút Zalo */
.btn-zalo {
    background: linear-gradient(135deg, #0068ff 0%, #0052cc 100%);
    color: white !important;
}

.zalo-text {
    font-weight: bold;
    font-size: 16px;
    color: white !important;
}

/* Tooltip */
.btn-tooltip {
    position: absolute;
    right: 75px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.float-btn:hover .btn-tooltip {
    opacity: 1;
}

/* ================================
   POPUP OVERLAY
   ================================ */
.consultation-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.consultation-popup.active {
    display: flex;
}

.popup-overlay,
.popup-overlay-plugin {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

/* ================================
   POPUP BOX
   ================================ */
.popup-box {
    position: relative;
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    z-index: 1;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
.popup-box::-webkit-scrollbar {
    width: 8px;
}

.popup-box::-webkit-scrollbar-thumb {
    background: #4a90e2;
    border-radius: 4px;
}

/* ================================
   POPUP CLOSE BUTTON
   ================================ */
.popup-close,
.popup-close-plugin {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e74c3c;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover,
.popup-close-plugin:hover {
    background: #c0392b;
    transform: rotate(90deg);
}

/* ================================
   POPUP HEADER
   ================================ */
.popup-header {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    padding: 30px;
    padding-right: 60px;
    text-align: center;
    border-radius: 15px 15px 0 0;
}

.popup-header h3 {
    font-size: 24px;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.popup-header p {
    font-size: 14px;
    margin: 0;
    opacity: 0.95;
}

/* ================================
   POPUP FORM
   ================================ */
.popup-form {
    padding: 30px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.form-row .req {
    color: #e74c3c;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-row select {
    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='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

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

/* ================================
   SUBMIT BUTTON
   ================================ */
.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    position: relative;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-submit .loading {
    display: none;
}

.btn-submit.loading .txt {
    display: none;
}

.btn-submit.loading .loading {
    display: inline;
}

/* ================================
   FORM MESSAGES
   ================================ */
.form-message {
    margin-top: 15px;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

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

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

/* ================================
   RESPONSIVE MOBILE
   ================================ */
@media (max-width: 768px) {
    .floating-buttons-group {
        bottom: 15px;
        right: 15px;
        gap: 10px;
    }

    .float-btn {
        width: 55px;
        height: 55px;
    }

    .btn-tooltip {
        display: none;
    }

    .popup-box {
        margin: 10px;
    }

    .popup-header {
        padding: 20px;
    }

    .popup-form {
        padding: 20px;
    }
}

/* ================================
   AVOID CONFLICTS
   ================================ */
/* Đảm bảo không conflict với nút scroll-to-top của theme */
.scroll-to-top,
.back-to-top,
#back-to-top,
.scrollup {
    z-index: 9997 !important;
}
