/* Tabla de Códigos - Estilos modernos */
.codigo-tabla-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.codigo-tabla {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.codigo-tabla thead {
    background: linear-gradient(135deg, #5C80BC 0%, #4169A3 50%, #2B4C7E 100%);
    color: #ffffff;
}

.codigo-tabla thead th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: none;
}

.codigo-tabla tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.codigo-tabla tbody tr:hover {
    background-color: #f8f9ff;
}

.codigo-tabla tbody tr.expired {
    background-color: #fdf2f2;
    opacity: 0.7;
}

.codigo-tabla tbody tr.expired:hover {
    background-color: #fed7d7;
}

.codigo-tabla td {
    padding: 16px 20px;
    vertical-align: top;
    border: none;
    background: transparent;
}

/* Celda del código */
.codigo-cell {
    width: 35%;
    min-width: 200px;
}

.codigo-wrapper {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    transition: all 0.2s ease;
}

.codigo-wrapper:hover {
    transform: translateY(-1px);
}

.codigo-wrapper.copiando {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

.codigo-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f7f9fc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.codigo-wrapper:hover .codigo-content {
    border-color: #667eea;
    background: #eef2ff;
}

.codigo-texto {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    letter-spacing: 0.5px;
    margin: 0;
}

.copy-icon {
    font-size: 18px;
    color: #667eea;
    opacity: 0.7;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.codigo-wrapper:hover .copy-icon {
    opacity: 1;
    background: rgba(102, 126, 234, 0.1);
}

.expiration-info {
    margin-top: 4px;
}

.expiration-text {
    color: #718096;
    font-size: 12px;
    font-weight: 500;
}

.codigo-tabla tbody tr.expired .expiration-text {
    color: #e53e3e;
    font-weight: 600;
}

/* Celda de recompensa */
.recompensa-cell {
    width: 65%;
    background: #ffffff;
}

.recompensa-content {
    line-height: 1.6;
}

.nuevo-badge {
    display: inline-block;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: top;
    animation: newBadgeGlow 2s ease-in-out infinite alternate;
}

@keyframes newBadgeGlow {
    0% { box-shadow: 0 0 5px rgba(72, 187, 120, 0.3); }
    100% { box-shadow: 0 0 20px rgba(72, 187, 120, 0.6); }
}

.recompensa-texto {
    color: #2d3748;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .codigo-tabla-container {
        border-radius: 0;
        box-shadow: none;
    }
    
    .codigo-tabla {
        font-size: 14px;
    }
    
    /* Layout móvil: cambiar a estructura vertical */
    .codigo-tabla thead {
        display: none; /* Ocultar headers en móvil */
    }
    
    .codigo-tabla tbody tr {
        display: block;
        margin-bottom: 20px;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        padding: 16px;
    }
    
    .codigo-tabla td {
        display: block;
        padding: 0;
        border: none;
        width: 100% !important;
        text-align: center;
    }
    
    /* Código centrado arriba */
    .codigo-cell {
        margin-bottom: 12px;
    }
    
    .codigo-content {
        justify-content: center;
        background: #f7f9fc;
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 0;
    }
    
    .codigo-texto {
        font-size: 18px;
        margin-right: 12px;
    }
    
    .copy-icon {
        font-size: 20px;
    }
    
    /* Recompensa centrada en el medio */
    .recompensa-cell {
        margin-bottom: 12px;
        text-align: center;
    }
    
    .recompensa-content {
        background: #f8f9ff;
        border-radius: 8px;
        padding: 12px;
    }
    
    .nuevo-badge {
        display: block;
        margin: 0 auto 8px auto;
        width: fit-content;
    }
    
    .recompensa-texto {
        font-size: 14px;
        display: block;
    }
    
    /* Expiración centrada abajo */
    .expiration-info {
        text-align: center;
        margin-top: 8px;
        padding: 8px;
        background: #fff5f5;
        border-radius: 6px;
        border: 1px solid #fed7d7;
    }
    
    .expiration-text {
        font-size: 13px;
        color: #e53e3e;
        font-weight: 600;
    }
    
    /* Códigos expirados en móvil */
    .codigo-tabla tbody tr.expired {
        background-color: #fdf2f2;
        border-color: #fed7d7;
    }
}

@media (max-width: 480px) {
    .codigo-tabla thead th {
        padding: 12px 16px;
        font-size: 12px;
    }
    
    .codigo-tabla td {
        padding: 10px 12px;
    }
    
    .codigo-content {
        padding: 8px 10px;
    }
    
    .codigo-texto {
        font-size: 13px;
    }
    
    .nuevo-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* Animaciones para notificaciones */
@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Notificaciones de copia */
.codigo-notificacion {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #48bb78;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 999999;
    animation: slideUp 0.3s ease;
    font-size: 14px;
}

/* Bloques de anuncios */
.ad-block {
    margin: 20px 0;
    padding: 20px;
    background: #f7f9fc;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
    text-align: center;
}

.sticky-ad {
    position: relative;
    z-index: 10;
}