/* Refer Friends Modal Styles */
.refer-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.refer-modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.refer-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.btn-back-refer {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--bs-main);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.btn-back-refer:hover {
    background-color: #f0fdf4;
}

.btn-back-refer .back-icon {
    width: 20px;
    height: 20px;
}

.refer-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.header-spacer {
    width: 80px;
}

.refer-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Earn Banner */
.refer-earn-banner {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.earn-icon {
    width: 24px;
    height: 24px;
    color: var(--bs-main);
    flex-shrink: 0;
    margin-top: 2px;
}

.earn-content {
    flex: 1;
}

.earn-title {
    font-size: 18px;
    font-weight: 600;
    color: #166534;
    margin-bottom: 4px;
}

.earn-description {
    font-size: 14px;
    color: #15803d;
    line-height: 1.5;
}

/* Referral Link Section */
.refer-link-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.section-title-refer {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

.link-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.link-input {
    flex: 1;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px;
    background: #f9fafb;
    color: #111827;
    font-weight: 500;
}

.link-input:focus {
    outline: none;
    border-color: var(--bs-main);
    background: #ffffff;
}

.btn-copy-link,
.btn-download-qr {
    background: var(--bs-main);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-copy-link:hover {
    background: #15803d;
}

.btn-download-qr {
    background: #2563eb;
}

.btn-download-qr:hover {
    background: #1d4ed8;
}

.btn-icon-refer {
    width: 20px;
    height: 20px;
}

/* QR Code Section */
.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-section-title {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 12px;
}

.qr-code-container {
    background: #ffffff;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-bottom: 12px;
}

.qr-code-img {
    width: 128px;
    height: 128px;
    display: block;
}

/* Social Share Buttons */
.social-share-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.social-btn:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.social-btn svg {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

.facebook-btn {
    background: #1877f2;
}

.twitter-btn {
    background: #1da1f2;
}

.linkedin-btn {
    background: #0a66c2;
}

.whatsapp-btn {
    background: #25d366;
}

.instagram-btn {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.btn-download-qr-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2563eb;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.btn-download-qr-text:hover {
    background-color: #eff6ff;
}

.download-icon {
    width: 16px;
    height: 16px;
}

/* How it Works Section */
.how-it-works-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-item {
    display: flex;
    gap: 12px;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dcfce7;
    color: #166534;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
    flex: 1;
}

/* Referral History Section */
.referral-history-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.total-points-badge {
    background: #dcfce7;
    color: #166534;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 12px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.history-item {
    background: #ffffff;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-item-info {
    flex: 1;
}

.history-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 2px;
}

.history-date {
    font-size: 12px;
    color: #6b7280;
}

.history-points {
    font-size: 14px;
    font-weight: 600;
    color: var(--bs-main);
}

.history-loading {
    background: #ffffff;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.history-loading p {
    font-size: 14px;
    color: #6b7280;
}

.history-empty {
    background: #ffffff;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.empty-icon-small {
    width: 48px;
    height: 48px;
    color: #d1d5db;
    margin-bottom: 12px;
}

.empty-text {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.empty-subtext {
    font-size: 14px;
    color: #6b7280;
}

.spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--bs-main);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .refer-modal-container {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .refer-modal-content {
        padding: 16px;
    }

    .refer-earn-banner {
        padding: 12px;
    }

    .earn-title {
        font-size: 16px;
    }

    .earn-description {
        font-size: 13px;
    }

    .refer-link-section,
    .how-it-works-section,
    .referral-history-section {
        padding: 16px;
    }

    .link-input-group {
        flex-wrap: wrap;
    }

    .link-input {
        width: 100%;
    }

    .social-share-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
}