/* ============================================
 * BVN Quote Generator
 * ============================================ */

/* Nút "Tạo quote" hiện khi bôi đen text */
.bvn-qg-trigger {
    position: absolute;
    z-index: 99999;
    display: none;
    padding: 8px 14px;
    background: #e60012;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    line-height: 1;
    transition: transform 0.15s ease, background 0.15s ease;
}

.bvn-qg-trigger:hover {
    background: #c50010;
    transform: translateY(-1px);
}

.bvn-qg-trigger.is-visible {
    display: inline-block;
}

.bvn-qg-trigger::before {
    content: '"';
    font-family: Georgia, serif;
    margin-right: 6px;
    font-size: 16px;
    line-height: 0;
    vertical-align: -2px;
}

/* Overlay popup */
.bvn-qg-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.bvn-qg-overlay.is-open {
    display: flex;
}

/* Popup */
.bvn-qg-popup {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.bvn-qg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #eee;
}

.bvn-qg-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #222;
}

.bvn-qg-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    line-height: 1;
    min-height: unset !important;
    height: auto !important;
    margin: 0 !important;
}

.bvn-qg-close:hover {
    color: #000;
}

/* Vùng preview ảnh */
.bvn-qg-preview-wrap {
    padding: 20px 24px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.bvn-qg-preview {
    max-width: 100%;
    max-height: 60vh;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.bvn-qg-loading {
    color: #999;
    font-size: 14px;
}

/* Phần điều khiển */
.bvn-qg-controls {
    padding: 0 24px 16px;
}

.bvn-qg-control-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.bvn-qg-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    min-width: 80px;
}

.bvn-qg-size-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* === Background options (3 ô tròn) === */
.bvn-qg-bg-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bvn-qg-bg-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    background-color: #ccc;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.15s ease, border-color 0.15s ease;
    margin: 0 !important;
    min-height: unset !important;
}

.bvn-qg-bg-btn:hover {
    transform: scale(1.08);
}

.bvn-qg-bg-btn .bvn-qg-check {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    opacity: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

.bvn-qg-bg-btn.is-active {
    border-color: #333;
}

.bvn-qg-bg-btn.is-active .bvn-qg-check {
    opacity: 1;
}

/* Nút thumbnail riêng — nếu không có ảnh thumbnail, fallback gradient */
.bvn-qg-bg-thumb {
    background-color: #e5e5e5;
    background-image: linear-gradient(135deg, #5b0a8a, #c41e3a);
}
.bvn-qg-bg-thumb .bvn-qg-check {
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.bvn-qg-size-btn {
    padding: 8px 16px;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #333;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    margin: 0 !important;
    min-height: unset !important;
    height: auto !important;
    line-height: 1;
}

.bvn-qg-size-btn:hover {
    border-color: #e60012;
}

.bvn-qg-size-btn.is-active {
    background: #e60012;
    color: #fff;
    border-color: #e60012;
}

.bvn-qg-size-btn .bvn-qg-icon {
    display: inline-block;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

.bvn-qg-size-btn[data-size="square"] .bvn-qg-icon {
    width: 12px;
    height: 12px;
}

.bvn-qg-size-btn[data-size="portrait"] .bvn-qg-icon {
    width: 10px;
    height: 13px;
}

.bvn-qg-size-btn[data-size="landscape"] .bvn-qg-icon {
    width: 14px;
    height: 10px;
}

/* Nút tải về */
.bvn-qg-footer {
    padding: 0 24px 20px;
}

.bvn-qg-download {
    width: 100%;
    padding: 14px;
    background: #e60012;
    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.15s ease;
    margin: 0 !important;
    min-height: unset !important;
    height: auto !important;
    line-height: 1;
}

.bvn-qg-download:hover {
    background: #c50010;
}

.bvn-qg-download:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Canvas ẩn dùng để render */
.bvn-qg-canvas-hidden {
    position: absolute;
    left: -99999px;
    top: -99999px;
    visibility: hidden;
}

/* Responsive */
@media (max-width: 480px) {
    .bvn-qg-header h3 {
        font-size: 16px;
    }

    .bvn-qg-preview-wrap {
        padding: 16px;
    }

    .bvn-qg-controls,
    .bvn-qg-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .bvn-qg-control-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
