/* Custom CSS for Product Dashboard */

/* Dark mode transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-track {
    background: #374151;
}

.dark ::-webkit-scrollbar-thumb {
    background: #6b7280;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Navigation active state */
.nav-item.active {
    background-color: #dbeafe;
    color: #1e40af;
}

.dark .nav-item.active {
    background-color: #1e3a8a;
    color: #93c5fd;
}

/* Table hover effects */
tbody tr:hover {
    background-color: #f8fafc;
}

.dark tbody tr:hover {
    background-color: #374151;
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Custom button styles */
.btn-primary {
    @apply bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md transition-colors duration-200;
}

.btn-secondary {
    @apply bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300 font-medium py-2 px-4 rounded-md transition-colors duration-200;
}

/* Status badges */
.status-active {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200;
}

.status-inactive {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200;
}

/* Stock level indicators */
.stock-high {
    @apply text-green-600 dark:text-green-400;
}

.stock-medium {
    @apply text-yellow-600 dark:text-yellow-400;
}

.stock-low {
    @apply text-red-600 dark:text-red-400;
}

/* Three.js container */
#threejs-container {
    position: relative;
    overflow: hidden;
}

/* Chart containers */
canvas {
    max-width: 100%;
    height: auto;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .grid-cols-1 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .text-2xl {
        font-size: 1.5rem;
    }
    
    .p-6 {
        padding: 1rem;
    }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .lg\:grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Animation for sidebar */
.sidebar-transition {
    transition: transform 0.3s ease-in-out;
}

/* Search highlight */
.search-highlight {
    background-color: #fef3c7;
    padding: 2px 4px;
    border-radius: 2px;
}

.dark .search-highlight {
    background-color: #92400e;
    color: #fbbf24;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Custom focus styles */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
    border-color: #3b82f6;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible for better accessibility */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.dark .dropdown-content {
    background-color: #374151;
    border-color: #4b5563;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Responsive text */
@media (max-width: 640px) {
    .text-responsive {
        font-size: 0.875rem;
    }
}

/* Custom grid for mobile */
@media (max-width: 640px) {
    .mobile-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Enhanced button hover effects */
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dark button:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Table sorting indicators */
.sort-asc::after {
    content: " ↑";
    color: #3b82f6;
}

.sort-desc::after {
    content: " ↓";
    color: #3b82f6;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
