/* Custom styles for Restaurant Inventory Management App */

/* Odoo-style improvements */
.nav-item.active {
    background-color: #dbeafe;
    color: #2563eb;
    border-right: 3px solid #2563eb;
}

/* Smooth transitions */
* {
    transition: all 0.2s ease-in-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Table improvements */
.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Modal animations */
.modal {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button hover effects */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Status indicators */
.status-low {
    background-color: #fef2f2;
    color: #dc2626;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-ok {
    background-color: #f0fdf4;
    color: #16a34a;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive improvements */
@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    #sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 640px) {
    .grid-cols-1 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .py-4 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 50;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

/* Mobile overlay */
.mobile-overlay {
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}

/* Mobile sidebar enhancements */
@media (max-width: 1023px) {
    #sidebar {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        height: 100vh;
        overflow-y: auto;
    }
    
    #sidebar.open {
        transform: translateX(0);
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    /* Hide scrollbar on mobile sidebar */
    #sidebar::-webkit-scrollbar {
        width: 0px;
        background: transparent;
    }
    
    /* Mobile navigation items */
    .nav-item {
        border-radius: 0.5rem;
        margin: 0.25rem 0.5rem;
        transition: all 0.2s ease;
    }
    
    .nav-item:hover {
        background-color: #eff6ff;
        transform: translateX(4px);
    }
    
    .nav-item.active {
        background-color: #dbeafe;
        color: #2563eb;
        font-weight: 600;
    }
    
    /* Mobile header adjustments */
    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 20;
        background: white;
        border-bottom: 1px solid #e5e7eb;
    }
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    .mobile-menu-btn {
        top: 0.75rem;
        left: 0.75rem;
        padding: 0.5rem;
    }
    
    #sidebar {
        width: 280px;
    }
    
    .nav-item {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .nav-item i {
        font-size: 1.1rem;
        width: 1.5rem;
    }
}

@media (max-width: 480px) {
    #sidebar {
        width: 100vw;
    }
    
    .mobile-menu-btn {
        top: 0.5rem;
        left: 0.5rem;
        padding: 0.4rem;
    }
}

/* Form improvements */
.form-input {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Notification improvements */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Dashboard card animations */
.dashboard-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

/* Icon improvements */
.icon-primary {
    color: #3b82f6;
}

.icon-success {
    color: #16a34a;
}

.icon-warning {
    color: #d97706;
}

.icon-danger {
    color: #dc2626;
}

/* Table row hover effects */
.table-row:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
}

/* Action buttons */
.action-btn {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn.edit {
    color: #3b82f6;
}

.action-btn.edit:hover {
    color: #1d4ed8;
    background-color: #dbeafe;
}

.action-btn.delete {
    color: #dc2626;
}

.action-btn.delete:hover {
    color: #b91c1c;
    background-color: #fef2f2;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Image Upload Styles */
.image-upload-container {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: border-color 0.2s ease;
}

.image-upload-container:hover {
    border-color: #3b82f6;
}

.image-upload-container.dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.file-input-label {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #3b82f6;
    color: white;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.file-input-label:hover {
    background-color: #2563eb;
}

.image-preview {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
}

.image-preview-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.base64-textarea {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    line-height: 1.2;
}

/* Drag and drop styles */
.drag-drop-zone {
    border: 2px dashed #9ca3af;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.drag-drop-zone:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.drag-drop-zone.dragover {
    border-color: #3b82f6;
    background-color: #dbeafe;
    transform: scale(1.02);
}

.drag-drop-text {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Loading states for image processing */
.image-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.image-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Print styles */
@media print {
    #sidebar,
    .no-print {
        display: none !important;
    }
    
    .section {
        display: block !important;
    }
    
    body {
        background: white !important;
    }
}
