.ban-key-pro-key-order {
    margin-bottom: 20px;
}

.ban-key-pro-key-order h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.ban-key-pro-key-order p {
    margin-bottom: 15px;
}

.ban-key-pro-key-order-options label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.ban-key-pro-key-order-options select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
}

#ban_key_pro_price_display {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.single_add_to_cart_button {
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    cursor: pointer;
}

/* Ẩn nút +/- trong giỏ hàng */
.cart .quantity {
    display: none !important;
}

/* Styling cho bảng Active Keys */
.ban-key-pro-active-keys-table {
    border-collapse: collapse;
    width: 100%;
    margin: 20px 0;
}

.ban-key-pro-active-keys-table thead th {
    background: #f3f4f6 !important;
    color: #1f2937 !important;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.ban-key-pro-active-keys-table tbody td {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    background-color: #ffffff !important;
}

.ban-key-pro-active-keys-table tbody tr {
    transition: background-color 0.2s ease;
    background-color: #ffffff !important;
}

.ban-key-pro-active-keys-table tbody tr:hover {
    background-color: #f8f9fa !important;
}

.ban-key-pro-active-keys-table tbody tr:hover td {
    background-color: #f8f9fa !important;
}

.ban-key-pro-active-keys-table tbody tr:nth-child(even) {
    background-color: #f9fafb !important;
}

.ban-key-pro-active-keys-table tbody tr:nth-child(even) td {
    background-color: #f9fafb !important;
}

.ban-key-pro-active-keys-table tbody tr:nth-child(even):hover {
    background-color: #f0f0f0 !important;
}

.ban-key-pro-active-keys-table tbody tr:nth-child(even):hover td {
    background-color: #f0f0f0 !important;
}

/* Màu nền mờ cho từng cột - chỉ áp dụng khi không hover */
.ban-key-pro-active-keys-table tbody tr:not(:hover) .bkp-col-key {
    background-color: rgba(102, 126, 234, 0.05) !important;
}

/* Style cho ô Key có thể click để copy */
.bkp-key-clickable {
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: background-color 0.2s ease;
}

.bkp-key-clickable:hover {
    background-color: rgba(102, 126, 234, 0.1) !important;
}

/* Áp dụng cho tất cả các bảng Key Pro */
.ban-key-pro-keys-table .bkp-key-clickable:hover {
    background-color: rgba(102, 126, 234, 0.1) !important;
}

/* Thông báo đã copy key */
.bkp-copy-notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(34, 197, 94, 0.95);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    animation: bkp-copy-fade-in 0.3s ease;
}

@keyframes bkp-copy-fade-in {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.ban-key-pro-active-keys-table tbody tr:not(:hover) .bkp-col-remaining {
    background-color: rgba(118, 75, 162, 0.05) !important;
}

.ban-key-pro-active-keys-table tbody tr:not(:hover) .bkp-col-usage {
    background-color: rgba(102, 126, 234, 0.08) !important;
}

.ban-key-pro-active-keys-table tbody tr:not(:hover) .bkp-col-renew {
    background-color: rgba(34, 197, 94, 0.1) !important;
    text-align: center;
    position: relative;
}

.ban-key-pro-active-keys-table tbody tr:not(:hover) .bkp-col-reset {
    background-color: rgba(255, 193, 7, 0.1) !important;
    text-align: center;
    position: relative;
}

.ban-key-pro-active-keys-table tbody tr:not(:hover) .bkp-col-delete {
    background-color: rgba(220, 53, 69, 0.1) !important;
    text-align: center;
    position: relative;
}

/* Đảm bảo các cột action luôn căn giữa và có đủ không gian */
.ban-key-pro-active-keys-table .bkp-col-renew,
.ban-key-pro-active-keys-table .bkp-col-reset,
.ban-key-pro-active-keys-table .bkp-col-delete {
    text-align: center;
    vertical-align: middle;
    position: relative;
    padding: 12px 15px !important;
    min-height: 60px;
    display: table-cell;
}

/* Make DEL column compact (about 5 characters wide) */
.ban-key-pro-active-keys-table th.bkp-col-delete,
.ban-key-pro-active-keys-table td.bkp-col-delete {
    width: 5ch !important;
    min-width: 5ch !important;
    max-width: 5ch !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
}

.ban-key-pro-active-keys-table td.bkp-col-delete .bkp-delete-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
}

.ban-key-pro-active-keys-table td.bkp-col-delete .bkp-delete-btn .bkp-icon-delete {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
}

.ban-key-pro-active-keys-table .bkp-col-renew > *,
.ban-key-pro-active-keys-table .bkp-col-reset > *,
.ban-key-pro-active-keys-table .bkp-col-delete > * {
    display: block;
    margin: 0 auto;
}

/* Đảm bảo các cột có màu nền khi hover */
.ban-key-pro-active-keys-table tbody tr:hover .bkp-col-key,
.ban-key-pro-active-keys-table tbody tr:hover .bkp-col-remaining,
.ban-key-pro-active-keys-table tbody tr:hover .bkp-col-usage,
.ban-key-pro-active-keys-table tbody tr:hover .bkp-col-renew,
.ban-key-pro-active-keys-table tbody tr:hover .bkp-col-reset,
.ban-key-pro-active-keys-table tbody tr:hover .bkp-col-delete {
    background-color: inherit !important;
}

/* Styling cho nút Reset, Delete và Renew */
.bkp-reset-btn, .bkp-delete-btn, .bkp-renew-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70%;
    height: 70%;
    min-width: 40px;
    min-height: 40px;
    max-width: 60px;
    max-height: 60px;
    box-sizing: border-box;
    position: relative;
    margin: 0 auto;
    vertical-align: middle;
    /* Đảm bảo không di chuyển khi hover */
    transform: none;
    will-change: background-color;
    outline: none;
}

.bkp-reset-btn:hover:not(:disabled) {
    background-color: rgba(147, 197, 253, 0.25);
    border: none;
    padding: 0;
    transform: none;
    margin: 0 auto;
    width: 70%;
    height: 70%;
    min-width: 40px;
    min-height: 40px;
    max-width: 60px;
    max-height: 60px;
    box-sizing: border-box;
}

.bkp-reset-btn:disabled,
.bkp-renew-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    user-select: none;
}

.bkp-delete-btn:hover {
    background-color: rgba(196, 181, 253, 0.25);
    border: none;
    padding: 0;
    transform: none;
    margin: 0 auto;
    width: 70%;
    height: 70%;
    min-width: 40px;
    min-height: 40px;
    max-width: 60px;
    max-height: 60px;
    box-sizing: border-box;
}

.bkp-renew-btn:hover:not(:disabled) {
    background-color: rgba(165, 243, 252, 0.25);
    border: none;
    padding: 0;
    transform: none;
    margin: 0 auto;
    width: 70%;
    height: 70%;
    min-width: 40px;
    min-height: 40px;
    max-width: 60px;
    max-height: 60px;
    box-sizing: border-box;
}

.bkp-reset-btn .bkp-icon-reset,
.bkp-delete-btn .bkp-icon-delete,
.bkp-renew-btn .bkp-icon-renew {
    font-size: 20px;
    line-height: 1;
    display: block;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    /* Đảm bảo icon không di chuyển khi hover */
    will-change: auto;
    transition: none;
    pointer-events: none;
    width: 20px;
    height: 20px;
    text-align: center;
}

.bkp-reset-btn .bkp-icon-reset {
    color: #ffc107;
}

.bkp-delete-btn .bkp-icon-delete {
    color: #dc3545;
}

.bkp-renew-btn .bkp-icon-renew {
    color: #22c55e;
}

.bkp-reset-btn:disabled .bkp-icon-reset,
.bkp-renew-btn:disabled .bkp-icon-renew {
    color: #999;
    opacity: 0.5;
}

/* Đảm bảo icon không di chuyển khi hover vào nút */
.bkp-reset-btn:hover:not(:disabled) .bkp-icon-reset,
.bkp-delete-btn:hover .bkp-icon-delete,
.bkp-renew-btn:hover .bkp-icon-renew {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 1;
}

/* Message container cho inline actions */
.bkp-inline-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.bkp-inline-message.show {
    display: block;
}

.bkp-inline-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bkp-inline-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.bkp-inline-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Renew Modal Styles */
.bkp-renew-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.bkp-renew-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.bkp-renew-modal-content {
    position: relative;
    background: #fff;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    margin: 5vh auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bkp-renew-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bkp-renew-modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.bkp-renew-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.bkp-renew-modal-close:hover {
    color: #000;
}

.bkp-renew-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.bkp-renew-key-display {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 4px;
}

.bkp-renew-years-selection {
    margin-bottom: 20px;
}

.bkp-renew-years-selection label {
    display: block;
    margin-bottom: 16px;
    font-weight: 600;
}

.bkp-renew-years-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.bkp-renew-plan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: calc(50% - 8px);
    min-width: 300px;
    padding: 16px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    transition: all 0.2s ease;
    cursor: pointer;
    gap: 12px;
}

.bkp-renew-plan:hover {
    border-color: #6366f1;
    transform: translateY(-1px);
}

.bkp-renew-plan.is-active {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff;
    box-shadow: 0 12px 25px rgba(79, 70, 229, 0.3);
}

.bkp-renew-plan-left {
    flex-shrink: 0;
    white-space: nowrap;
}

.bkp-renew-plan-left strong {
    font-size: 16px;
}

.bkp-renew-plan-right {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    font-size: 15px;
    flex-shrink: 0;
    text-align: right;
}

.bkp-renew-price-current {
    font-weight: 700;
}

.bkp-renew-price-original {
    text-decoration: line-through;
    color: #d1d5db;
}

.bkp-renew-plan.is-active .bkp-renew-price-original {
    color: rgba(255, 255, 255, 0.7);
}

.bkp-renew-price-save {
    color: #22c55e;
    font-weight: 600;
}

.bkp-renew-plan.is-active .bkp-renew-price-save {
    color: #bbf7d0;
}

.bkp-renew-total {
    margin-top: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 4px;
}

.bkp-renew-total-save {
    margin-left: 8px;
    color: #2563eb;
    font-size: 14px;
}

.bkp-renew-modal-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
}

.bkp-renew-close-btn {
    background-color: #dc2626;
    color: #fff;
    border: none;
    padding: 8px 16px;
    height: auto;
    min-height: 36px;
    line-height: 1.2;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bkp-renew-close-btn:hover {
    background-color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.bkp-renew-add-to-cart {
    min-width: 150px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2) !important;
    transition: all 0.3s ease !important;
}

.bkp-renew-affiliate-balance {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.bkp-renew-affiliate-balance strong {
    color: #6366f1;
}

.bkp-renew-use-affiliate {
    min-width: 200px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    transition: all 0.3s ease;
}

.bkp-renew-use-affiliate:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.bkp-renew-use-affiliate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .bkp-renew-modal-content {
        width: 95%;
        margin: 2.5vh auto;
    }

    .bkp-renew-plan {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .bkp-renew-plan-right {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Button styles for Add Key and Buy Key */
.ban-key-pro-add-key-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
}

.ban-key-pro-buy-key-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4) !important;
}

.ban-key-pro-add-key-btn:active,
.ban-key-pro-buy-key-btn:active {
    transform: translateY(0);
}