/* ============================================
   WC Referral Program — Frontend Styles
   ============================================ */

/* Dashboard Cards */
.rpm-dashboard {
    max-width: 800px;
}

.rpm-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.rpm-card h3 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* Status Grid */
.rpm-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.rpm-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rpm-stat-label {
    font-size: 13px;
    color: #666;
}

.rpm-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Level Badge */
.rpm-level-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px !important;
}

.rpm-level-1 {
    background: #e8f5e9;
    color: #2e7d32;
}

.rpm-level-3 {
    background: #fff3e0;
    color: #e65100;
}

/* Progress Bar */
.rpm-progress-section {
    margin-top: 8px;
}

.rpm-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}

.rpm-progress-bar {
    height: 12px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}

.rpm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9800, #f57c00);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.rpm-progress-hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* QR Code & Referral */
.rpm-referral-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.rpm-qr-wrapper {
    flex-shrink: 0;
}

.rpm-qr-container {
    position: relative;
}

#rpm-qrcode {
    width: 160px;
    height: 160px;
}

#rpm-qrcode canvas,
#rpm-qrcode img {
    width: 160px !important;
    height: 160px !important;
}

.rpm-qr-watermark {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    pointer-events: none;
}

.rpm-download-qr-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    text-align: center;
    font-size: 13px !important;
    padding: 6px 0 !important;
}

.rpm-referral-info {
    flex: 1;
}

.rpm-referral-info label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.rpm-referral-link-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.rpm-referral-link-group input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: #f9f9f9;
}

.rpm-copy-btn {
    white-space: nowrap;
    padding: 8px 16px !important;
}

.rpm-copy-btn.copied {
    background: #4caf50 !important;
    color: #fff !important;
    border-color: #4caf50 !important;
}

.rpm-quota-info {
    font-size: 13px;
    color: #666;
    margin: 4px 0;
}

.rpm-rate-info {
    font-size: 14px;
    font-weight: 600;
    color: #e65100;
    margin: 4px 0;
}

/* Tables */
.rpm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.rpm-table th,
.rpm-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.rpm-table th {
    font-weight: 600;
    color: #555;
    background: #fafafa;
}

.rpm-table tbody tr:hover {
    background: #f5f5f5;
}

/* Status Badges */
.rpm-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.rpm-status-pending {
    background: #fff3e0;
    color: #e65100;
}

.rpm-status-settled {
    background: #e8f5e9;
    color: #2e7d32;
}

.rpm-status-cancelled {
    background: #ffebee;
    color: #c62828;
}

.rpm-status-paid {
    background: #e3f2fd;
    color: #1565c0;
}

.rpm-status-hold {
    background: #f3e5f5;
    color: #6a1b9a;
}

/* Bank Account Form */
.rpm-bank-card {
    background: #fffdf7;
}

.rpm-bank-hint {
    font-size: 13px;
    color: #666;
    margin: 0 0 16px;
}

.rpm-bank-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rpm-bank-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.rpm-bank-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}

.rpm-bank-field input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
}

.rpm-bank-field input:focus {
    border-color: #f57c00;
    outline: none;
    box-shadow: 0 0 0 2px rgba(245, 124, 0, 0.15);
}

.rpm-bank-form button[type="submit"] {
    align-self: flex-start;
    padding: 8px 20px;
    background: #f57c00;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.rpm-bank-form button[type="submit"]:hover {
    background: #e65100;
}

.rpm-bank-saved {
    color: #2e7d32;
    font-size: 13px;
    font-weight: 500;
    margin-left: 8px;
}

/* Pre-promoter Hint */
.rpm-pre-promoter-hint {
    font-size: 13px;
    color: #f57c00;
    background: #fff8e1;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #f57c00;
    margin: 8px 0 0;
}

/* Quota Full Notice */
.rpm-notice-full {
    font-size: 14px;
    color: #999;
    padding: 16px;
    background: #f5f5f5;
    border-radius: 4px;
    text-align: center;
}

/* Floating Widget */
.rpm-floating-widget {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.rpm-floating-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s;
    text-decoration: none;
}

.rpm-floating-toggle:hover {
    transform: scale(1.05);
}

.rpm-floating-icon {
    font-size: 24px;
}

.rpm-floating-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #d32f2f;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.rpm-floating-panel {
    position: absolute;
    bottom: 64px;
    right: 0;
    width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.rpm-floating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f57c00;
    color: #fff;
}

.rpm-floating-header strong {
    font-size: 15px;
}

.rpm-floating-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.rpm-floating-body {
    padding: 16px;
    text-align: center;
}

.rpm-floating-qr {
    display: inline-block;
    margin-bottom: 8px;
}

.rpm-floating-watermark {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.rpm-floating-hint {
    font-size: 13px;
    color: #555;
    margin: 0;
}

.rpm-floating-full p {
    color: #999;
    font-size: 14px;
}

.rpm-full .rpm-floating-toggle {
    background: linear-gradient(135deg, #bdbdbd, #9e9e9e);
}

.rpm-full .rpm-floating-qr {
    filter: grayscale(100%);
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 600px) {
    .rpm-status-grid {
        grid-template-columns: 1fr;
    }

    .rpm-referral-layout {
        flex-direction: column;
        align-items: center;
    }

    .rpm-referral-info {
        width: 100%;
    }

    .rpm-referral-link-group {
        flex-direction: column;
    }

    .rpm-bank-fields {
        grid-template-columns: 1fr;
    }

    .rpm-floating-panel {
        width: 260px;
        right: -10px;
    }
}
