// Refer-a-Friend Plugin Styles
// ==========================================================================

// Members Tab
// --------------------------------------------------------------------------

.referralsPage {
    .referralsHeader {
        margin-bottom: 30px;

        h1 {
            margin-bottom: 10px;
        }

        p {
            color: var(--text_color_lighter);
            .rems(15);
        }
    }
}

// Share Component
// --------------------------------------------------------------------------

.referralShare {
    background: var(--light_color);
    border-radius: var(--border_radius);
    padding: 24px;
    margin-bottom: 30px;

    h4 {
        margin-bottom: 12px;
        .rems(15);
    }
}

.referralLinkCopy {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;

    input {
        flex: 1;
        background: #fff;
    }
}

.referralSocialButtons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.socialButton {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--border_radius);
    .rems(13);
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;

    &:hover {
        opacity: 0.85;
        color: #fff;
    }

    i {
        .rems(16);
    }
}

.socialWhatsapp {
    background-color: #25D366;
}

.socialFacebook {
    background-color: #1877F2;
}

.socialTwitter {
    background-color: #000;
}

.referralEmailForm {
    .referralEmailInput {
        display: flex;
        gap: 10px;

        input {
            flex: 1;
        }
    }
}

.referralMessage {
    margin-top: 8px;
    .rems(13);

    &.success {
        color: var(--success_color);
    }

    &.error {
        color: var(--alert_color);
    }
}

// Stats Cards
// --------------------------------------------------------------------------

.referralStatsCards {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.referralStatCard {
    flex: 1;
    min-width: 140px;
    background: var(--light_color);
    border-radius: var(--border_radius);
    padding: 20px;
    text-align: center;

    .statValue {
        display: block;
        .rems(28);
        font-weight: 700;
        color: var(--primary_color);
        line-height: 1.2;
    }

    .statLabel {
        display: block;
        .rems(13);
        color: var(--text_color_lighter);
        margin-top: 4px;
    }
}

// Rewards List
// --------------------------------------------------------------------------

.referralRewards {
    margin-bottom: 30px;

    h3 {
        margin-bottom: 16px;
    }
}

.rewardItem {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--light_color);
    border-radius: var(--border_radius);
    margin-bottom: 8px;

    .rewardInfo {
        .rewardAmount {
            font-weight: 700;
            .rems(16);
            display: block;
        }

        .rewardExpiry {
            .rems(12);
            color: var(--text_color_lighter);
        }
    }

    .rewardCode {
        .codeDisplay {
            font-family: monospace;
            .rems(14);
            font-weight: 600;
            letter-spacing: 1px;
        }
    }
}

// Invitations Table
// --------------------------------------------------------------------------

.referralInvitations {
    margin-top: 30px;

    h3 {
        margin-bottom: 16px;
    }
}

.invitationList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invitationCard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: var(--light_color);
    border-radius: var(--border_radius);
    transition: box-shadow 0.15s ease;

    &:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .invitationMain {
        display: flex;
        align-items: center;
        gap: 16px;
        flex: 1;
        min-width: 0;
    }

    .invitationEmail {
        font-weight: 600;
        .rems(14);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }

    .invitationMeta {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-left: auto;
        flex-shrink: 0;
    }

    .invitationDate {
        .rems(13);
        color: var(--text_color_lighter);
        white-space: nowrap;
    }

    .buttonLink {
        .rems(13);
        font-weight: 600;
        color: var(--primary_color);
        background: none;
        border: none;
        cursor: pointer;
        padding: 6px 12px;
        border-radius: var(--border_radius);
        white-space: nowrap;
        transition: background 0.15s ease;

        &:hover {
            background: rgba(0, 0, 0, 0.04);
        }

        &:disabled {
            opacity: 0.6;
            cursor: default;
        }
    }
}

.statusBadge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    .rems(12);
    font-weight: 600;
    text-transform: capitalize;
}

.status-pending {
    background: #FFF3CD;
    color: #856404;
}

.status-signed_up {
    background: #D1ECF1;
    color: #0C5460;
}

.status-rewarded {
    background: #D4EDDA;
    color: #155724;
}

.status-expired,
.status-cancelled {
    background: #F8D7DA;
    color: #721C24;
}

.reminderSent {
    color: var(--text_color_lighter);
    .rems(13);
    font-style: italic;
}

// Landing Page
// --------------------------------------------------------------------------

.referralLanding {
    .referralHero {
        text-align: center;
        padding: 60px 20px;
        background: var(--light_color);
        border-radius: var(--border_radius);
        margin-bottom: 40px;

        h1 {
            .rems(32);
            margin-bottom: 16px;
        }

        p {
            .rems(18);
            color: var(--text_color_lighter);
            max-width: 600px;
            margin: 0 auto 24px;
        }
    }

    .referralHowItWorks {
        margin-bottom: 40px;

        h2 {
            text-align: center;
            margin-bottom: 30px;
        }
    }

    .referralSteps {
        display: flex;
        gap: 24px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .referralStep {
        flex: 1;
        min-width: 200px;
        max-width: 280px;
        text-align: center;
        padding: 24px;

        .stepNumber {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: var(--primary_color);
            color: #fff;
            .rems(20);
            font-weight: 700;
            margin-bottom: 16px;
        }

        h3 {
            margin-bottom: 8px;
            .rems(16);
        }

        p {
            .rems(14);
            color: var(--text_color_lighter);
        }
    }

    .referralFaq {
        max-width: 700px;
        margin: 0 auto 40px;

        h2 {
            text-align: center;
            margin-bottom: 24px;
        }
    }

    .faqItem {
        border-bottom: 1px solid var(--border_color);
        padding: 16px 0;

        .faqQuestion {
            font-weight: 600;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;

            &::after {
                content: '+';
                .rems(20);
                transition: transform 0.2s;
            }

            &.active::after {
                content: '−';
            }
        }

        .faqAnswer {
            display: none;
            padding-top: 12px;
            color: var(--text_color_lighter);
            .rems(14);
            line-height: 1.6;

            &.active {
                display: block;
            }
        }
    }
}

// Order Complete Prompt
// --------------------------------------------------------------------------

.referralOrderPrompt {
    text-align: center;
    padding: 30px 20px;
    margin: 20px 0;
    background: var(--light_color);
    border-radius: var(--border_radius);

    h5 {
        margin-bottom: 8px;
    }

    p {
        color: var(--text_color_lighter);
        margin-bottom: 16px;
        .rems(14);
    }
}

// Responsive
// --------------------------------------------------------------------------

@media (max-width: 768px) {
    .referralLinkCopy,
    .referralEmailForm .referralEmailInput {
        flex-direction: column;
    }

    .referralStatsCards {
        flex-direction: column;
    }

    .referralLanding .referralSteps {
        flex-direction: column;
        align-items: center;
    }

    .invitationCard {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;

        .invitationMain {
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
            width: 100%;
        }

        .invitationMeta {
            margin-left: 0;
        }

        .buttonLink {
            align-self: flex-start;
            padding-left: 0;
        }
    }
}
