/* Tailwind CSS Custom Styles */

/* Previne barras brancas no iOS ao rolar além dos limites (rubber band) */
html {
    background-color: #F5F7FA;
    overscroll-behavior: none;
}

body {
    overscroll-behavior: none;
}

/* Remove focus outline from nav elements */
nav a:focus,
nav button:focus {
    outline: none !important;
}

/* Navbar Links */
.nav-link-tw {
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.nav-link-tw:hover {
    background-color: rgba(29, 78, 216, 0.5);
}

/* Dropdown Container */
.dropdown-tw {
    position: relative;
}

/* Dropdown Menu */
.dropdown-menu-tw {
    position: absolute;
    left: 0;
    margin-top: 0.5rem;
    width: 12rem;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
    z-index: 50;
    display: none;
}

.dropdown-menu-right {
    left: auto;
    right: 0;
}

/* Dropdown Items */
.dropdown-item-tw {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    transition: colors 0.15s;
}
.dropdown-item-tw:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
}

/* Mobile Nav Links */
.mobile-nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    transition: colors 0.2s;
}
.mobile-nav-link:hover {
    background-color: #2563eb;
}

/* Print Styles */
@media print {
    nav, .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .bg-white {
        box-shadow: none !important;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Form Input Height Normalization */
input[type="time"].form-input {
    height: 42px;
    line-height: normal;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Animation Classes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Focus Styles for Accessibility */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Table Utilities */
.table-responsive {
    @apply overflow-x-auto rounded-lg;
}

/* Badge Styles (for status indicators) */
.badge-success {
    @apply bg-green-100 text-green-800 px-3 py-1 rounded-full text-xs font-semibold;
}

.badge-warning {
    @apply bg-yellow-100 text-yellow-800 px-3 py-1 rounded-full text-xs font-semibold;
}

.badge-danger {
    @apply bg-red-100 text-red-800 px-3 py-1 rounded-full text-xs font-semibold;
}

.badge-info {
    @apply bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-xs font-semibold;
}

/* Card Hover Effects */
.card-hover {
    @apply transition-all duration-300 hover:shadow-2xl hover:-translate-y-1;
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    outline: none !important;
}

.form-input:focus {
    border-color: #1E3A8A;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    outline: none !important;
}

.form-label {
    @apply block text-sm font-semibold text-gray-700 mb-2 whitespace-nowrap truncate;
}

.form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    cursor: pointer;
    outline: none !important;
}

.form-select:focus {
    border-color: #1E3A8A;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    outline: none !important;
}

/* Remove outline padrão de todos inputs */
input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    box-shadow: none !important;
}

.form-error {
    @apply text-red-600 text-sm mt-1;
}

/* Button Styles */
.btn-primary {
    @apply px-6 py-2.5 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 transition-all duration-200 shadow-md hover:shadow-lg;
}

.btn-secondary {
    @apply px-6 py-2.5 bg-gray-600 text-white rounded-lg font-semibold hover:bg-gray-700 transition-all duration-200 shadow-md hover:shadow-lg;
}

.btn-success {
    @apply px-6 py-2.5 bg-green-600 text-white rounded-lg font-semibold hover:bg-green-700 transition-all duration-200 shadow-md hover:shadow-lg;
}

.btn-danger {
    @apply px-6 py-2.5 bg-red-600 text-white rounded-lg font-semibold hover:bg-red-700 transition-all duration-200 shadow-md hover:shadow-lg;
}

.btn-outline {
    @apply px-6 py-2.5 bg-white border-2 border-blue-600 text-blue-600 rounded-lg font-semibold hover:bg-blue-50 transition-all duration-200 shadow-sm hover:shadow-md;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    z-index: 1000;
}

/* Status Colors for Vehicles */
.status-disponivel {
    @apply bg-green-500;
}

.status-em_uso {
    @apply bg-blue-500;
}

.status-manutencao {
    @apply bg-yellow-500;
}

.status-inativo {
    @apply bg-gray-500;
}

/* Gradient Backgrounds */
.gradient-blue {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.gradient-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gradient-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.gradient-yellow {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}


.bg-pendente {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.bg-em_andamento {
    background-color: #0dcaf0 !important;
}

.bg-concluida {
    background-color: #198754 !important;
}

/* Login page */
.min-vh-100 {
    min-height: 100vh;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* Responsividade */
@media (max-width: 768px) {
    .card-body h2 {
        font-size: 2rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

/* Gráficos */
canvas {
    max-height: 300px;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Dropdown menu */
.dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    padding-left: 1.2rem;
}

/* Ícones */
.bi {
    vertical-align: middle;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}

/* ========================================================================= */
/* ESTILOS DA PLANILHA INTERATIVA (NF MANUTENÇÃO / EXCEL STYLE)              */
/* ========================================================================= */
.sheet-scroll-container {
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.sheet-scroll-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

table.sheet-table {
    border-collapse: collapse !important;
    width: 100% !important;
}

table.sheet-table th,
.sheet-table th {
    background-color: #1E3A8A !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.72rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    padding: 9px 8px !important;
    border: 1px solid #1E3A8A !important;
    border-bottom: 2px solid #0F172A !important;
    user-select: none !important;
    white-space: nowrap !important;
}

table.sheet-table td,
.sheet-table td {
    padding: 0 !important;
    border: 1px solid #E2E8F0 !important;
    background-color: #FFFFFF !important;
    position: relative !important;
    vertical-align: middle !important;
}

table.sheet-table tr#row-empty td,
.sheet-table tr#row-empty td {
    padding: 65px 20px !important;
    height: 380px !important;
    border: none !important;
    border-bottom: none !important;
    vertical-align: middle !important;
    background-color: #FFFFFF !important;
}

table.sheet-table tr:hover td {
    background-color: #F8FAFC !important;
}

table.sheet-table tr.saving-row td {
    background-color: #EFF6FF !important;
}

table.sheet-table tr.just-saved-row td {
    background-color: #F0FDF4 !important;
    transition: background-color 0.8s ease;
}

.sheet-input {
    width: 100% !important;
    height: 36px !important;
    padding: 4px 8px !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    color: #1E293B !important;
    background: transparent !important;
    border: 2px solid transparent !important;
    outline: none !important;
    transition: all 0.12s ease !important;
}

.sheet-input:focus {
    background: #FFFFFF !important;
    border-color: #2563EB !important;
    box-shadow: inset 0 0 0 1px #2563EB, 0 0 0 2px rgba(37,99,235,0.2) !important;
    z-index: 10 !important;
}

.sheet-input-valor {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: -0.01em !important;
    color: #059669 !important;
}
.sheet-input-valor:focus {
    color: #047857 !important;
}
