/**
 * Tickvent Estilos Oficiales del Ticket de Entrada
 */

:root {
    --tk-accent: #2563eb;
    --tk-bg: #0f172a;
    --tk-text-dark: #1e293b;
    --tk-text-muted: #64748b;
    --tk-border: #e2e8f0;
}

.tickvent-ticket-wrapper {
    max-width: 520px;
    width: 100%;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--tk-text-dark);
    box-sizing: border-box;
}

.tickvent-ticket-wrapper * {
    box-sizing: border-box;
}

.tickvent-ticket-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid var(--tk-border);
    position: relative;
    transition: transform 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

/* Encabezado */
.tickvent-ticket-header {
    background: var(--tk-bg, #0f172a);
    color: #ffffff;
    padding: 24px 24px 20px 24px;
    position: relative;
    box-sizing: border-box;
}

.tickvent-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tickvent-event-info {
    flex: 1;
    min-width: 0;
}

.tickvent-logo {
    max-height: 56px;
    max-width: 140px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
}

.tickvent-logo-placeholder {
    width: 48px;
    height: 48px;
    background: var(--tk-accent, #2563eb);
    color: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
}

.tickvent-badge-official {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.tickvent-event-title {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
}

.tickvent-event-meta {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
}

.tickvent-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Divisor Perforado con Muescas Redondas */
.tickvent-ticket-divider {
    position: relative;
    height: 24px;
    background: #ffffff;
    display: flex;
    align-items: center;
}

.tickvent-notch {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #f1f5f9;
    border-radius: 50%;
    top: 2px;
}

.tickvent-notch-left {
    left: -10px;
}

.tickvent-notch-right {
    right: -10px;
}

.tickvent-dash-line {
    width: 100%;
    border-top: 2px dashed #cbd5e1;
    margin: 0 16px;
}

/* Cuerpo */
.tickvent-ticket-body {
    padding: 16px 24px 20px 24px;
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}

.tickvent-attendee-details {
    flex: 1;
}

.tickvent-field {
    margin-bottom: 12px;
}

.tickvent-field .tickvent-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--tk-text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.tickvent-field .tickvent-value {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--tk-text-dark);
    word-break: break-word;
}

.tickvent-field .tickvent-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--tk-bg, #0f172a);
}

.tickvent-field .tickvent-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 15px;
    color: var(--tk-accent, #2563eb);
}

.tickvent-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-top: 4px;
}

.tickvent-status-indicator.pending {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.tickvent-status-indicator.pending .tickvent-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.tickvent-status-indicator.checked_in {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.tickvent-status-indicator.checked_in .tickvent-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
}

.tickvent-checkin-time {
    font-size: 11px;
    font-weight: normal;
    opacity: 0.8;
}

/* Contenedor QR */
.tickvent-qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    min-width: 150px;
}

.tickvent-qr-box {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 8px;
    padding: 6px;
    box-sizing: border-box;
}

.tickvent-qr-box canvas, .tickvent-qr-box img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

.tickvent-qr-hint {
    font-size: 11px;
    color: var(--tk-text-muted);
    margin-top: 6px;
    font-weight: 500;
}

.tickvent-uuid-code {
    font-family: monospace;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Footer del Ticket */
.tickvent-ticket-footer {
    background: #f8fafc;
    padding: 12px 24px;
    border-top: 1px solid var(--tk-border);
}

.tickvent-security-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--tk-text-muted);
}

/* Botones de Acción (Descarga PNG e Impresión) */
.tickvent-ticket-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tickvent-btn-download-png {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    padding: 11px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.25);
}

.tickvent-btn-download-png:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(16, 185, 129, 0.35);
}

.tickvent-btn-download-png:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.tickvent-btn-print {
    background: var(--tk-accent, #2563eb);
    color: #ffffff;
    border: none;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.tickvent-btn-print:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* Soporte de Impresión Nativa (Ctrl+P / Imprimir) */
@media print {
    body * {
        visibility: hidden;
    }
    .no-print {
        display: none !important;
    }
    .tickvent-ticket-wrapper, .tickvent-ticket-wrapper * {
        visibility: visible;
    }
    .tickvent-ticket-wrapper {
        position: absolute;
        left: 50%;
        top: 40px;
        transform: translateX(-50%);
        width: 100%;
        max-width: 500px;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    .tickvent-ticket-card {
        box-shadow: none !important;
        border: 1px solid #333 !important;
    }
    .tickvent-ticket-header {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Responsivo para móviles y tablets */
@media (max-width: 540px) {
    .tickvent-ticket-wrapper {
        margin: 12px auto;
        padding: 0;
        width: 100%;
    }
    .tickvent-ticket-card {
        border-radius: 14px;
    }
    .tickvent-ticket-header {
        padding: 18px 16px;
    }
    .tickvent-brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .tickvent-logo {
        max-height: 48px;
        max-width: 160px;
    }
    .tickvent-event-info {
        width: 100%;
    }
    .tickvent-event-title {
        font-size: 18px;
        line-height: 1.35;
        word-break: normal;
        overflow-wrap: break-word;
    }
    .tickvent-event-meta {
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
        padding-top: 10px;
        font-size: 12.5px;
    }
    .tickvent-meta-item {
        font-size: 12.5px;
        line-height: 1.4;
        word-break: break-word;
    }
    .tickvent-ticket-body {
        flex-direction: column;
        align-items: center;
        padding: 18px 16px 20px 16px;
        gap: 18px;
    }
    .tickvent-attendee-details {
        width: 100%;
        text-align: left;
    }
    .tickvent-field .tickvent-name {
        font-size: 20px;
        line-height: 1.3;
    }
    .tickvent-field .tickvent-id {
        font-size: 16px;
    }
    .tickvent-qr-container {
        width: 100%;
        max-width: 240px;
        margin: 4px auto 0 auto;
        padding: 14px;
    }
    .tickvent-qr-box {
        width: 150px;
        height: 150px;
    }
    .tickvent-qr-box img,
    .tickvent-qr-box canvas {
        width: 140px !important;
        height: 140px !important;
    }
    .tickvent-ticket-footer {
        padding: 12px 16px;
        text-align: center;
    }
    .tickvent-security-note {
        font-size: 11px;
        line-height: 1.4;
        text-align: center;
        justify-content: center;
    }
    .tickvent-ticket-actions {
        flex-direction: column;
        gap: 10px;
        padding: 0;
    }
    .tickvent-btn-download-png,
    .tickvent-btn-print {
        width: 100%;
        justify-content: center;
        padding: 14px 18px;
        font-size: 15px;
    }
}
