﻿:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-body: #f1f5f9;
    --bg-modal-ref: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --tier-bg: #f8fafc;
    --success: #10b981;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --color-label: brown;
}

/* Modal Overlay */
.modal-ref-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: none; /* Ẩn mặc định */
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .modal-ref-overlay.active {
        display: flex;
        opacity: 1;
    }

/* Modal Container */
.modal-ref {
    background-color: var(--bg-modal-ref);
    width: 100%;
    max-width: 520px;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out forwards;
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.modal-ref-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-ref-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
}

    .modal-ref-title.active-codong {
        padding: 8px 18px;
        border-radius: 100px;
        letter-spacing: 0.03em;
        border: 1px solid;
        background: rgba(16, 185, 129, 0.12);
        border-color: rgba(16, 185, 129, 0.35);
        color: #34d399;
        margin: 0;
    }

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .btn-close:hover {
        background-color: #f1f5f9;
        color: var(--text-main);
    }

/* Modal Body */
.modal-ref-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Link Section */
.link-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-label);
}

.link-input-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px 6px 6px 16px;
    transition: border-color 0.2s ease;
}

    .link-input-wrapper:focus-within {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }


.link-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
}

    .btn-copy:hover {
        background-color: var(--primary-hover);
    }

/* Tiers Section */
.reward-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reward-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reward-header-icon {
    color: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef3c7;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.reward-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0px;
}

.tier-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tier-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: var(--tier-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: transform 0.2s, box-shadow 0.2s;
}

    .tier-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        border-color: #cbd5e1;
    }

    .tier-item.tier-current {
        box-shadow: orange 0px 0px 15px;
    }

.tier-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tier-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Different colors for different tiers */
.tier-item:nth-child(1) .tier-icon-wrapper {
    color: #3b82f6;
}

.tier-item:nth-child(2) .tier-icon-wrapper {
    color: #8b5cf6;
}

.tier-item:nth-child(3) .tier-icon-wrapper {
    color: #ef4444;
}

.tier-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tier-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.tier-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.tier-badge {
    background-color: #e0e7ff;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tier-item:nth-child(2) .tier-badge {
    background-color: #ede9fe;
    color: #7c3aed;
}

.tier-item:nth-child(3) .tier-badge {
    background-color: #fee2e2;
    color: #dc2626;
}


/* Nút Mở Modal để Demo */
.btn-trigger {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
    transition: all 0.2s ease;
    position: absolute; /* Đặt ở giữa màn hình */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

    .btn-trigger:hover {
        background-color: var(--primary-hover);
        transform: translate(-50%, -52%);
        box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    }

#qrcontainner {
    position: relative;
    width: 340px;
    height: 340px;
    margin: 0.25em auto;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

#qrcode-link {
    position: absolute;
    left: 50%;
    transform: translateX(-33%);
    width: 130px;
    height: 130px;
    bottom: 7.7rem;
    background-color: #fff;
}

@media (max-width: 768px) {
    #qrcode-link {
        bottom: 8.7rem;
    }
}

.ref-intro {
    text-align: center;
    color: var(--color-label);
}

    .ref-intro > p {
        margin-bottom: 5px;
    }

.fs-small {
    font-size: small;
}

.ref-header-wrapper {
    display: flex;
    gap: 25px;
}

.logo-cp {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.stage-noti {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.stage-noti-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: var(--tier-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: firebrick 0px 0px 15px;
}

    .stage-noti-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        border-color: #cbd5e1;
    }

.stage-noti-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stage-noti-item-info-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #ef4444
}

.stage-noti-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stage-noti-item-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.stage-noti-item-value {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary);
}

.stage-noti-item-badge {
    background-color: #fee2e2;
    color: #dc2626;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.text-align-center {
    text-align: center;
}

/* Responsive */
@media (max-width: 480px) {
    .modal-ref-body, .stage-noti {
        padding: 16px;
    }

    .tier-item, .stage-noti-item {
        padding: 12px;
    }

    .tier-label, .stage-noti-item-label {
        font-size: 0.75rem;
    }

    .tier-value, .stage-noti-item-value {
        font-size: 0.875rem;
    }

    .btn-copy span {
        display: none;
    }

    .btn-copy {
        padding: 8px;
    }
}
