/* Estilos para la página de raspaditos */

/* CSS Variables for Three Ticket Designs */
:root {
    /* Classic theme variables - Traditional blue/silver lottery ticket */
    --classic-primary: #3a7bd5;
    --classic-secondary: #c4c4c4;
    --classic-accent: #2980b9;
    --classic-text: #ffffff;
    --classic-background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
    --classic-border: #2980b9;
    --classic-shadow: rgba(58, 123, 213, 0.3);
    --classic-pattern: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.1) 10px, rgba(255,255,255,0.1) 20px);
    
    /* Gold theme variables - Premium golden luxury design */
    --gold-primary: #f9d423;
    --gold-secondary: #e65c00;
    --gold-accent: #f39c12;
    --gold-text: #8b4513;
    --gold-background: linear-gradient(135deg, #f9d423 0%, #ff8a00 100%);
    --gold-border: #f39c12;
    --gold-shadow: rgba(243, 156, 18, 0.4);
    --gold-pattern: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.3) 2px, transparent 2px), radial-gradient(circle at 80% 50%, rgba(255,255,255,0.3) 2px, transparent 2px);
    
    /* Diamond theme variables - Ultra-premium prismatic design */
    --diamond-primary: #8e2de2;
    --diamond-secondary: #4a00e0;
    --diamond-accent: #8e44ad;
    --diamond-text: #ffffff;
    --diamond-background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
    --diamond-border: #8e44ad;
    --diamond-shadow: rgba(142, 68, 173, 0.5);
    --diamond-pattern: conic-gradient(from 0deg, #ff0080, #ff8c00, #40e0d0, #ff0080);
}

.ticket-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ticket-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2) !important;
}

.ticket-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.ticket-card:hover::before {
    left: 100%;
}

.ticket-card.unscratched {
    border: 2px solid #007bff;
    background: #ff8754;
    color: white;
}

.ticket-card.unscratched .card-body {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

.ticket-card.scratched {
    opacity: 0.8;
}

.ticket-card.scratched.winner {
    border: 2px solid #28a745;
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

.ticket-design {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.price-options {
    margin-top: 1rem;
}

.purchase-btn {
    transition: all 0.2s ease;
    border-radius: 20px;
    font-weight: 600;
}

.purchase-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
}

.scratch-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.scratch-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.scratch-btn:hover {
    background: linear-gradient(45deg, #ee5a24, #ff6b6b);
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(255,107,107,0.5);
}

.scratch-btn:hover::before {
    width: 100%;
    height: 100%;
}

.scratch-btn:active {
    transform: scale(1.02);
}

.modal-content {
    border-radius: 15px;
    overflow: hidden;
}

.card-image img {
    transition: transform 0.3s ease;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

/* Animaciones mejoradas */
@keyframes ticketPulse {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(0,123,255,0.2); }
    50% { transform: scale(1.03); box-shadow: 0 8px 25px rgba(0,123,255,0.4); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(0,123,255,0.2); }
}

.ticket-card.unscratched {
    animation: ticketPulse 3s ease-in-out infinite;
}

@keyframes ticketGlow {
    0% { box-shadow: 0 0 5px rgba(40,167,69,0.5); }
    50% { box-shadow: 0 0 20px rgba(40,167,69,0.8), 0 0 30px rgba(40,167,69,0.6); }
    100% { box-shadow: 0 0 5px rgba(40,167,69,0.5); }
}

.ticket-card.winner {
    animation: ticketGlow 2s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .price-options .d-flex {
        justify-content: center;
    }
    
    .ticket-card {
        margin-bottom: 1rem;
    }
}

/* Efectos de brillo para boletos ganadores */
.ticket-card.winner {
    position: relative;
    overflow: hidden;
}

.ticket-card.winner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Efectos de partículas para compra exitosa */
@keyframes purchaseSuccess {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.1) rotate(180deg); opacity: 0.8; }
    100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

.purchase-success {
    animation: purchaseSuccess 0.6s ease-out;
}

/* Modal enhancements */
.modal-content {
    border-radius: 20px;
    overflow: hidden;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    background: #4481d9;
    color: white;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.modal-header .btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Loading animation */
@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal.show .modal-dialog {
    animation: modalSlideIn 0.3s ease-out;
}

/* ========================================
   THREE DISTINCT TICKET DESIGNS
   ======================================== */

/* Classic Ticket Design - Traditional blue/silver lottery ticket */
.classic-ticket,
.design-classic .scratch-container,
.design-classic .scratch-card {
    background: var(--classic-background) !important;
    border: 3px solid var(--classic-border) !important;
    box-shadow: 0 15px 40px var(--classic-shadow) !important;
    position: relative;
}

.classic-ticket::before,
.design-classic .scratch-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--classic-pattern);
    opacity: 0.3;
    pointer-events: none;
    border-radius: inherit;
}

.design-classic {
    --ticket-primary-color: var(--classic-primary);
    --ticket-secondary-color: var(--classic-secondary);
    --ticket-accent-color: var(--classic-accent);
    --ticket-text-color: var(--classic-text);
    --ticket-background: var(--classic-background);
    --ticket-border-color: var(--classic-border);
    --ticket-shadow-color: var(--classic-shadow);
}

.design-classic .scratch-card {
    animation: classicPulse 4s ease-in-out infinite;
}

@keyframes classicPulse {
    0%, 100% { 
        box-shadow: 0 15px 40px var(--classic-shadow);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 20px 50px rgba(58, 123, 213, 0.5);
        transform: scale(1.01);
    }
}

/* Gold Ticket Design - Premium golden luxury design */
.gold-ticket,
.design-gold .scratch-container,
.design-gold .scratch-card {
    background: var(--gold-background) !important;
    border: 3px solid var(--gold-border) !important;
    box-shadow: 0 20px 50px var(--gold-shadow) !important;
    position: relative;
}

.gold-ticket::before,
.design-gold .scratch-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gold-pattern);
    background-size: 40px 40px;
    opacity: 0.4;
    pointer-events: none;
    border-radius: inherit;
}

.design-gold {
    --ticket-primary-color: var(--gold-primary);
    --ticket-secondary-color: var(--gold-secondary);
    --ticket-accent-color: var(--gold-accent);
    --ticket-text-color: var(--gold-text);
    --ticket-background: var(--gold-background);
    --ticket-border-color: var(--gold-border);
    --ticket-shadow-color: var(--gold-shadow);
}

.design-gold .scratch-card {
    animation: goldShine 3s ease-in-out infinite;
    box-shadow: inset 0 0 30px rgba(249, 212, 35, 0.3) !important;
}

@keyframes goldShine {
    0% { 
        box-shadow: inset 0 0 30px rgba(249, 212, 35, 0.3), 0 20px 50px var(--gold-shadow);
    }
    50% { 
        box-shadow: inset 0 0 50px rgba(255, 255, 255, 0.4), 0 25px 60px rgba(243, 156, 18, 0.6);
    }
    100% { 
        box-shadow: inset 0 0 30px rgba(249, 212, 35, 0.3), 0 20px 50px var(--gold-shadow);
    }
}

.design-gold .scratch-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: rotate(45deg);
    animation: goldSweep 4s infinite;
    pointer-events: none;
}

@keyframes goldSweep {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Diamond Ticket Design - Ultra-premium prismatic design */
.diamond-ticket,
.design-diamond .scratch-container,
.design-diamond .scratch-card {
    background: var(--diamond-background) !important;
    border: 3px solid var(--diamond-border) !important;
    box-shadow: 0 25px 60px var(--diamond-shadow) !important;
    position: relative;
}

.diamond-ticket::before,
.design-diamond .scratch-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--diamond-pattern);
    background-size: 60px 60px;
    opacity: 0.2;
    pointer-events: none;
    border-radius: inherit;
    animation: diamondRotate 8s linear infinite;
}

@keyframes diamondRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.design-diamond {
    --ticket-primary-color: var(--diamond-primary);
    --ticket-secondary-color: var(--diamond-secondary);
    --ticket-accent-color: var(--diamond-accent);
    --ticket-text-color: var(--diamond-text);
    --ticket-background: var(--diamond-background);
    --ticket-border-color: var(--diamond-border);
    --ticket-shadow-color: var(--diamond-shadow);
}

.design-diamond .scratch-card {
    animation: diamondShimmer 2s ease-in-out infinite, diamondPrism 6s linear infinite;
    box-shadow: inset 0 0 40px rgba(142, 45, 226, 0.4) !important;
}

@keyframes diamondShimmer {
    0% { 
        box-shadow: inset 0 0 40px rgba(142, 45, 226, 0.4), 0 25px 60px var(--diamond-shadow);
    }
    50% { 
        box-shadow: inset 0 0 60px rgba(255, 255, 255, 0.3), 0 30px 70px rgba(142, 68, 173, 0.7);
    }
    100% { 
        box-shadow: inset 0 0 40px rgba(142, 45, 226, 0.4), 0 25px 60px var(--diamond-shadow);
    }
}

@keyframes diamondPrism {
    0% { filter: hue-rotate(0deg); }
    25% { filter: hue-rotate(90deg); }
    50% { filter: hue-rotate(180deg); }
    75% { filter: hue-rotate(270deg); }
    100% { filter: hue-rotate(360deg); }
}

.design-diamond .scratch-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255,0,128,0.1) 0%, 
        rgba(255,140,0,0.1) 25%, 
        rgba(64,224,208,0.1) 50%, 
        rgba(255,0,128,0.1) 75%, 
        rgba(255,0,128,0.1) 100%);
    background-size: 200% 200%;
    animation: diamondSpectrum 3s ease-in-out infinite;
    pointer-events: none;
    border-radius: inherit;
}

@keyframes diamondSpectrum {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Enhanced symbol styling for each design */
.design-classic .symbol {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.4);
    color: var(--classic-text);
}

.design-gold .symbol {
    background: rgba(249, 212, 35, 0.3);
    border: 2px solid rgba(243, 156, 18, 0.6);
    color: var(--gold-text);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.design-diamond .symbol {
    background: rgba(142, 45, 226, 0.3);
    border: 2px solid rgba(142, 68, 173, 0.6);
    color: var(--diamond-text);
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* Responsive design enhancements */
@media (max-width: 768px) {
    .design-classic .scratch-container,
    .design-gold .scratch-container,
    .design-diamond .scratch-container {
        max-width: 95vw;
        height: 450px;
    }
    
    .classic-ticket::before,
    .gold-ticket::before,
    .diamond-ticket::before,
    .design-classic .scratch-container::before,
    .design-gold .scratch-container::before,
    .design-diamond .scratch-container::before {
        opacity: 0.2;
    }
}

/* Symbols visible during scratching */
.symbol.visible-during-scratch {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.symbol.visible-during-scratch.revealed {
    opacity: 1 !important;
}

/* Enhanced particle animation */
@keyframes particleFall {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.8;
        transform: translateY(20px) scale(0.8) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: translateY(40px) scale(0.3) rotate(360deg);
    }
}

/* Scratch particle z-index fix */
.scratch-particle {
    z-index: 9998 !important;
    position: fixed !important;
    pointer-events: none !important;
}

.particle-classic {
    z-index: 9998 !important;
}

.particle-gold {
    z-index: 9998 !important;
}

.particle-diamond {
    z-index: 9998 !important;
}

/* Confetti z-index fix */
.confetti {
    z-index: 9997 !important;
    position: fixed !important;
    pointer-events: none !important;
}

/* Design preview cards for tickets.php */
.card-design-preview {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.design-visual {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.design-visual.design-classic {
    background: var(--classic-background);
    border: 2px solid var(--classic-border);
}

.design-visual.design-gold {
    background: var(--gold-background);
    border: 2px solid var(--gold-border);
}

.design-visual.design-diamond {
    background: var(--diamond-background);
    border: 2px solid var(--diamond-border);
}

.design-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.3;
}

.design-classic .design-pattern {
    background: var(--classic-pattern);
}

.design-gold .design-pattern {
    background: var(--gold-pattern);
    background-size: 40px 40px;
}

.design-diamond .design-pattern {
    background: var(--diamond-pattern);
    background-size: 60px 60px;
    animation: diamondRotate 8s linear infinite;
}

.design-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.design-content i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.design-label {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.design-gold .design-content {
    color: var(--gold-text);
}
