/* Referral Page Styles */
.referral-hero {
    background: linear-gradient(180deg, var(--surface) 0%, var(--background) 100%);
    padding: 6rem 1rem 4rem;
    border-bottom: 1px solid var(--border);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 1.5rem auto 0;
}

.referral-dashboard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2.5rem;
    margin-top: -3rem;
    position: relative;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.dashboard-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.dashboard-header h2 {
    font-family: var(--font-header);
    font-size: 2rem;
    color: #fff;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.stat-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.stat-card.highlight {
    background: linear-gradient(145deg, var(--surface-alt) 0%, rgba(204, 255, 0, 0.1) 100%);
    border-color: rgba(204, 255, 0, 0.3);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    font-family: var(--font-header);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.link-section {
    background: var(--surface-alt);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

.link-section h3 {
    font-family: var(--font-header);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.link-section p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.link-box-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.referral-input {
    flex: 1;
    min-width: 200px;
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    font-family: monospace;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.3s;
}

.referral-input:focus {
    border-color: var(--primary);
}

.referral-details {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 2rem;
}

.referral-summary {
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: center;
}

.detail-note {
    color: var(--text-muted);
    font-size: 1rem;
}

.referral-table-container,
.commission-table-container {
    overflow-x: auto;
}

.commission-breakdown-section {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 2rem;
}

.commission-breakdown-section .section-title-wrap {
    margin-bottom: 1.5rem;
}

.tier-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.75rem;
    line-height: 1.5;
}

.referral-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.referral-table th,
.referral-table td {
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.referral-table th {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.referral-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.empty-state {
    margin-top: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.checks-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.check {
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.check.pass {
    background: rgba(76, 175, 80, 0.12);
    color: #4CAF50;
}

.check.fail {
    background: rgba(255, 77, 79, 0.08);
    color: #ff4d4f;
}

.fail-list {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.fail-reason {
    color: #ffb3b0;
}

.login-prompt {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface);
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.login-prompt h2 {
    font-family: var(--font-header);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.login-prompt p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Tiers */
.tiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.tier-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tier-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
    background: var(--surface-alt);
}

.tier-icon.bronze { color: #cd7f32; border: 2px solid #cd7f32; box-shadow: 0 0 15px rgba(205, 127, 50, 0.3); }
.tier-icon.silver { color: #c0c0c0; border: 2px solid #c0c0c0; box-shadow: 0 0 15px rgba(192, 192, 192, 0.3); }
.tier-icon.gold { color: #ffd700; border: 2px solid #ffd700; box-shadow: 0 0 15px rgba(255, 215, 0, 0.3); }

.tier-card h3 {
    font-family: var(--font-header);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.tier-commission {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.tier-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .referral-dashboard {
        padding: 1.5rem;
        margin-top: -2rem;
    }
    .link-box-container {
        flex-direction: column;
    }
    .link-box-container button {
        width: 100%;
    }
}
