/**
 * TopSaver Club - Estilos para Página de Mis Tarjetas
 * Wallet-style cards y funcionalidades de fidelidad
 */

/* ===== HEADER ESPECÍFICO ===== */
.header-banner {
    background: linear-gradient(135deg, #8a4fff 0%, #6200ea 100%);
    color: white;
    padding: 50px 0 90px 0;
    position: relative;
    overflow: hidden;
}

/* .header-banner::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 30px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath d='M321.39 56.44c58-10.79 114.16-30.13 172-41.86 82.39-16.72 168.19-17.73 250.45-.39C823.78 31 906.67 72 985.66 92.83c70.05 18.48 146.53 26.09 214.34 3V0H0v27.35a600.21 600.21 0 00321.39 29.09z' fill='%23f8f9fa'/%3E%3C/svg%3E") center/cover no-repeat;
} */

/* ===== PANEL DE RESUMEN ===== */
.summary-panel {
    background: white;
    border-radius: 20px;
    padding: 10px;
    margin-top: -50px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.2);
    display: block;
}

.summary-item {
    padding: 20px 0;
    position: relative;
}

.summary-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
    background: linear-gradient(45deg, var(--primary-color), #8a4fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: counterPulse 2s ease-in-out infinite;
}

.summary-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, #dee2e6, transparent);
}

@keyframes counterPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===== TARJETAS DE FIDELIDAD (WALLET STYLE) ===== */
.loyalty-card-wrapper {
    perspective: 1000px;
    margin-bottom: 30px;
}

.loyalty-card {
    position: relative;
    height: 200px;
    border-radius: 20px;
    overflow: hidden;
    color: white;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    cursor: pointer;
    transform-style: preserve-3d;
    border: 2px solid rgba(255,255,255,0.1);
}

/* Fondo con imagen que hará zoom */
.card-bg {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
    z-index: 0;
    opacity: 1;
    filter: brightness(0.95) contrast(1.03);
}

/* Overlay con gradientes temáticos */
.card-overlay {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
    transition: opacity 0.3s ease;
}

.card-overlay[data-overlay-type="blue"] {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.4) 0%, rgba(13, 71, 161, 0.9) 100%);
}

.card-overlay[data-overlay-type="purple"] {
    background: linear-gradient(135deg, rgba(103, 58, 183, 0.4) 0%, rgba(49, 27, 146, 0.9) 100%);
}

.card-overlay[data-overlay-type="green"] {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.4) 0%, rgba(27, 94, 32, 0.9) 100%);
}

.card-overlay[data-overlay-type="orange"] {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.4) 0%, rgba(230, 81, 0, 0.9) 100%);
}

/* Efectos hover y animaciones */
.loyalty-card:hover {
    transform: translateY(-15px) rotateX(5deg);
    box-shadow: 0 25px 45px rgba(0,0,0,0.25);
}

.loyalty-card:hover .card-bg {
    transform: scale(1.1);
}

.loyalty-card:hover .card-overlay {
    opacity: 0.9;
}

/* Contenido de la tarjeta */
.card-content {
    position: relative;
    z-index: 2;
    padding: 25px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-logo {
    width: 55px;
    height: 55px;
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 8px;
    object-fit: contain;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.loyalty-card:hover .card-logo {
    transform: scale(1.1);
}

.points-badge {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.loyalty-card:hover .points-badge {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

/* Barra de progreso personalizada */
.progress-custom {
    height: 10px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 20px;
    overflow: hidden;
    margin-top: 12px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.progress-bar-custom {
    background: linear-gradient(90deg, #ffd700 0%, #ffed4a 100%);
    height: 100%;
    border-radius: 20px;
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar-custom::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Botones de acción en las tarjetas */
.card-action-btn {
    background: rgba(255,255,255,0.9);
    color: #333;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    cursor: pointer;
}

.card-action-btn:hover {
    background: #ffd700;
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 15px rgba(255, 215, 0, 0.4);
}

.card-action-btn:active {
    transform: scale(0.95);
}

/* Tipos específicos de tarjetas */
.loyalty-card[data-card-type="stamps"] .points-badge {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffd700;
}

.loyalty-card[data-card-type="membership"] .points-badge {
    background: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.loyalty-card[data-card-type="cashback"] .points-badge {
    background: rgba(23, 162, 184, 0.2);
    border-color: rgba(23, 162, 184, 0.3);
    color: #17a2b8;
}

/* ===== ACTIVIDAD RECIENTE ===== */
.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.list-group-item {
    border: none;
    padding: 16px 0;
    transition: background-color 0.3s ease;
}

.list-group-item:hover {
    background-color: rgba(98, 0, 234, 0.05);
}

/* ===== ESTADO VACÍO ===== */
.empty-state {
    padding: 60px 20px;
}

.empty-icon {
    font-size: 4rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ===== VISTA EN LISTA ===== */
.list-view .loyalty-card {
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
}

.list-view .card-bg {
    width: 120px;
    height: 80px;
    border-radius: 15px 0 0 15px;
    position: relative;
}

.list-view .card-overlay {
    border-radius: 15px 0 0 15px;
}

.list-view .card-content {
    padding: 20px 25px;
    flex-direction: row;
    align-items: center;
    color: var(--text-dark);
}

.list-view .card-logo {
    width: 40px;
    height: 40px;
    margin-right: 15px;
}

.list-view .points-badge {
    background: var(--primary-color);
    color: white;
    border: none;
    margin-left: auto;
}

/* ===== MODALES ===== */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px 20px 0 0;
}

#qrContainer {
    background: white;
    padding: 20px;
    border-radius: 15px;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ===== FILTROS Y CONTROLES ===== */
.dropdown-menu {
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: none;
    padding: 8px 0;
}

.dropdown-item {
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, var(--primary-color), #8a4fff);
    color: white;
    transform: translateX(5px);
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
    .header-banner {
        padding: 40px 0 70px 0;
    }
    
    .summary-panel {
        margin-top: -40px;
        padding: 20px;
        border-radius: 15px;
        display: block;
    }
    
    .summary-number {
        font-size: 2rem;
    }
    
    .summary-item:not(:last-child)::after {
        display: none;
    }
    
    .loyalty-card {
        height: 200px;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .card-logo {
        width: 45px;
        height: 45px;
    }
    
    .card-action-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 576px) {
    .header-banner {
        padding: 40px 0 40px 0;
    }

    .summary-panel {
        display: none;
    }

    .summary-panel .row {
        text-align: center;
    }
    
    .summary-item {
        margin-bottom: 20px;
    }
    
    .loyalty-card {
        height: 200px;
    }
    
    .points-badge {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* ===== ANIMACIONES ADICIONALES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loyalty-card-wrapper {
    animation: fadeInUp 0.6s ease forwards;
}

.loyalty-card-wrapper:nth-child(1) { animation-delay: 0.1s; }
.loyalty-card-wrapper:nth-child(2) { animation-delay: 0.2s; }
.loyalty-card-wrapper:nth-child(3) { animation-delay: 0.3s; }
.loyalty-card-wrapper:nth-child(4) { animation-delay: 0.4s; }
.loyalty-card-wrapper:nth-child(5) { animation-delay: 0.5s; }
.loyalty-card-wrapper:nth-child(6) { animation-delay: 0.6s; }

/* ===== EFECTOS DE SCROLL ===== */
.summary-panel {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.summary-panel.scrolled {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* ===== UTILIDADES DE COLOR ===== */
.text-gold {
    color: #ffd700 !important;
}

.bg-gold {
    background-color: #ffd700 !important;
}

.border-gold {
    border-color: #ffd700 !important;
}

/* ===== LOADING STATES ===== */
.card-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.card-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== BUTTON STYLES ===== */
.btn-visit {
    color: #9a9a9a !important;
    background-color: transparent;
    border: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-visit:hover {
    color: #ffc107 !important;
    text-decoration: underline;
    transform: translateY(-2px);
}

.btn-qr {
    color: #9a9a9a !important;
    background-color: transparent;
    border: 2px solid !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-qr:hover {
    color: white !important;
    text-decoration: underline;
    transform: translateY(-2px);
}

.btn-delete {
    color: #9a9a9a !important;
    background-color: transparent;
    border: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    color: #dc3545 !important;
    text-decoration: underline;
    transform: translateY(-2px);
}