/* Rewards Program - Frontend Styles */

/* Balance Card */
.rp-balance-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.rp-balance-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rp-balance-label {
    font-size: 14px;
    opacity: 0.85;
}

.rp-balance-points {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
}

/* Level Badge */
.rp-level-badge {
    text-align: center;
    min-width: 160px;
}

.rp-badge-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 8px;
}

.rp-level-name {
    display: block;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.rp-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.rp-progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.rp-progress-text {
    font-size: 12px;
    opacity: 0.85;
}

/* Referral Section */
.rp-referral-section {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.rp-referral-section h3 {
    margin-top: 0;
}

.rp-referral-link-box {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.rp-referral-link-box input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

.rp-copy-btn {
    white-space: nowrap;
}

.rp-referral-stats {
    margin-top: 12px;
    color: #666;
    font-size: 14px;
}

/* Rewards Grid */
.rp-rewards-grid,
.rp-earn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.rp-reward-card,
.rp-earn-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
}

.rp-reward-card:hover,
.rp-earn-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.rp-reward-icon,
.rp-earn-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 12px;
}

.rp-earn-icon-placeholder {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    background: #e5e7eb;
    border-radius: 50%;
}

.rp-reward-card h4,
.rp-earn-card h4 {
    margin: 0 0 8px;
    font-size: 16px;
}

.rp-reward-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
}

.rp-reward-cost {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 16px;
}

.rp-redeem-btn {
    background: #667eea !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 24px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    transition: background 0.2s !important;
}

.rp-redeem-btn:hover {
    background: #5a6fd6 !important;
}

.rp-redeem-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
}

.rp-points-input {
    margin-bottom: 12px;
}

.rp-points-input label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    color: #666;
}

.rp-points-input input {
    width: 120px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

/* Rewards Table */
.rp-rewards-table,
.rp-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.rp-rewards-table th,
.rp-rewards-table td,
.rp-history-table th,
.rp-history-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.rp-rewards-table th,
.rp-history-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
}

.rp-rewards-table code {
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
    letter-spacing: 1px;
}

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

.rp-status-badge.rp-status-active {
    background: #d4edda;
    color: #155724;
}

.rp-status-badge.rp-status-used {
    background: #e2e3e5;
    color: #383d41;
}

.rp-status-badge.rp-status-expired {
    background: #f8d7da;
    color: #721c24;
}

.rp-status-badge.rp-status-open {
    background: #fff3cd;
    color: #856404;
}

/* Points Colors */
.rp-points-earned {
    color: #28a745;
    font-weight: 600;
}

.rp-points-spent {
    color: #dc3545;
    font-weight: 600;
}

/* Cart Rewards */
.rp-cart-rewards {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.rp-cart-rewards h3 {
    margin-top: 0;
    font-size: 16px;
}

.rp-cart-rewards-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.rp-cart-reward-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.rp-cart-reward-name {
    font-weight: 500;
}

.rp-cart-reward-cost {
    color: #666;
    font-size: 13px;
}

.rp-apply-reward {
    font-size: 13px !important;
    padding: 6px 16px !important;
}

/* Levels */
.rp-levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.rp-level-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    position: relative;
}

.rp-level-card.rp-level-current {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.rp-level-badge-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-bottom: 12px;
}

.rp-level-card h4 {
    margin: 0 0 6px;
}

.rp-level-range {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}

.rp-current-badge {
    display: inline-block;
    margin-top: 8px;
    background: #667eea;
    color: #fff;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Product Page Points */
.rp-product-points {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 12px 0;
    padding: 8px 14px;
    background: #f0f4ff;
    border-radius: 6px;
    font-size: 14px;
    color: #4a5568;
}

.rp-product-points .rp-points-icon {
    font-size: 18px;
}

.rp-checkout-earn {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 12px 0;
    text-align: center;
    color: #166534;
    font-size: 14px;
}

/* Empty State */
.rp-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 15px;
}

/* Login Prompt */
.rp-login-prompt {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 24px;
}

.rp-login-prompt a {
    font-weight: 600;
    color: #667eea;
}

/* Sections */
.rp-my-account h2,
.rp-rewards-page h2 {
    margin-bottom: 24px;
}

.rp-my-account h3,
.rp-rewards-page h3 {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.rp-my-rewards-section,
.rp-history-section,
.rp-ways-to-earn,
.rp-available-rewards,
.rp-levels-section {
    margin-bottom: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .rp-balance-card {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .rp-balance-points {
        font-size: 36px;
    }

    .rp-rewards-grid,
    .rp-earn-grid {
        grid-template-columns: 1fr;
    }

    .rp-levels-grid {
        grid-template-columns: 1fr 1fr;
    }

    .rp-referral-link-box {
        flex-direction: column;
    }

    .rp-cart-reward-item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .rp-rewards-table,
    .rp-history-table {
        font-size: 13px;
    }

    .rp-rewards-table th,
    .rp-rewards-table td,
    .rp-history-table th,
    .rp-history-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .rp-levels-grid {
        grid-template-columns: 1fr;
    }
}
