:root {
    --primary-color: #2563eb;
    /* Primary (Blue-600) */
    --primary-light: #3b82f6;
    --primary-glow: rgba(37, 99, 235, 0.15);

    --success-color: #10b981;
    /* Emerald */
    --success-glow: rgba(16, 185, 129, 0.15);

    --danger-color: #ef4444;
    /* Red */

    /* Default (Dark Mode) Variables */
    --bg-primary: #09090b;
    --bg-secondary: #161618;
    --card-bg: #161618;
    --card-hover-bg: #222225;

    --border-color: #27272a;
    --border-hover: #3f3f46;

    --text-color: #f4f4f5;
    --text-bright: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);

    --border-radius-lg: 16px;
    --border-radius-md: 10px;

    /* Dynamic elements */
    --body-bg: #09090b;
    --header-bg: #161618;
    --header-text: #ffffff;
    --package-bg: rgba(255, 255, 255, 0.03);
    --package-hover-bg: rgba(255, 255, 255, 0.06);
    --input-bg: #09090b;
    --modal-overlay: rgba(0, 0, 0, 0.85);
}

/* Light Theme Overrides */
:root[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f4f4f5;
    --card-bg: #f4f4f5;
    --card-hover-bg: #e4e4e7;

    --border-color: #e4e4e7;
    --border-hover: #d4d4d8;

    --text-color: #09090b;
    --text-bright: #09090b;
    --text-secondary: #71717a;
    --text-muted: #a1a1aa;

    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.05);

    --body-bg: #ffffff;
    --header-bg: #f4f4f5;
    --header-text: #09090b;
    --package-bg: #ffffff;
    --package-hover-bg: #e4e4e7;
    --input-bg: #ffffff;
    --modal-overlay: rgba(0, 0, 0, 0.45);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
    background-color: var(--bg-primary);
    background-image: var(--body-bg);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.5;
    padding: 20px;
    min-height: 100vh;
}

/* Global Theme Transition */
body,
.header,
.admin-sidebar,
.admin-content,
.admin-card,
.product-group,
.package-item,
.modal-container,
.form-input,
.btn-submit,
.btn-buy,
.btn-action,
.admin-table th,
.admin-table td,
.tip-banner,
.purchases-section,
.purchases-header,
.purchase-item,
.key-row,
.theme-toggle-btn,
.brand-icon,
.stat-card,
.toast,
a,
p,
span,
h1,
h2,
h3,
h4,
h5,
h6 {
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
        color 250ms cubic-bezier(0.4, 0, 0.2, 1),
        border-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* Header Section */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(17, 17, 24, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 24px;
    margin-top: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1), var(--shadow-md);
    position: sticky;
    top: 15px;
    z-index: 1000;
    transition: var(--transition);
}

:root[data-theme="light"] .header {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02), var(--shadow-md);
}

.brand-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-glow);
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    box-shadow: 0 8px 16px var(--primary-glow);
}

.brand-icon svg {
    width: 18px;
    height: 18px;
}

.brand-name h1 {
    font-size: 18px;
    font-weight: 800;
    color: var(--header-text);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.brand-name p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Tip / Warning Banner */
.tip-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 25px;
}

.tip-icon {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tip-content {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Purchases Section (Keys list from localStorage) */
.purchases-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.purchases-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
}

.purchases-header:hover {
    background-color: rgba(99, 102, 241, 0.03);
}

.purchases-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.purchases-icon {
    font-size: 20px;
    color: var(--success-color);
}

.purchases-count {
    background: var(--success-glow);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.purchases-arrow {
    font-size: 14px;
    color: var(--text-muted);
    transition: var(--transition);
}

.purchases-section.collapsed .purchases-arrow {
    transform: rotate(-90deg);
}

.purchases-content {
    padding: 0 25px 20px 25px;
    display: block;
}

.purchases-section.collapsed .purchases-content {
    display: none;
}

.purchases-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.purchase-item {
    background-color: var(--package-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 15px 20px;
    transition: var(--transition);
}

.purchase-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.purchase-item-title {
    font-weight: 600;
    color: var(--text-bright);
}

.purchase-item-date {
    font-size: 12px;
    color: var(--text-muted);
}

.purchase-keys {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.key-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(99, 102, 241, 0.08);
    border: 1px dashed rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 10px 15px;
    font-family: monospace;
    font-size: 14px;
}

.key-text {
    color: var(--primary-light);
    word-break: break-all;
    font-weight: 600;
}

.btn-copy {
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-copy:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

/* Products Section */
.products-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-group {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15), var(--shadow-md);
    transition: var(--transition);
}

:root[data-theme="light"] .product-group {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02), var(--shadow-md);
}

.product-group:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 40px rgba(124, 58, 237, 0.1), var(--shadow-lg);
}

.product-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    cursor: pointer;
    background: transparent;
    transition: var(--transition);
}

.product-header:hover {
    background: rgba(124, 58, 237, 0.02);
}

.product-info-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.product-image {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    background-color: rgba(124, 58, 237, 0.05);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

img.product-image {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.product-name-txt {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: -0.3px;
}

.product-desc-txt {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.product-header-arrow {
    font-size: 14px;
    color: var(--text-muted);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-group.collapsed .product-header-arrow {
    transform: rotate(-90deg);
}

.product-packages {
    padding: 0 24px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-group.collapsed .product-packages {
    display: none;
}

/* Package Row Item */
.package-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    transition: var(--transition);
}

:root[data-theme="light"] .package-item {
    background-color: rgba(0, 0, 0, 0.01);
}

.package-item:hover {
    background-color: rgba(124, 58, 237, 0.03);
    border-color: var(--primary-color);
}

.package-name {
    font-weight: 700;
    color: var(--text-bright);
    font-size: 15px;
    letter-spacing: -0.1px;
}

.package-stock {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.package-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.package-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.3px;
}

.btn-buy {
    background: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    padding: 0 20px;
    height: 40px;
    border-radius: 10px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    line-height: 1;
    box-shadow: 0 4px 12px var(--primary-glow);
    transition: var(--transition);
    box-sizing: border-box;
    cursor: pointer;
}

.btn-buy:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

/* Checkout Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 92%;
    max-width: 500px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), var(--shadow-lg);
    position: relative;
    transform: translateY(16px);
    transition: var(--transition);
    max-height: 90vh;
    overflow-y: auto;
}

:root[data-theme="light"] .modal-container {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05), var(--shadow-lg);
}

.modal-container.large {
    max-width: 720px;
}

.modal-overlay.show .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

:root[data-theme="light"] .modal-close {
    background: rgba(0, 0, 0, 0.02);
}

.modal-close:hover {
    color: var(--text-bright);
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--primary-color);
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

/* Form Styles inside Modal */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    color: var(--text-bright);
    font-size: 14px;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.btn-submit {
    width: 100%;
    background-color: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    transition: var(--transition);
    margin-top: 10px;
    border: none;
    cursor: pointer;
}

.btn-submit:hover {
    background-color: var(--primary-light);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Order Details Screen */
.order-details-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.banking-info-box {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    align-items: flex-start;
    transition: var(--transition);
}

:root[data-theme="light"] .banking-info-box {
    background-color: var(--bg-secondary);
}

.qr-code-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.qr-code-img {
    width: 240px;
    height: 240px;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.qr-code-img:hover {
    transform: scale(1.02);
}

.qr-code-txt {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.bank-detail-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-primary);
    overflow: hidden;
    width: 100%;
}

.bank-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.bank-detail-item:last-child {
    border-bottom: none;
}

.bank-detail-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.bank-detail-value-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bank-detail-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-bright);
}

.bank-detail-value.price-val {
    color: var(--success-color);
}

.bank-detail-value.desc-val {
    color: #fbbf24;
    font-family: monospace;
    font-size: 15px;
}

.btn-copy {
    background: var(--primary-glow);
    color: var(--primary-color);
    border: 1px solid rgba(124, 58, 237, 0.15);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.btn-copy:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* Polling Status */
.payment-status-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    text-align: center;
    gap: 10px;
}

.status-spinner {
    width: 25px;
    height: 25px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.status-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.status-error {
    color: var(--danger-color);
    font-size: 13px;
    display: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Toast Messages */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 10px 18px;
    color: var(--text-bright);
    font-size: 13px;
    font-weight: 550;
    z-index: 9999;
    opacity: 0;
    transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1), opacity 250ms ease;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}



/* Footer Section */
.footer-section {
    margin-top: 50px;
    padding-bottom: 40px;
    text-align: center;
    position: relative;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin-bottom: 25px;
    opacity: 0.8;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-bright);
    font-weight: 800;
    font-size: 15px;
}

.footer-logo {
    color: var(--primary-light);
    display: flex;
    align-items: center;
}

.footer-tagline {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0;
    line-height: 1.4;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 4px 0;
}

.footer-link-item {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.footer-link-item:hover {
    color: var(--primary-light);
}

.footer-link-dot {
    color: var(--text-muted);
    font-size: 10px;
    opacity: 0.5;
}

.footer-copyright {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .banking-info-box {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 16px;
        align-items: center;
    }

    .qr-code-wrapper {
        margin-bottom: 10px;
        width: 100%;
        text-align: center;
    }

    .qr-code-img {
        width: 200px;
        height: 200px;
    }

    .bank-detail-list {
        width: 100%;
    }

    .package-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .package-right {
        width: 100%;
        justify-content: space-between;
    }
}

/* Nút chuyển đổi giao diện sáng/tối */
.theme-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle-btn {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid var(--border-color);
    color: var(--primary-light);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.theme-toggle-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.5s ease;
}

.theme-toggle-btn:hover svg {
    transform: rotate(20deg);
}

/* Kiểu dáng cho giao diện Admin khi đổi theme */
.admin-sidebar {
    background-color: var(--bg-secondary) !important;
    border-right: 1px solid var(--border-color) !important;
}

.admin-card {
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

.admin-table th {
    background-color: var(--bg-primary) !important;
    color: var(--text-bright) !important;
}

.admin-table td {
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-color) !important;
}

.admin-table tr:hover {
    background-color: rgba(99, 102, 241, 0.03) !important;
}

/* ============================================
   Premium Visual Enhancements
   ============================================ */

/* Entrance animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
    }
}

/* Apply entrance animation to main sections */
.header {
    animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.purchases-section {
    animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.product-group {
    animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.product-group:nth-child(1) {
    animation-delay: 0.15s;
}

.product-group:nth-child(2) {
    animation-delay: 0.25s;
}

.product-group:nth-child(3) {
    animation-delay: 0.35s;
}

.product-group:nth-child(4) {
    animation-delay: 0.45s;
}

/* Subtle border-glow on product cards on hover */
.product-group:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1), var(--shadow-md);
}

/* Premium package item hover */
.package-item:hover {
    background-color: var(--package-hover-bg);
    border-color: var(--primary-color);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.15), 0 4px 16px rgba(99, 102, 241, 0.1);
    transform: translateX(4px);
}

.header {
    position: relative;
    overflow: hidden;
}

.brand-icon {
    position: relative;
    overflow: hidden;
}

.btn-buy {
    background: var(--primary-color);
    position: relative;
    overflow: hidden;
}

/* Active state for buttons */
.btn-buy:active,
.btn-submit:active {
    transform: translateY(0) scale(0.97);
}

.status-spinner {
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-light);
    animation: spin 0.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

/* Modal entrance polish */
.modal-overlay.show .modal-container {
    transform: translateY(0) scale(1);
    animation: fadeInUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Purchase item hover with accent bar */
.purchase-item {
    position: relative;
    overflow: hidden;
}

.purchase-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.purchase-item:hover::before {
    opacity: 1;
}

.purchase-item:hover {
    border-color: var(--border-hover);
    background: rgba(99, 102, 241, 0.03);
}

/* Toast animation enhancement */
.toast.show {
    animation: fadeInUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Smooth key-row highlight */
.key-row {
    transition: var(--transition);
}

.key-row:hover {
    background-color: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
}

/* Better focus styles for accessibility */
.form-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 2px 8px rgba(99, 102, 241, 0.15);
}

/* Inline SVG icon alignment */
svg {
    vertical-align: middle;
    flex-shrink: 0;
}

h2 svg,
.admin-card-title svg,
.modal-title svg,
.login-title svg {
    vertical-align: -2px;
    margin-right: 4px;
}

/* Admin card entrance animation */
.admin-card {
    animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.admin-card:nth-child(2) {
    animation-delay: 0.1s;
}

.admin-card:nth-child(3) {
    animation-delay: 0.2s;
}

/* Admin sidebar glow on active */
.admin-sidebar a.active,
.admin-sidebar a:hover {
    position: relative;
}

.admin-sidebar a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--primary-color);
    border-radius: 0 3px 3px 0;
}

/* Tip banner polish */
.tip-banner {
    position: relative;
    overflow: hidden;
}

.tip-banner::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    border-radius: 0 3px 3px 0;
}

/* Light theme tip content fix */
:root[data-theme="light"] .tip-content {
    color: var(--text-secondary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.4);
}

/* Snowfall Animation Effect */
.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99998;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    background: #ffffff;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.8;
    animation: fall linear infinite;
}

:root[data-theme="light"] .snowflake {
    background: #a5b4fc;
}

@keyframes fall {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 0.7;
    }

    90% {
        opacity: 0.7;
    }

    100% {
        transform: translateY(105vh) translateX(50px);
        opacity: 0;
    }
}

/* Responsive Media Queries */
@media (max-width: 600px) {
    body {
        padding: 12px;
    }

    .brand-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .brand-name h1 {
        font-size: 15px;
    }

    .brand-name p {
        display: none;
    }

    .purchases-header {
        padding: 15px;
    }

    .purchases-content {
        padding: 0 15px 15px 15px;
    }

    .products-container {
        gap: 15px;
    }
}

/* AI Chatbot Floating Widget */
.chatbot-widget-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.chatbot-bubble {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    margin-bottom: 8px;
    max-width: 220px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
    position: relative;
    animation: bounce 2s infinite;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: var(--transition);
}

.chatbot-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: var(--card-bg) transparent;
    display: block;
    width: 0;
}

.chatbot-bubble::before {
    content: '';
    position: absolute;
    bottom: -7px;
    right: 20px;
    border-width: 7px 7px 0;
    border-style: solid;
    border-color: var(--border-color) transparent;
    display: block;
    width: 0;
    z-index: -1;
}

.chatbot-launcher {
    width: 85px;
    height: 85px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    overflow: visible;
    position: relative;
}

.chatbot-launcher:hover {
    transform: scale(1.12) translateY(-4px);
}

.chatbot-launcher img,
.chatbot-launcher svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

/* Chatbox Panel */
.chatbot-panel {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 360px;
    height: 480px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3), var(--shadow-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.chatbot-panel.show {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.chatbot-header {
    background-color: var(--primary-color);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-header-avatar svg {
    width: 16px;
    height: 16px;
    color: #ffffff;
}

.chatbot-header-title {
    font-size: 14px;
    font-weight: 700;
}

.chatbot-header-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 4px;
}

.chatbot-header-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
}

.chatbot-close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition);
}

.chatbot-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: var(--bg-primary);
}

.chat-message {
    display: flex;
    gap: 8px;
    max-width: 80%;
}

.chat-message.bot {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
    max-width: 75%;
}

.chat-message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-message-avatar svg {
    width: 14px;
    height: 14px;
    color: var(--primary-color);
}

.chat-message-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
}

.chat-message.bot .chat-message-bubble {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-top-left-radius: 4px;
}

.chat-message.user .chat-message-bubble {
    background-color: var(--primary-color);
    color: #ffffff;
    border-top-right-radius: 4px;
}

.chat-quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.quick-option-btn {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 11.5px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.quick-option-btn:hover {
    background-color: var(--primary-glow);
    border-color: var(--primary-color);
    color: var(--primary-light);
}

.chatbot-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    background-color: var(--bg-secondary);
}

.chatbot-input {
    flex: 1;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 14px;
    color: var(--text-bright);
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: var(--primary-color);
}

.chatbot-send-btn {
    background-color: var(--primary-color);
    border: none;
    color: #ffffff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.chatbot-send-btn:hover {
    transform: scale(1.05);
    background-color: var(--primary-light);
}

/* Contact Zalo & Telegram box */
.chat-contact-box {
    margin-top: 10px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}

.chat-contact-btn.zalo {
    background-color: #0068ff;
    color: #ffffff;
}

.chat-contact-btn.zalo:hover {
    background-color: #0056d6;
}

.chat-contact-btn.telegram {
    background-color: #229ED9;
    color: #ffffff;
}

.chat-contact-btn.telegram:hover {
    background-color: #1c82b2;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

/* Mobile responsive for chatbox */
@media (max-width: 480px) {
    .chatbot-panel {
        width: calc(100% - 32px);
        height: 400px;
        right: 16px;
        bottom: 90px;
    }
    .chatbot-widget-container {
        bottom: 16px;
        right: 16px;
    }
    .chatbot-bubble {
        max-width: 160px;
        font-size: 11px;
        padding: 8px 12px;
    }
    .chatbot-launcher {
        width: 55px;
        height: 55px;
    }
    .chatbot-launcher svg {
        width: 65px;
        height: 65px;
    }
}

/* Custom SVG Chatbot Animations */
.custom-chatbot-svg {
    width: 85px;
    height: 85px;
    display: block;
    animation: floatRobot 3s ease-in-out infinite;
}

@keyframes floatRobot {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.antenna-glow {
    animation: glowAntenna 1.5s ease-in-out infinite alternate;
}

@keyframes glowAntenna {
    0% {
        fill: #f59e0b;
        filter: drop-shadow(0 0 2px #f59e0b);
    }
    100% {
        fill: #fbbf24;
        filter: drop-shadow(0 0 8px #fbbf24);
    }
}

.chatbot-eye {
    animation: blinkEyes 4s ease-in-out infinite;
    transform-origin: 50% 41px;
}

@keyframes blinkEyes {
    0%, 96%, 100% {
        transform: scaleY(1);
    }
    98% {
        transform: scaleY(0.1);
    }
}

/* Purchase Success Warning Box Glow Animation */
@keyframes pulseBorder {
    0% {
        border-color: var(--danger-color);
        box-shadow: 0 4px 10px rgba(239, 68, 68, 0.05);
    }
    100% {
        border-color: rgba(239, 68, 68, 0.4);
        box-shadow: 0 4px 20px rgba(239, 68, 68, 0.25);
    }
}

/* Mobile responsive for footer */
@media (max-width: 480px) {
    .footer-section {
        margin-top: 35px;
        padding-bottom: 30px;
    }
    .footer-divider {
        margin-bottom: 18px;
    }
    .footer-links {
        flex-direction: column;
        gap: 8px;
    }
    .footer-link-dot {
        display: none;
    }
    .footer-tagline {
        font-size: 11px;
        max-width: 280px;
    }
}