/* ============================================
   REFERRAL.CSS - Complete Referral Page Styles
   Royal Blue Theme | Professional Design
   ============================================ */

/* ===== Hero Section ===== */
.referral-hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 24px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
}

.referral-hero-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.referral-hero-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.referral-hero-title {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0 0 4px 0;
}

.referral-hero-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.referral-hero-stats {
    display: flex;
    gap: 24px;
}

.hero-stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 20px;
    border-radius: 16px;
    min-width: 100px;
}

.hero-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.hero-stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== Stats Grid 2x2 Layout ===== */
.stats-grid-2x2 {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-card-modern {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card-modern:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card-info {
    flex: 1;
}

.stat-card-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-card-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== Referral Link Card ===== */
.referral-link-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
    color: white;
}

.referral-link-content {
    max-width: 800px;
    margin: 0 auto;
}

.referral-link-text {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.referral-link-icon {
    font-size: 32px;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.referral-link-title {
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin: 0 0 4px 0;
}

.referral-link-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.referral-link-box {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.referral-link-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    color: white;
    font-weight: 500;
}

.referral-link-input:focus {
    outline: none;
    border-color: white;
    background: rgba(255, 255, 255, 0.2);
}

.referral-copy-btn {
    background: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.referral-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.referral-level-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.level-badge {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 40px;
    padding: 8px 16px;
    text-align: center;
    min-width: 80px;
}

.level-badge-number {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.level-badge-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== Locked Referral Card ===== */
.locked-referral-card {
    background: var(--bg-primary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 24px;
}

.locked-referral-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.locked-referral-header i {
    font-size: 20px;
}

.locked-referral-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.locked-badge {
    background: var(--warning-soft);
    color: var(--warning);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
}

/* ===== Level Tabs ===== */
.level-tabs-wrapper {
    padding: 20px;
}

.level-tabs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
}

.level-tab {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 30px;
}

.level-tab:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.level-tab.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.level-count {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    margin-left: 8px;
}

.level-panel {
    display: none;
}

.level-panel.active {
    display: block;
}

/* ===== Locked Stats Row ===== */
.locked-stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.locked-stat {
    flex: 1;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}

.locked-stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.locked-stat-value {
    font-size: 20px;
    font-weight: 700;
}

/* ===== Release Cards Grid ===== */
.locked-releases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.release-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.release-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.release-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.release-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.release-user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
}

.release-user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.release-plan {
    font-size: 11px;
    color: var(--text-muted);
}

.release-percentage {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.release-amounts {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.release-amount {
    flex: 1;
    text-align: center;
}

.release-amount span {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.release-amount strong {
    font-size: 16px;
}

.release-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.progress-bar-wrapper {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.release-timer {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 8px 12px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.release-timer i {
    margin-right: 6px;
    color: var(--warning);
}

/* ===== Profit Sharing Card ===== */
.profit-sharing-card {
    background: var(--bg-primary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 24px;
}

.profit-sharing-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.profit-sharing-header i {
    font-size: 20px;
}

.profit-sharing-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.profit-stats-row {
    display: flex;
    gap: 16px;
    padding: 20px;
    flex-wrap: wrap;
}

.profit-stat {
    flex: 1;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.profit-stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.profit-stat-value {
    font-size: 24px;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.profit-stat-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Recent Earnings ===== */
.recent-earnings {
    padding: 0 20px 20px 20px;
}

.recent-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.recent-item:hover {
    transform: translateX(4px);
    background: var(--bg-tertiary);
}

.recent-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
}

.recent-info {
    flex: 1;
}

.recent-user {
    font-weight: 600;
    color: var(--text-primary);
}

.recent-plan {
    font-size: 11px;
    color: var(--text-muted);
}

.recent-amount {
    font-weight: 700;
    font-size: 14px;
}

.recent-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Recent Transactions Card ===== */
.recent-transactions-card {
    background: var(--bg-primary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 24px;
}

.transactions-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.transactions-header i {
    font-size: 20px;
}

.transactions-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.view-all-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.view-all-link:hover {
    gap: 10px;
}

.transactions-list {
    padding: 0 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.transaction-item:hover {
    transform: translateX(4px);
    background: var(--bg-tertiary);
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.transaction-info {
    flex: 1;
}

.transaction-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.transaction-details {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.transaction-id {
    font-family: monospace;
}

.transaction-amount {
    font-weight: 700;
    font-size: 14px;
}

/* ===== Commission Card ===== */
.commission-card {
    background: var(--bg-primary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 24px;
}

.commission-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.commission-header i {
    font-size: 20px;
}

.commission-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.commission-table-wrapper {
    overflow-x: auto;
}

.commission-table {
    width: 100%;
    border-collapse: collapse;
}

.commission-table th {
    padding: 14px 16px;
    background: var(--bg-secondary);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.commission-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.percentage-badge {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.members-count {
    font-weight: 600;
}

.members-count.active {
    color: var(--success);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: var(--success-soft);
    color: var(--success);
}

.status-badge.inactive {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* ===== Top Referrers Card ===== */
.top-referrers-card {
    background: var(--bg-primary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 24px;
}

.top-referrers-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-referrers-header i {
    font-size: 20px;
}

.top-referrers-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.top-referrers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
}

.top-referrer-item {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.top-referrer-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.top-referrer-rank {
    font-size: 32px;
    margin-bottom: 12px;
}

.top-referrer-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.top-referrer-count {
    display: inline-block;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
}

/* ===== Team Members Card ===== */
.team-members-card {
    background: var(--bg-primary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.team-members-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-members-header i {
    font-size: 20px;
}

.team-members-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.members-table-wrapper {
    overflow-x: auto;
}

.members-table {
    width: 100%;
    border-collapse: collapse;
}

.members-table th {
    padding: 12px 16px;
    background: var(--bg-secondary);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.members-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: block;
}

.empty-state h5 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* ===== Dark Theme ===== */
.dark-theme .stat-card-modern,
.dark-theme .locked-referral-card,
.dark-theme .profit-sharing-card,
.dark-theme .recent-transactions-card,
.dark-theme .commission-card,
.dark-theme .top-referrers-card,
.dark-theme .team-members-card {
    background: var(--dark-bg-secondary);
}

.dark-theme .commission-table th,
.dark-theme .members-table th {
    background: var(--dark-bg-tertiary);
}

.dark-theme .release-card,
.dark-theme .recent-item,
.dark-theme .transaction-item,
.dark-theme .locked-stat,
.dark-theme .profit-stat {
    background: var(--dark-bg-tertiary);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .referral-hero {
        flex-direction: column;
        text-align: center;
    }
    
    .referral-hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .referral-hero-stats {
        width: 100%;
        justify-content: center;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .referral-link-text {
        flex-direction: column;
        text-align: center;
    }
    
    .referral-link-box {
        flex-direction: column;
    }
    
    .referral-copy-btn {
        justify-content: center;
    }
    
    .locked-releases-grid {
        grid-template-columns: 1fr;
    }
    
    .profit-stats-row {
        flex-direction: column;
    }
    
    .top-referrers-grid {
        grid-template-columns: 1fr;
    }
    
    .level-tabs-list {
        justify-content: center;
    }
    
    .level-tab {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .hero-stat {
        min-width: 70px;
        padding: 8px 12px;
    }
    
    .hero-stat-value {
        font-size: 18px;
    }
    
    .stat-card-modern {
        padding: 16px;
    }
    
    .stat-card-value {
        font-size: 18px;
    }
    
    .transaction-amount {
        width: 100%;
        text-align: right;
        margin-top: 8px;
    }
}
/* ===== Locked Stats Container ===== */
.locked-stats-container {
    background: var(--bg-primary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 24px;
}

.locked-stats-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.locked-stats-header i {
    font-size: 20px;
}

.locked-stats-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.locked-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px;
}

.locked-stat-item {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.locked-stat-item:hover {
    transform: translateY(-2px);
}

.locked-stat-item .locked-stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.locked-stat-item .locked-stat-value {
    font-size: 24px;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.locked-stat-item .locked-stat-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Profit Tabs ===== */
.profit-tabs-wrapper {
    padding: 20px;
}

.profit-tabs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
}

.profit-tab {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 30px;
}

.profit-tab:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.profit-tab.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.profit-panel {
    display: none;
}

.profit-panel.active {
    display: block;
}

@media (max-width: 992px) {
    .locked-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .locked-stats-grid {
        grid-template-columns: 1fr;
    }
}/* ===== Stats Grid 2x2 Alternative ===== */
.stats-grid-2x2-alt {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.stats-row-alt {
    display: flex;
    gap: 16px;
    width: 100%;
}

.stats-row-alt .stat-card-modern {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-row-alt {
        flex-direction: column;
    }
}