/* QR Generator Styles */

/* Definición de la fuente corporativa Joggo-Font */
@font-face {
    font-family: 'Joggo-Font';
    src: url('/01_Yo_nunca/src/fuentes/ChauPhilomeneOne-Italic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
    font-display: swap; /* Mejor rendimiento de carga de fuentes */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Joggo-Font', sans-serif;
    background: linear-gradient(135deg, #014AAD 0%, #C96CE6 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    position: relative;
}

/* Contenedor de partículas de fondo */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Header con lettering BINGO */
.qr-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background: transparent;
}

.qr-bingo-logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    margin-bottom: 10px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.qr-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    font-family: 'Joggo-Font', 'chateau-italic', sans-serif;
    color: #ffffff;
    margin: 0;
    text-shadow: 
        2px 2px 0 rgba(0, 0, 0, 0.8),
        -2px -2px 0 rgba(0, 0, 0, 0.8),
        2px -2px 0 rgba(0, 0, 0, 0.8),
        -2px 2px 0 rgba(0, 0, 0, 0.8),
        4px 4px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
}

.qr-generator-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

/* Secciones simplificadas */
.qr-cartones-section {
    margin-bottom: 25px;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

/* qr-generate-section eliminado - botón suelto */

/* h2 de cartones eliminado - solo mantenemos el de resultados */
.qr-results h2 {
    text-align: center;
    font-size: 1.7rem;
    font-weight: 700;
    font-family: 'Joggo-Font', 'chateau-italic', sans-serif;
    margin-bottom: 18px;
    color: #ffffff;
    text-shadow: 
        2px 2px 0 rgba(0, 0, 0, 0.8),
        -2px -2px 0 rgba(0, 0, 0, 0.8),
        2px -2px 0 rgba(0, 0, 0, 0.8),
        -2px 2px 0 rgba(0, 0, 0, 0.8),
        4px 4px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
    position: relative;
    z-index: 2;
}

/* Grid de botones de cartones simplificado */
.qr-buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* Botones */
.qr-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Joggo-Font', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    min-height: 100px;
    box-shadow: 0 4px 15px rgba(1, 74, 173, 0.2);
}

.qr-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.qr-btn:hover::before {
    left: 100%;
}

.qr-btn-cartones {
    background: linear-gradient(135deg, #29211D, #4B3810);
    color: white;
    box-shadow: 0 10px 30px rgba(41, 33, 29, 0.4);
}

.qr-btn-cartones:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(41, 33, 29, 0.5);
}

.qr-btn-cartones.selected {
    background: linear-gradient(135deg, #4B3810, #29211D);
    box-shadow: 0 15px 35px rgba(75, 56, 16, 0.5);
    transform: scale(1.05);
}

.qr-btn-generate {
    background: linear-gradient(135deg, #1a140f, #2d2208);
    color: white;
    box-shadow: 
        0 10px 30px rgba(26, 20, 15, 0.5),
        0 0 20px rgba(255, 215, 0, 0.3);
    width: 100%;
    max-width: 400px;
    margin: 25px auto 20px auto;
    display: block;
    padding: 20px 16px;
    min-height: 100px;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.qr-btn-generate::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 215, 0, 0.2) 50%,
        transparent 70%
    );
    animation: generateShimmer 3s linear infinite;
    pointer-events: none;
}

@keyframes generateShimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(0deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(360deg); }
}

.qr-btn-generate:hover:not(:disabled) {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(26, 20, 15, 0.6),
        0 0 30px rgba(255, 215, 0, 0.5);
    border-color: rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, #0f0c09, #1f180a);
}

.qr-btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.qr-btn-generate:not(:disabled) {
    opacity: 1;
    cursor: pointer;
}

.qr-btn-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.qr-btn-text {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Joggo-Font', sans-serif;
}

/* Resultados */
.qr-results {
    background: rgba(255, 255, 255, 0.98);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(1, 74, 173, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.qr-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 18px;
}

.qr-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(1, 74, 173, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid rgba(1, 74, 173, 0.08);
}

.qr-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(1, 74, 173, 0.15);
}

.qr-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Joggo-Font', sans-serif;
    margin-bottom: 15px;
    color: #333;
}

.qr-code-container {
    background: white;
    padding: 15px;
    border-radius: 15px;
    margin: 15px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

.qr-url {
    font-size: 0.9rem;
    color: #666;
    word-break: break-all;
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

/* Loading */
.qr-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.qr-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.qr-loading-text {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Joggo-Font', sans-serif;
}

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

/* Toast */
.qr-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 15px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Joggo-Font', sans-serif;
    z-index: 10001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.qr-toast.show {
    transform: translateX(0);
}

.qr-toast.success {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.qr-toast.error {
    background: linear-gradient(135deg, #fa709a, #fee140);
}

/* Responsive */
@media (max-width: 768px) {
    .qr-generator-container {
        padding: 15px;
    }
    
    .qr-header {
        margin-bottom: 20px;
        padding: 15px 0;
    }
    
    .qr-bingo-logo {
        max-width: 250px;
        margin-bottom: 8px;
    }
    
    .qr-subtitle {
        font-size: 1.2rem;
    }
    
    .qr-buttons-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .qr-btn {
        min-height: 100px;
        padding: 20px 15px;
    }
    
    .qr-btn-icon {
        font-size: 2rem;
    }
    
    .qr-btn-text {
        font-size: 1rem;
    }
    
    .qr-cards-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .qr-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        transform: translateY(100px);
    }
    
    .qr-toast.show {
        transform: translateY(0);
    }
}

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

.qr-cartones-section,
.qr-generate-section,
.qr-results {
    animation: fadeInUp 0.6s ease-out;
}

.qr-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Efectos especiales */
.qr-btn:active {
    transform: scale(0.98);
}

.qr-btn-cartones.selected {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1.05); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.05); }
}

/* Popup limpio y elegante para QRs */
.qr-beautiful-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(0px);
}

.qr-beautiful-popup.show {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(8px);
}

.qr-popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(1, 74, 173, 0.3), rgba(201, 108, 230, 0.2));
    backdrop-filter: blur(0px);
    transition: backdrop-filter 0.4s ease;
}

.qr-beautiful-popup.show .qr-popup-backdrop {
    backdrop-filter: blur(12px);
}

.qr-popup-content {
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 
        0 25px 50px rgba(1, 74, 173, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.8);
    max-width: 440px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.8) translateY(30px) rotate(-2deg);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.qr-beautiful-popup.show .qr-popup-content {
    transform: scale(1) translateY(0) rotate(0deg);
}

.qr-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #014AAD 0%, #C96CE6 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 4px 15px rgba(1, 74, 173, 0.3);
    position: relative;
    overflow: hidden;
}

.qr-popup-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: headerShimmer 3s linear infinite;
    pointer-events: none;
}

@keyframes headerShimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(0deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(360deg); }
}

.qr-popup-header h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Joggo-Font', sans-serif;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.qr-popup-close {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.qr-popup-close:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.qr-popup-body {
    padding: 25px 24px 30px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.qr-popup-code {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    display: inline-block;
    border: 3px solid transparent;
    background-clip: padding-box;
    position: relative;
    box-shadow: 
        0 8px 25px rgba(1, 74, 173, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.qr-popup-code::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg, #014AAD, #C96CE6);
    border-radius: 20px;
    z-index: -1;
}

.qr-popup-code canvas,
.qr-popup-code img {
    border-radius: 15px;
    box-shadow: 
        0 10px 30px rgba(1, 74, 173, 0.2),
        0 0 0 1px rgba(1, 74, 173, 0.1);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.qr-popup-code:hover canvas,
.qr-popup-code:hover img {
    transform: scale(1.05);
    box-shadow: 
        0 15px 40px rgba(1, 74, 173, 0.3),
        0 0 0 1px rgba(1, 74, 173, 0.2);
}

.qr-popup-info p {
    margin: 10px 0;
    color: #374151;
    font-size: 1.05rem;
    line-height: 1.6;
    font-family: 'Joggo-Font', sans-serif;
    font-weight: 500;
}

.qr-popup-partida {
    font-weight: 700 !important;
    background: linear-gradient(135deg, #014AAD, #C96CE6) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-size: 1.2rem !important;
    font-family: 'Joggo-Font', sans-serif !important;
    margin: 15px 0 5px 0 !important;
    padding: 8px 16px !important;
    border-radius: 12px !important;
    background-color: rgba(1, 74, 173, 0.08) !important;
    border: 1px solid rgba(1, 74, 173, 0.15) !important;
    display: inline-block !important;
}

/* Mejorar botones deshabilitados */
.qr-btn-cartones:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.qr-btn-cartones:disabled:hover {
    transform: none;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}
