/* TechTicket - Custom Styles */

/* ─────────────────────────────────────────────────────────────────
   Detección de colisiones — modo solo lectura para segundo agente
   ─────────────────────────────────────────────────────────────────
   Cuando un modal de ticket está en "lectura forzada" (porque otro
   agente está editándolo), se le añade el atributo:
       data-modal-readonly="true"
   Esto deshabilita visual y funcionalmente todos los inputs/botones
   dentro de él, EXCEPTO los que estén marcados con:
       data-readonly-allow="true"
   (cerrar modal, navegación de pestañas, descargar adjuntos, etc.)
*/
[data-modal-readonly="true"] button,
[data-modal-readonly="true"] input,
[data-modal-readonly="true"] textarea,
[data-modal-readonly="true"] select,
[data-modal-readonly="true"] [role="button"] {
    pointer-events: none !important;
    opacity: 0.5;
    cursor: not-allowed !important;
}

[data-modal-readonly="true"] [data-readonly-allow="true"],
[data-modal-readonly="true"] [data-readonly-allow="true"] button,
[data-modal-readonly="true"] [data-readonly-allow="true"] input,
[data-modal-readonly="true"] [data-readonly-allow="true"] textarea,
[data-modal-readonly="true"] [data-readonly-allow="true"] select,
[data-modal-readonly="true"] [data-readonly-allow="true"] [role="button"] {
    pointer-events: auto !important;
    opacity: 1;
    cursor: pointer !important;
}



/* Estilos base */
@font-face {
    font-family: 'Albert_Sans';
    src: url('/fonts/Albert_Sans/AlbertSans-Italic-VariableFont_wght.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
 

html {
    scroll-behavior: smooth;
    font-family: 'Albert_Sans', system-ui, sans-serif;
}

body {
    min-height: 100dvh;
    font-family: 'Albert_Sans', system-ui, sans-serif;
}



/* Ocultar scrollbar pero mantener funcionalidad */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Focus styles mejorados */
*:focus-visible {
    outline: 2px solid #137fec;
    outline-offset: 2px;
}

/* Input autofill styles para modo oscuro */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff;
    -webkit-box-shadow: 0 0 0px 1000px #192633 inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* Animaciones personalizadas */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* Transiciones suaves para el tema */
* {
    transition-property: background-color, border-color, color;
    transition-duration: 0.15s;
    transition-timing-function: ease-out;
}

/* Excluir animaciones de ciertos elementos */
button,
a,
input {
    transition: all 0.2s ease-out;
}

/* Mejorar legibilidad del texto */
.text-balance {
    text-wrap: balance;
}

/* Loading spinner personalizado */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-left-color: #137fec;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Efectos de hover para cards */
.card-hover {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(19, 127, 236, 0.15);
}

/* Glassmorphism effect */
.glass {
    background: rgba(25, 38, 51, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #137fec 0%, #0b4e92 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Material Icons ajustes */
.material-symbols-outlined {
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
    vertical-align: middle;
}

/* Filled icons */
.material-symbols-filled {
    font-variation-settings:
        'FILL' 1,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
}

/* Responsive typography */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Estilos para inputs de formulario */
.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Checkbox personalizado */
input[type="checkbox"] {
    cursor: pointer;
}

input[type="checkbox"]:checked {
    background-color: #137fec;
    border-color: #137fec;
}

/* Blazor error UI */
#blazor-error-ui {
    background: #ef4444;
    color: white;
    padding: 0.75rem 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
}

#blazor-error-ui.show {
    display: block;
}

/* ============ Tooltip Styles ============ */

.tooltip-wrapper {
    position: relative;
    display: inline-flex;
}

.tooltip-content {
    position: absolute;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: #ffffff;
    white-space: nowrap;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2847 100%);
    border: 1px solid rgba(19, 127, 236, 0.3);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(19, 127, 236, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.tooltip-wrapper:hover .tooltip-content,
.tooltip-wrapper:focus-within .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Tooltip sizes */
.tooltip-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.tooltip-md {
    padding: 8px 12px;
    font-size: 13px;
}

.tooltip-lg {
    padding: 10px 16px;
    font-size: 14px;
    max-width: 280px;
    white-space: normal;
}

/* Tooltip positions */
.tooltip-top {
    bottom: calc(100% + 10px);
    left: 50%;
    transform-origin: bottom center;
    transform: translateX(-50%) scale(0.95);
}

.tooltip-wrapper:hover .tooltip-top,
.tooltip-wrapper:focus-within .tooltip-top {
    transform: translateX(-50%) scale(1);
}

.tooltip-bottom {
    top: calc(100% + 10px);
    left: 50%;
    transform-origin: top center;
    transform: translateX(-50%) scale(0.95);
}

.tooltip-wrapper:hover .tooltip-bottom,
.tooltip-wrapper:focus-within .tooltip-bottom {
    transform: translateX(-50%) scale(1);
}

.tooltip-left {
    right: calc(100% + 10px);
    top: 50%;
    transform-origin: right center;
    transform: translateY(-50%) scale(0.95);
}

.tooltip-wrapper:hover .tooltip-left,
.tooltip-wrapper:focus-within .tooltip-left {
    transform: translateY(-50%) scale(1);
}

.tooltip-right {
    left: calc(100% + 10px);
    top: 50%;
    transform-origin: left center;
    transform: translateY(-50%) scale(0.95);
}

.tooltip-wrapper:hover .tooltip-right,
.tooltip-wrapper:focus-within .tooltip-right {
    transform: translateY(-50%) scale(1);
}

/* Tooltip arrows */
.tooltip-arrow {
    position: absolute;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2847 100%);
    border: 1px solid rgba(19, 127, 236, 0.3);
    transform: rotate(45deg);
}

.arrow-bottom {
    bottom: -6px;
    left: 50%;
    margin-left: -5px;
    border-top: none;
    border-left: none;
}

.arrow-top {
    top: -6px;
    left: 50%;
    margin-left: -5px;
    border-bottom: none;
    border-right: none;
}

.arrow-right {
    right: -6px;
    top: 50%;
    margin-top: -5px;
    border-bottom: none;
    border-left: none;
}

.arrow-left {
    left: -6px;
    top: 50%;
    margin-top: -5px;
    border-top: none;
    border-right: none;
}

/* Tooltip with glow effect for important actions */
.tooltip-glow .tooltip-content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(19, 127, 236, 0.2);
}

/* Dark theme tooltip variant */
.tooltip-dark .tooltip-content {
    background: linear-gradient(135deg, #0a1929 0%, #0f2847 100%);
}

/* Keyboard shortcut style inside tooltip */
.tooltip-content kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    font-family: ui-monospace, monospace;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-left: 8px;
}

/* Drop Zone Styles */
.drop-zone {
    transition: all 0.2s ease;
}

    .drop-zone.drag-over {
        border-color: #137fec !important;
        background-color: rgba(19, 127, 236, 0.1) !important;
        transform: scale(1.01);
    }

    .drop-zone:focus {
        outline: none;
        border-color: #137fec !important;
        background-color: rgba(19, 127, 236, 0.05) !important;
    }