/* FILE: assets/css/style.css */
/* BOM Calculator Enhanced Styles */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* KBD Styling for keyboard shortcuts */
kbd {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Select2 dropdown positioning for BOM modal */
.select2-container {
    z-index: 9999 !important;
}

/* For Frappe Gantt Chart Styling */
.gantt .bar-label {
    font-size: 12px;
    font-weight: 500;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.report-tabs-wrapper {
    overflow-x: auto;
    padding-bottom: 0.75rem;
    margin-bottom: -0.5rem;
    scrollbar-width: thin;
    scrollbar-color: #2563eb #e5e7eb;
}

.report-tabs-wrapper::-webkit-scrollbar {
    height: 6px;
}

.report-tabs-wrapper::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 9999px;
}

.report-tabs-wrapper::-webkit-scrollbar-thumb {
    background: #2563eb;
    border-radius: 9999px;
}

.report-tabs-wrapper::-webkit-scrollbar-thumb:hover {
    background: #1e40af;
}

/* Login: minimal, white, Google-like */
.btn-press {
    transition: transform 120ms ease, box-shadow 120ms ease;
    transform: translateZ(0);
    will-change: transform;
}
.btn-press:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12) inset;
}

/* Improve default input contrast for date filters and modals */
input[type="date"],
input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
    color: #111827; /* gray-900 */
}
::placeholder { color: #9CA3AF; } /* gray-400 */

/* Explicitly set background for inputs/selects to avoid inheriting dark bg in modals */
input[type="date"], input[type="text"], input[type="number"], input[type="password"], select, textarea {
    background-color: #ffffff;
}

/* Ensure Select2 dropdown text is readable on light background */
.select2-container .select2-selection--single .select2-selection__rendered { color: #111827; }
.select2-dropdown { color: #111827; background: #ffffff; }
.select2-results__option { color: #111827; }

/* Ensure modal texts on light backgrounds are readable */
.swal2-popup, .swal2-container * {
    color: #111827; /* gray-900 */
}

/* For removing number input spinners */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Floating Action Button (FAB) Styles */
.fab {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.fab:hover {
    transform: scale(1.05);
}

/* Loader Animation Styles */
.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #FFF;
    border-bottom-color: #3B82F6; /* blue-600 */
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

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

/* Sidebar Fixes */
#sidebar {
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    width: 280px;
}

/* Ensure proper scrolling behavior */
#sidebar nav {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

/* Sidebar group styling */
#sidebar .group-header {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: rgba(209, 213, 219, 1);
    border-bottom: 1px solid rgba(75, 85, 99, 1);
    padding-bottom: 0.5rem;
}

#sidebar .group-header:first-child {
    margin-top: 0.5rem;
}

/* Sidebar navigation links */
#sidebar nav a {
    margin: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
}

#sidebar nav a:hover {
    background-color: rgba(55, 65, 81, 1);
    transform: translateX(3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#sidebar nav a.bg-gray-900 {
    background-color: rgba(37, 99, 235, 1);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

#sidebar nav a.bg-gray-900:hover {
    background-color: rgba(29, 78, 216, 1);
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Add spacing after each navigation item group */
#sidebar nav a:last-of-type {
    margin-bottom: 0.5rem;
}

/* Department Progress Modal Enhancements */
/* Department Progress Styling */
.dept-progress-row {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

/* Work Order Management Modal Improvements */
.dept-progress-row .form-input,
.dept-progress-row .form-select {
    min-width: 140px;
}

.dept-progress-row input[type="datetime-local"] {
    min-width: 160px;
}

.dept-progress-row .col-span-2 {
    min-width: 0; /* Prevent flex overflow */
}

/* Sales Module - Production Status Indicators */
.production-item-checkbox:checked {
    accent-color: #059669; /* Green for available items */
}

/* Enhanced shadows for status indicators */
.shadow-green-100 {
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.1), 0 2px 4px -1px rgba(16, 185, 129, 0.06);
}

.shadow-amber-100 {
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.1), 0 2px 4px -1px rgba(245, 158, 11, 0.06);
}

.shadow-blue-100 {
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1), 0 2px 4px -1px rgba(59, 130, 246, 0.06);
}

/* Hover effects for production status items */
.border-green-400:hover {
    border-color: #059669;
    transform: translateY(-1px);
}

.border-amber-400:hover {
    border-color: #d97706;
    transform: translateY(-1px);
}

.border-blue-300:hover {
    border-color: #2563eb;
}

.dept-progress-row:hover {
    background-color: rgba(249, 250, 251, 1);
    border-left-color: rgba(59, 130, 246, 1);
}

.dept-progress-row.completed {
    background-color: rgba(240, 253, 244, 1);
    border-left-color: rgba(34, 197, 94, 1);
}

.dept-progress-row.in-progress {
    background-color: rgba(239, 246, 255, 1);
    border-left-color: rgba(59, 130, 246, 1);
}

.dept-status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.dept-status-icon.completed {
    background-color: rgba(34, 197, 94, 1);
    color: white;
}

.dept-status-icon.in-progress {
    background-color: rgba(59, 130, 246, 1);
    color: white;
}

.dept-status-icon.not-started {
    background-color: rgba(156, 163, 175, 1);
    color: white;
}

/* Production Cards Enhancement */
.production-card {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

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

.production-item-completed {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 4px solid #22c55e;
}

.production-item-in-progress {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #3b82f6;
}

.status-badge-completed {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2);
}

.status-badge-in-progress {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.status-badge-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}


/* Department Progress Modal Enhancements */
/* Department Progress Styling */
.dept-progress-row {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

/* Work Order Management Modal Improvements */
.dept-progress-row .form-input,
.dept-progress-row .form-select {
    min-width: 140px;
}

.dept-progress-row input[type="datetime-local"] {
    min-width: 160px;
}

.dept-progress-row .col-span-2 {
    min-width: 0; /* Prevent flex overflow */
}

/* Sales Module - Production Status Indicators */
.production-item-checkbox:checked {
    accent-color: #059669; /* Green for available items */
}

/* Enhanced shadows for status indicators */
.shadow-green-100 {
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.1), 0 2px 4px -1px rgba(16, 185, 129, 0.06);
}

.shadow-amber-100 {
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.1), 0 2px 4px -1px rgba(245, 158, 11, 0.06);
}

.shadow-blue-100 {
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1), 0 2px 4px -1px rgba(59, 130, 246, 0.06);
}

/* Hover effects for production status items */
.border-green-400:hover {
    border-color: #059669;
    transform: translateY(-1px);
}

.border-amber-400:hover {
    border-color: #d97706;
    transform: translateY(-1px);
}

.border-blue-300:hover {
    border-color: #2563eb;
}

.dept-progress-row:hover {
    background-color: rgba(249, 250, 251, 1);
    border-left-color: rgba(59, 130, 246, 1);
}

.dept-progress-row.completed {
    background-color: rgba(240, 253, 244, 1);
    border-left-color: rgba(34, 197, 94, 1);
}

.dept-progress-row.in-progress {
    background-color: rgba(239, 246, 255, 1);
    border-left-color: rgba(59, 130, 246, 1);
}

.dept-status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.dept-status-icon.completed {
    background-color: rgba(34, 197, 94, 1);
    color: white;
}

.dept-status-icon.in-progress {
    background-color: rgba(59, 130, 246, 1);
    color: white;
}

.dept-status-icon.not-started {
    background-color: rgba(156, 163, 175, 1);
    color: white;
}

/* Production Cards Enhancement */
.production-card {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

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

.production-item-completed {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 4px solid #22c55e;
}

.production-item-in-progress {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #3b82f6;
}

.status-badge-completed {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2);
}

.status-badge-in-progress {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.status-badge-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

/* Date and Time Input Enhancements */
input[type="datetime-local"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath fill='%236B7280' fill-rule='evenodd' d='M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z' clip-rule='evenodd'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

input[type="datetime-local"]:focus {
    border-color: rgba(59, 130, 246, 1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Form Select Enhancements */
.dept-progress-row select:focus {
    border-color: rgba(59, 130, 246, 1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dept-progress-row input:focus {
    border-color: rgba(59, 130, 246, 1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Multi-select styling */
select[multiple] {
    max-height: 80px;
    overflow-y: auto;
}

select[multiple]:focus {
    outline: none;
}

/* Checkbox styling */
input[type="checkbox"].dept-skip {
    width: 1rem;
    height: 1rem;
    accent-color: rgba(239, 68, 68, 1);
}

/* Responsive datetime inputs */
@media (max-width: 768px) {
    input[type="datetime-local"] {
        font-size: 0.75rem;
        padding: 0.375rem;
    }
}

/* Main app layout fixes */
#main-app {
    height: 100vh;
    overflow: hidden;
}

#app-content {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

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

#sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Ensure content doesn't get hidden behind fixed elements */
.main-content {
    padding-bottom: 2rem;
}

/* Fix for mobile responsiveness */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    
    #sidebar.show {
        transform: translateX(0);
    }
    
    #main-app {
        margin-left: 0;
    }
}