/* muataikhoan.css - Trang Mua Tài Khoản */

/* ===========================================
   PAGE & LAYOUT
   =========================================== */

.muataikhoan-page {
    padding-bottom: 2rem;
}

.muataikhoan-title {
    color: #2d3748;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.muataikhoan-title i {
    color: #0d9488;
}

/* ===========================================
   LOADING OVERLAY
   =========================================== */

.muataikhoan-page .loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.muataikhoan-page .loading-content {
    text-align: center;
}

/* ===========================================
   FILTER CARD
   =========================================== */

.muataikhoan-page .card.mb-4:first-of-type .card-body {
    padding: 1rem 1.25rem;
}

.muataikhoan-page #filterCategory,
.muataikhoan-page #filterSearch {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.muataikhoan-page #btnFilter {
    border-radius: 8px;
    font-weight: 600;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.muataikhoan-page #btnFilter:hover {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

/* ===========================================
   PRODUCTS CONTAINER
   =========================================== */

.muataikhoan-page .products-container {
    margin-top: 0.5rem;
}

/* ===========================================
   DỊCH VỤ ĐÃ MUA (MY ORDERS)
   =========================================== */

.muataikhoan-my-orders-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    border: 1px solid #e2e8f0;
}

.muataikhoan-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.muataikhoan-section-title i {
    color: #0d9488;
}

.muataikhoan-my-orders-table {
    margin-bottom: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.muataikhoan-my-orders-table thead th {
    background: #f1f5f9;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
}

.muataikhoan-my-orders-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.muataikhoan-my-orders-table tbody tr:hover {
    background: #f8fafc;
}

/* Cột gộp: Sản phẩm · Gói · Số tiền · Email */
.muataikhoan-order-detail {
    min-width: 160px;
    max-width: 280px;
}
.muataikhoan-order-detail-line {
    line-height: 1.4;
}
.muataikhoan-order-detail-line + .muataikhoan-order-detail-line {
    margin-top: 0.2rem;
}
.muataikhoan-order-product {
    font-weight: 600;
    color: #1e293b;
}
.muataikhoan-order-pkg {
    font-weight: 500;
    color: #64748b;
    font-size: 0.9em;
}
.muataikhoan-order-amount {
    font-size: 0.95rem;
}
.muataikhoan-order-email {
    word-break: break-all;
}
.muataikhoan-order-id {
    white-space: nowrap;
}
.muataikhoan-order-status {
    white-space: nowrap;
}
.muataikhoan-order-date,
.muataikhoan-order-expires {
    white-space: nowrap;
    font-size: 0.875rem;
}
.muataikhoan-order-action .btn-renew-order {
    white-space: nowrap;
}

/* ===========================================
   CATEGORY HEADER
   =========================================== */

.muataikhoan-category-header {
    margin: 2rem 0 1rem 0;
    padding: 0.85rem 1.25rem;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.muataikhoan-category-header i {
    font-size: 1.2rem;
}

.muataikhoan-category-header:first-of-type {
    margin-top: 0;
}

/* ===========================================
   PRODUCT CARD
   =========================================== */

.muataikhoan-product-card {
    position: relative;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.muataikhoan-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0d9488 0%, #0f766e 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    z-index: 1;
}

.muataikhoan-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #0d9488;
}

.muataikhoan-product-card:hover::before {
    transform: scaleX(1);
}

.muataikhoan-product-card .card-body {
    padding: 1.25rem;
}

.muataikhoan-product-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.muataikhoan-product-card .card-text {
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 0.75rem;
}

.muataikhoan-product-img {
    height: 180px;
    object-fit: cover;
    background: #f1f5f9;
}

/* Các mức giá */
.muataikhoan-product-prices {
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
}

.muataikhoan-price-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    line-height: 1.3;
}

.muataikhoan-price-item:not(:last-child) {
    border-bottom: 1px dashed #e2e8f0;
}

.muataikhoan-price-duration {
    color: #475569;
    font-weight: 500;
}

.muataikhoan-price-value {
    font-weight: 700;
    color: #0d9488;
}

/* ===========================================
   BUTTON MUA
   =========================================== */

.muataikhoan-page .btn-mua-tk {
    width: 100%;
    padding: 0.65rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(13, 148, 136, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.muataikhoan-page .btn-mua-tk:hover {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(13, 148, 136, 0.4);
}

.muataikhoan-page .btn-outline-primary {
    width: 100%;
    padding: 0.65rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 10px;
    border: 2px solid #0d9488;
    color: #0d9488;
    background: transparent;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none;
}

.muataikhoan-page .btn-outline-primary:hover {
    background: #0d9488;
    color: white;
    border-color: #0d9488;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

/* ===========================================
   EMPTY STATE
   =========================================== */

.muataikhoan-page .products-container .text-center.text-muted.py-5 i {
    opacity: 0.6;
}

/* ===========================================
   TOAST FIXED (góc màn hình)
   =========================================== */

.muataikhoan-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: calc(100vw - 2rem);
}

.muataikhoan-toast {
    pointer-events: auto;
    min-width: 320px;
    max-width: 420px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s ease-out, opacity 0.35s ease-out;
}

.muataikhoan-toast.muataikhoan-toast-show {
    transform: translateX(0);
    opacity: 1;
}

.muataikhoan-toast-content {
    padding: 1rem 1.25rem;
}

.muataikhoan-toast-header {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.muataikhoan-toast-header i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.muataikhoan-toast-body {
    font-size: 0.9rem;
    line-height: 1.45;
    opacity: 0.95;
}

.muataikhoan-toast-success {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
}

.muataikhoan-toast-success .muataikhoan-toast-header i {
    color: rgba(255, 255, 255, 0.95);
}

.muataikhoan-toast-danger,
.muataikhoan-toast-error {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
}

.muataikhoan-toast-warning {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
}

.muataikhoan-toast-info {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: white;
}

/* ===========================================
   MODAL MUA TÀI KHOẢN
   =========================================== */

#modalBuyAccount .modal-dialog.modal-muataikhoan {
    max-width: 440px;
}

#modalBuyAccount .modal-header {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
    border-bottom: none;
    padding: 1.1rem 1.5rem;
}

#modalBuyAccount .modal-title {
    font-weight: 600;
    font-size: 1.15rem;
}

#modalBuyAccount .modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

#modalBuyAccount .modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

#modalBuyAccount .modal-body {
    padding: 1.5rem 1.75rem;
    background: #fafbfc;
}

.modal-buy-product-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-buy-section {
    margin-bottom: 1.25rem;
}

.modal-buy-section:last-of-type {
    margin-bottom: 0;
}

.modal-buy-label {
    font-weight: 600;
    color: #475569;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.modal-buy-input {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-buy-input:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.modal-buy-textarea {
    resize: vertical;
    min-height: 70px;
}

.modal-buy-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.35rem;
    display: block;
}

/* Radio thời hạn */
.buy-months-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.buy-months-radio-item {
    flex: 1 1 calc(50% - 0.3rem);
    min-width: 0;
    margin: 0;
    cursor: pointer;
    display: block;
}

.buy-months-radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.buy-months-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.buy-months-radio-item:hover .buy-months-label {
    border-color: #94a3b8;
}

.buy-months-radio-item input[type="radio"]:checked + .buy-months-label {
    border-color: #0d9488;
    background: rgba(13, 148, 136, 0.06);
    box-shadow: 0 0 0 1px #0d9488;
}

.buy-months-duration {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.buy-months-price {
    font-weight: 700;
    color: #0d9488;
    font-size: 0.95rem;
}

.modal-buy-price-display {
    margin-top: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f766e;
}

#modalBuyAccount .modal-footer {
    padding: 1.1rem 1.75rem;
    border-top: 1px solid #e2e8f0;
    background: white;
}

#modalBuyAccount .modal-btn-cancel {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
}

#modalBuyAccount .modal-btn-submit {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    border: none;
    font-weight: 600;
    padding: 0.65rem 1.35rem;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(13, 148, 136, 0.3);
}

#modalBuyAccount .modal-btn-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.4);
}

#modalBuyAccount .modal-btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===========================================
   ALERT
   =========================================== */

#muataikhoan-alert .alert {
    border-radius: 10px;
}

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 768px) {
    .muataikhoan-title {
        font-size: 1.5rem;
    }

    .muataikhoan-category-header {
        font-size: 0.95rem;
        padding: 0.75rem 1rem;
    }

    .muataikhoan-product-card .card-body {
        padding: 1rem;
    }

    .muataikhoan-product-card .card-title {
        font-size: 1rem;
    }

    .muataikhoan-product-img {
        height: 160px;
    }

    .muataikhoan-page .btn-mua-tk,
    .muataikhoan-page .btn-outline-primary {
        padding: 0.6rem 0.9rem;
        font-size: 0.9rem;
    }

    #modalBuyAccount .modal-body {
        padding: 1.25rem 1.35rem;
    }

    .buy-months-radio-item {
        flex: 1 1 100%;
    }

    /* Bảng dịch vụ đã mua: gọn hơn trên tablet/mobile */
    .muataikhoan-my-orders-section {
        padding: 1rem;
    }
    .muataikhoan-my-orders-table thead th {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }
    .muataikhoan-my-orders-table tbody td {
        padding: 0.5rem 0.6rem;
        font-size: 0.875rem;
    }
    .muataikhoan-order-detail {
        max-width: 200px;
    }
    .muataikhoan-order-product {
        font-size: 0.9rem;
    }
    .muataikhoan-order-action .btn-renew-order {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .muataikhoan-my-orders-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .muataikhoan-my-orders-table {
        font-size: 0.8125rem;
        min-width: 520px;
    }
    .muataikhoan-my-orders-table thead th {
        padding: 0.4rem 0.5rem;
    }
    .muataikhoan-my-orders-table tbody td {
        padding: 0.4rem 0.5rem;
    }
    .muataikhoan-order-detail {
        min-width: 120px;
        max-width: 180px;
    }
    .muataikhoan-order-product {
        font-size: 0.85rem;
    }
    .muataikhoan-order-email {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .muataikhoan-page .row.g-2.align-items-end .col-md-2 {
        margin-top: 0.25rem;
    }
}
