/* 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 {
    @apply text-white px-3 py-2 rounded-md text-sm font-medium hover:bg-blue-700 hover:bg-opacity-50 transition-all duration-200 flex items-center gap-1;
}

/* Dropdown Container */
.dropdown-tw {
    @apply relative;
}

/* Dropdown Menu */
.dropdown-menu-tw {
    @apply absolute left-0 mt-2 w-48 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 z-50 hidden;
}

.dropdown-menu-right {
    @apply left-auto right-0;
}

/* Dropdown Items */
.dropdown-item-tw {
    @apply block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition-colors duration-150;
}

/* Mobile Nav Links */
.mobile-nav-link {
    @apply block px-3 py-2 rounded-md text-base font-medium text-white hover:bg-blue-600 transition-colors duration-200;
}

/* 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;
}

.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;
    }
}
