/* Custom Styles for Vehicle Maintenance System */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Font Family */
.font-poppins {
    font-family: 'Poppins', sans-serif;
}

/* Custom Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-10px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Card Hover Effects */
.vehicle-card {
    animation: fadeIn 0.5s ease-out;
    transition: all 0.3s ease;
}

.vehicle-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Service Status Colors */
.status-completed {
    @apply bg-green-100 text-green-800;
}

.status-pending {
    @apply bg-yellow-100 text-yellow-800;
}

.status-overdue {
    @apply bg-red-100 text-red-800;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading Animation */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Input Focus Effects */
.input-focus:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
    border-color: #3b82f6;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Responsive Table */
@media (max-width: 640px) {
    .responsive-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Custom Button Styles */
.btn-primary {
    @apply bg-blue-500 text-white font-medium py-2 px-4 rounded-lg 
           hover:bg-blue-600 transition-colors duration-300 
           focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50;
}

.btn-success {
    @apply bg-green-500 text-white font-medium py-2 px-4 rounded-lg 
           hover:bg-green-600 transition-colors duration-300 
           focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-opacity-50;
}

.btn-danger {
    @apply bg-red-500 text-white font-medium py-2 px-4 rounded-lg 
           hover:bg-red-600 transition-colors duration-300 
           focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-opacity-50;
}

/* Improved Dropdown Styles */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.75rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    min-width: 14rem;
}

.dropdown-container:hover .dropdown-menu,
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Dropdown arrow */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 1.5rem;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
    border-top: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb;
}

/* Dropdown items */
.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #374151;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
    color: #1d4ed8;
}

.dropdown-item-danger {
    color: #dc2626;
}

.dropdown-item-danger:hover {
    background-color: #fef2f2;
    color: #b91c1c;
}

/* Smooth transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

/* Z-index untuk layering yang tepat */
.z-50 {
    z-index: 50;
}

.z-60 {
    z-index: 60;
}

/* Hover effects */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Focus styles untuk aksesibilitas */
.focus-ring {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.focus-ring:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}