/**
 * Lina Loyalty - Frontend Styles
 */

/* Dashboard Container */
.lina-loyalty-dashboard {
    max-width: 800px;
}

/* Header with tier and points */
.lina-loyalty-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    margin-bottom: 20px;
    color: #fff;
}

.lina-loyalty-tier-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1em;
}

.lina-loyalty-tier-badge.tier-bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
}

.lina-loyalty-tier-badge.tier-silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #808080 100%);
}

.lina-loyalty-tier-badge.tier-gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a2e;
}

.lina-loyalty-tier-badge.tier-vip {
    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
}

.tier-emoji {
    font-size: 1.5em;
}

.lina-loyalty-points {
    text-align: right;
}

.lina-loyalty-points .points-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
}

.lina-loyalty-points .points-label {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Progress bar */
.lina-loyalty-progress {
    background: #f5f5f5;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.lina-loyalty-progress p {
    margin: 0 0 10px;
    font-size: 0.9em;
    color: #666;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B5CF6 0%, #6D28D9 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Referral section */
.lina-loyalty-referral {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.lina-loyalty-referral h3 {
    margin: 0 0 15px;
    font-size: 1.1em;
}

.referral-code {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.referral-code code {
    padding: 10px 20px;
    background: #1a1a2e;
    color: #fff;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 6px;
    letter-spacing: 2px;
}

.referral-code .copy-code {
    padding: 10px 20px;
    background: #8B5CF6;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.referral-code .copy-code:hover {
    background: #6D28D9;
}

.referral-info {
    margin: 0;
    font-size: 0.85em;
    color: #666;
}

/* Rewards grid */
.lina-loyalty-rewards {
    margin-bottom: 30px;
}

.lina-loyalty-rewards h3 {
    margin-bottom: 15px;
}

.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.reward-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.reward-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.reward-card.locked {
    opacity: 0.7;
    background: #f9fafb;
}

.reward-card.can-redeem {
    border-color: #8B5CF6;
}

.reward-info h4 {
    margin: 0 0 8px;
    font-size: 1em;
}

.reward-info p {
    margin: 0 0 10px;
    font-size: 0.85em;
    color: #666;
}

.reward-points {
    display: inline-block;
    padding: 4px 10px;
    background: #f3f4f6;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 500;
    color: #374151;
}

.redeem-reward {
    margin-top: 15px;
    padding: 10px;
    background: #8B5CF6;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.redeem-reward:hover {
    background: #6D28D9;
}

.points-needed {
    display: block;
    margin-top: 15px;
    text-align: center;
    font-size: 0.85em;
    color: #9ca3af;
}

/* Transaction history */
.lina-loyalty-history {
    margin-bottom: 30px;
}

.lina-loyalty-history h3 {
    margin-bottom: 15px;
}

.lina-loyalty-history .shop_table {
    width: 100%;
}

.lina-loyalty-history .shop_table th {
    text-align: left;
    padding: 10px;
    background: #f9fafb;
    font-weight: 600;
}

.lina-loyalty-history .shop_table td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.lina-loyalty-history .positive {
    color: #10B981;
    font-weight: 600;
}

.lina-loyalty-history .negative {
    color: #EF4444;
    font-weight: 600;
}

/* Stats section */
.lina-loyalty-stats {
    padding: 15px 20px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 0.9em;
    color: #666;
}

/* Dashboard badge (shown in account dashboard) */
.lina-loyalty-dashboard-badge {
    display: inline-block;
    margin: 10px 0;
}

.lina-loyalty-dashboard-badge a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: transform 0.2s;
}

.lina-loyalty-dashboard-badge a:hover {
    transform: scale(1.02);
}

.lina-loyalty-dashboard-badge .badge-tier {
    font-weight: 600;
}

.lina-loyalty-dashboard-badge .badge-points {
    padding: 4px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 15px;
    font-size: 0.9em;
}

/* Loading state */
.lina-loyalty-loading {
    text-align: center;
    padding: 40px;
}

.lina-loyalty-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #8B5CF6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
    .lina-loyalty-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .lina-loyalty-points {
        text-align: center;
    }

    .referral-code {
        flex-direction: column;
    }

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