/* Custom CSS for Spare Parts Inventory System */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
}

/* General Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Enhanced Tables */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
    cursor: pointer;
}

.table th {
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

/* Card Enhancements */
.card {
    border-radius: 8px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Badge Styles */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* HTMX Indicators */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Inline Edit Styles */
[hx-trigger="dblclick"] {
    border-bottom: 1px dashed #ccc;
    transition: background-color 0.2s;
}

[hx-trigger="dblclick"]:hover {
    background-color: #f0f0f0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group-sm > .btn {
        padding: 0.15rem 0.3rem;
        font-size: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar, .footer, .btn, .btn-group {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Alert Improvements */
.alert {
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
}

.alert-danger {
    border-left-color: var(--danger-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-info {
    border-left-color: var(--info-color);
}

/* Form Enhancements */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Navigation Active States */
.navbar-nav .nav-link.active {
    font-weight: 600;
}

/* Stock Status Colors */
.stock-low {
    color: var(--danger-color);
    font-weight: bold;
}

.stock-medium {
    color: var(--warning-color);
    font-weight: bold;
}

.stock-high {
    color: var(--success-color);
    font-weight: bold;
}

/* Dashboard Cards */
.dashboard-stat-card {
    transition: transform 0.2s;
}

.dashboard-stat-card:hover {
    transform: translateY(-5px);
}

/* OCR Scanner Overlay */
.scanner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* PWA Install Banner */
.install-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

/* Accessibility Improvements */
.visually-hidden-focusable:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}
