/* Estilos Customizados e Animações - Sistema de Gestão de Manutenção */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #0f172a;
    color: #f8fafc;
}

/* Glassmorphism Cards */
.glass-card {
    background: rgba(30, 41, 59, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card-hover {
    transition: all 0.3s ease;
}

.glass-card-hover:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.25);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Custom Toggle Switch for Decision (SIM / NÃO) */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 28px;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 2px;
    background-color: #94a3b8;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #059669; /* Emerald Green */
}

input:checked + .slider:before {
    transform: translateX(31px);
    background-color: #ffffff;
}

/* Dynamic Budget & Cost Threshold Status Classes */
.cost-state-ok {
    color: #34d399 !important;
}

.cost-state-warning {
    color: #fbbf24 !important;
}

.cost-state-exceeded {
    color: #f43f5e !important;
    animation: pulseRedAlert 1s infinite alternate ease-in-out;
}

.card-state-exceeded {
    border-color: rgba(244, 63, 94, 0.6) !important;
    background: rgba(153, 27, 27, 0.25) !important;
    box-shadow: 0 0 25px rgba(244, 63, 94, 0.3) !important;
}

.card-state-warning {
    border-color: rgba(245, 158, 11, 0.5) !important;
    background: rgba(146, 64, 14, 0.2) !important;
}

@keyframes pulseRedAlert {
    from { opacity: 0.85; transform: scale(1); }
    to { opacity: 1; transform: scale(1.03); }
}

/* Shimmer Highlight on Cost Update */
.cost-update-anim {
    animation: pulseCost 0.4s ease-in-out;
}

@keyframes pulseCost {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Badge Risk Colors */
.badge-risco-alto {
    background: rgba(225, 29, 72, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(225, 29, 72, 0.3);
}

.badge-risco-medio {
    background: rgba(217, 119, 6, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(217, 119, 6, 0.3);
}

.badge-risco-baixo {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Table Row Active Highlight */
tr.row-sim {
    background-color: rgba(5, 150, 105, 0.08) !important;
}

tr.row-sim:hover {
    background-color: rgba(5, 150, 105, 0.15) !important;
}

/* Sticky Header and Scrollable Table Container */
.sticky-top-section {
    position: sticky;
    top: 4rem;
    z-index: 20;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding-bottom: 0.5rem;
}

.table-scroll-container {
    flex: 1 1 0%;
    overflow-y: auto;
    overflow-x: auto;
}

.table-scroll-container thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #0f172a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Modal Animations */
.modal-enter {
    animation: fadeInModal 0.25s ease-out forwards;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* Altamente responsivo e compacto para visualização sem rolagem horizontal */
.table-scroll-container table {
    width: 100%;
    table-layout: auto;
}

.table-scroll-container th {
    padding: 6px 4px !important;
    font-size: 10px !important;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.table-scroll-container td {
    padding: 6px 4px !important;
    font-size: 11px !important;
}

.table-scroll-container td.max-w-sm,
.table-scroll-container td.max-w-xs {
    max-width: 180px !important;
}

/* Alertas de Prazo de Necessidade */
.badge-prazo-urgente {
    background: rgba(225, 29, 72, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(225, 29, 72, 0.3);
    font-weight: bold;
}

.badge-prazo-alerta {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-weight: bold;
}

.badge-prazo-ok {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Collapsible text block */
.collapsible-text {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: max-width 0.3s ease;
}

.collapsible-text:hover {
    color: #818cf8;
}
