/* ============================================================
   TOP5T AUTH — Module CSS Dung Chung Cho Trang Mua Dich Vu (trang/mua-dich-vu/*)
   Nạp tự động qua $moduleCssPath từ header.php
   ============================================================ */

/* Main Container */
.store-page-main {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 64px - 100px);
    padding: 40px 24px 80px;
    position: relative;
    z-index: 1;
}

.store-container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header Card */
.store-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: border-color 0.2s ease;
    flex-wrap: wrap;
}

.store-header-card:hover {
    border-color: var(--border-hover);
}

.store-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.store-header-card .header-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 24px;
    flex-shrink: 0;
}

.store-header-card .header-text h1 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    letter-spacing: -0.3px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.store-header-card .header-text p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* User Balance Display */
.user-balance-badge {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    flex-shrink: 0;
}

.user-balance-badge .balance-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.user-balance-badge .balance-amount {
    color: #10b981;
    font-weight: 700;
    font-size: 15px;
}

/* Purchase Confirmation Modal & Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 480px;
    margin: 0 20px;
    text-align: left;
    transform: scale(0.95);
    transition: transform 0.2s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.update-profile-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.update-profile-btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.update-profile-btn-group .btn {
    padding: 10px 16px;
    font-size: 13px;
    border-radius: var(--radius-md);
}

.confirm-item-details {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.confirm-row .label {
    color: var(--text-secondary);
}

.confirm-row .value {
    color: var(--text-primary);
    font-weight: 600;
}

.confirm-row .value.price {
    color: #10b981;
    font-size: 15px;
    font-weight: 700;
}

/* Buttons */
.btn {
    flex: 1;
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    position: relative;
    letter-spacing: 0.2px;
}

.btn-primary {
    background: var(--btn-solid-bg);
    color: var(--btn-solid-text);
    border: 1px solid var(--btn-solid-bg);
}

.btn-primary:hover {
    background: var(--btn-solid-bg-hover);
    color: var(--btn-solid-text-hover);
    border-color: var(--text-primary);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-hover);
}

/* Alerts & Spinners */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.alert-error {
    background: rgba(238, 0, 0, 0.05);
    border: 1px solid rgba(238, 0, 0, 0.15);
    color: var(--error);
}

.alert-success {
    background: rgba(0, 112, 243, 0.05);
    border: 1px solid rgba(0, 112, 243, 0.15);
    color: var(--success);
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(127, 127, 127, 0.25);
    border-top: 2px solid var(--btn-solid-text);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Read More & Detail Links */
.btn-read-more {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    padding: 0;
    margin-left: 4px;
    text-decoration: underline;
    transition: opacity 0.15s ease;
}

.btn-read-more:hover {
    opacity: 0.8;
}

.btn-view-detail-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    transition: color 0.15s ease;
}

.btn-view-detail-link:hover {
    color: var(--text-primary);
}

/* Card Layout System (Chuẩn hóa cho Gói Dịch Vụ và Gói VIP) */
.feature-buy-card,
.vip-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.feature-buy-card:hover,
.vip-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-surface-hover);
}

.vip-card.featured {
    border: 1.5px solid var(--accent);
}

.featured-badge {
    position: absolute;
    top: -10px;
    right: 14px;
    background: var(--accent);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 112, 243, 0.25);
    z-index: 2;
}

.card-top-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-header-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.card-icon-box {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.card-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex-grow: 1;
}

.card-title-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.card-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    width: fit-content;
}

.card-type-badge.forever {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.card-type-badge.days {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.card-type-badge.usage {
    background: rgba(0, 112, 243, 0.1);
    color: var(--accent);
    border: 1px solid rgba(0, 112, 243, 0.2);
}

.card-type-badge.vip {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.card-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.card-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px dashed var(--border-color);
    gap: 10px;
}

.card-price-display {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    color: #10b981;
    white-space: nowrap;
}

.card-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-card-action {
    padding: 7px 12px;
    font-size: 12px;
    border-radius: var(--radius-md);
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 576px) {
    .store-header-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .user-balance-badge {
        width: 100%;
        justify-content: space-between;
    }

    .card-footer-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .card-actions-group {
        width: 100%;
    }

    .card-actions-group .btn {
        flex: 1;
    }
}

/* Success & Auth Modal Custom Styling */
.success-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.success-icon-badge {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    animation: successBadgePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes successBadgePop {
    0% { transform: scale(0.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.success-modal-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.success-modal-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.receipt-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.receipt-row .label {
    color: var(--text-secondary);
}

.receipt-row .val {
    font-weight: 600;
    color: var(--text-primary);
}

.receipt-row .val.highlight {
    color: #10b981;
    font-weight: 700;
}

.auth-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: rgba(0, 112, 243, 0.1);
    border: 1px solid rgba(0, 112, 243, 0.3);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

