/**
 * WC Points System - Frontend Styles
 * Estilos para el frontend en portugués de Portugal
 */

/* ============================================
   MI CUENTA - DASHBOARD DE PONTOS
   ============================================ */

.wcps-account-dashboard {
    margin: 20px 0;
}

/* Balance Card */
.wcps-balance-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.wcps-balance-card::before {
    content: "🎁";
    position: absolute;
    right: -20px;
    top: -20px;
    font-size: 120px;
    opacity: 0.1;
    transform: rotate(-15deg);
}

.wcps-balance-main {
    position: relative;
    z-index: 1;
}

.wcps-balance-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.wcps-balance-amount {
    margin: 15px 0;
}

.wcps-points-number {
    font-size: 48px;
    font-weight: bold;
    line-height: 1;
}

.wcps-points-label {
    font-size: 18px;
    margin-left: 10px;
    opacity: 0.9;
}

.wcps-balance-value {
    font-size: 16px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.wcps-pending-notice {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 20px;
    display: inline-block;
}

/* Statistics Grid */
.wcps-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.wcps-stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.wcps-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.wcps-stat-icon {
    font-size: 36px;
    margin-right: 15px;
}

.wcps-stat-content {
    flex: 1;
}

.wcps-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.wcps-stat-label {
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Como Funciona */
.wcps-how-it-works {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.wcps-how-it-works h3 {
    margin-top: 0;
    color: #333;
}

.wcps-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.wcps-info-item {
    display: flex;
    align-items: flex-start;
}

.wcps-info-icon {
    font-size: 32px;
    margin-right: 15px;
    flex-shrink: 0;
}

.wcps-info-item strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.wcps-info-item p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Transações Recentes */
.wcps-recent-transactions {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.wcps-recent-transactions h3 {
    margin-top: 0;
    color: #333;
}

.wcps-transactions-table {
    width: 100%;
    margin-top: 20px;
}

.wcps-transactions-table td {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.wcps-trans-date {
    color: #999;
    font-size: 14px;
}

.wcps-trans-desc {
    color: #333;
}

.wcps-trans-points {
    font-weight: bold;
    text-align: right;
}

.wcps-trans-points.positive {
    color: #28a745;
}

.wcps-trans-points.negative {
    color: #dc3545;
}

.wcps-view-all {
    margin-top: 20px;
    text-align: center;
}

/* Histórico Completo */
.wcps-history-page {
    margin: 20px 0;
}

.wcps-full-history {
    margin-top: 20px;
}

.wcps-full-history th {
    background: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.wcps-points-col {
    font-weight: bold;
}

.wcps-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.wcps-status-completed {
    background: #d4edda;
    color: #155724;
}

.wcps-status-pending {
    background: #fff3cd;
    color: #856404;
}

.wcps-status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* ============================================
   CHECKOUT - SEÇÃO DE PONTOS
   ============================================ */

#wcps-checkout-points {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
}

#wcps-checkout-points h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    color: #333;
}

#wcps-checkout-points .wcps-icon {
    font-size: 24px;
    margin-right: 10px;
}

.wcps-checkout-content {
    margin-top: 20px;
}

.wcps-points-info {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.wcps-balance {
    font-size: 16px;
    margin-bottom: 10px;
}

.wcps-balance strong {
    color: #667eea;
    font-size: 18px;
}

.wcps-value {
    color: #666;
    font-size: 14px;
    margin-left: 5px;
}

.wcps-help-text {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Toggle Switch */
.wcps-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 20px;
}

.wcps-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.wcps-toggle-label {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

/* Points Selector */
#wcps_points_slider_container {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    margin-top: 15px;
}

.wcps-points-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
}

.wcps-points-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

#wcps_points_slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e9ecef;
    border-radius: 3px;
    outline: none;
}

#wcps_points_slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

#wcps_points_slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#wcps_points_amount {
    width: 100px;
    padding: 8px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

.wcps-discount-preview {
    margin-top: 15px;
    padding: 10px;
    background: #d4edda;
    border-radius: 4px;
    color: #155724;
    font-weight: bold;
    text-align: center;
}

/* ============================================
   PRODUTOS - BADGES DE PONTOS
   ============================================ */

/* Shop Loop */
.wcps-product-points {
    margin: 8px 0;
}

.wcps-points-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Single Product */
.wcps-single-product-points {
    margin: 20px 0;
}

.wcps-points-message {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    border-left: 4px solid #667eea;
}

.wcps-points-message .wcps-icon {
    font-size: 24px;
    margin-right: 12px;
}

.wcps-points-message .wcps-text {
    flex: 1;
    color: #333;
}

.wcps-points-message strong {
    color: #667eea;
}

/* ============================================
   NAVEGAÇÃO - BALANCE
   ============================================ */

.wcps-nav-balance {
    background: #f8f9fa;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 6px;
    text-align: center;
}

.wcps-nav-label {
    color: #666;
    font-size: 13px;
    display: block;
    margin-bottom: 5px;
}

.wcps-nav-points {
    color: #667eea;
    font-size: 20px;
    font-weight: bold;
}

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 768px) {
    .wcps-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .wcps-info-grid {
        grid-template-columns: 1fr;
    }
    
    .wcps-points-number {
        font-size: 36px;
    }
    
    .wcps-stat-value {
        font-size: 20px;
    }
    
    .wcps-balance-card {
        padding: 20px;
    }
    
    #wcps_points_slider_container {
        padding: 15px;
    }
    
    .wcps-points-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    #wcps_points_amount {
        width: 100%;
    }
    
    /* Tabelas responsivas */
    .wcps-full-history thead {
        display: none;
    }
    
    .wcps-full-history tr {
        display: block;
        border: 1px solid #ddd;
        margin-bottom: 10px;
        padding: 10px;
    }
    
    .wcps-full-history td {
        display: block;
        text-align: left;
        padding: 5px 0;
    }
    
    .wcps-full-history td:before {
        content: attr(data-title);
        font-weight: bold;
        display: inline-block;
        width: 120px;
    }
}

/* ============================================
   ANIMAÇÕES
   ============================================ */

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.wcps-points-badge:hover {
    animation: pulse 0.5s ease-in-out;
}

/* Botón activo */
.wcps-quick-btn.active {
    background: #667eea !important;
    color: #fff !important;
    transform: scale(1.05);
}

/* Botón de aplicar con éxito */
#wcps_apply_points.success {
    background: #28a745 !important;
}

/* Pulse effect para preview */
.wcps-discount-preview.pulse {
    animation: pulse 0.3s ease-in-out;
}

/* Transições suaves */
.wcps-stat-card,
.wcps-points-message,
#wcps_points_slider_container,
#wcps_points_container,
.button {
    transition: all 0.3s ease;
}

/* Loading state */
.wcps-loading {
    opacity: 0.5;
    pointer-events: none;
}

.wcps-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}