/* Custom styles for BarERP Frontend */

/* Dashboard Cards - Compact Design */
.dashboard-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.dashboard-card .card-body {
    padding: 0.75rem !important;
}

.dashboard-card .card-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dashboard-card h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
}

.dashboard-card i {
    transition: opacity 0.2s ease-in-out;
}

.dashboard-card:hover i {
    opacity: 1 !important;
}

/* Responsive Dashboard */
@media (max-width: 1200px) {
    .dashboard-card .card-title {
        font-size: 0.8rem;
    }
    
    .dashboard-card h4 {
        font-size: 1.25rem;
    }
    
    .dashboard-card i {
        font-size: 1.25rem !important;
    }
}

@media (max-width: 768px) {
    .dashboard-card .card-body {
        padding: 0.5rem !important;
    }
    
    .dashboard-card .card-title {
        font-size: 0.75rem;
    }
    
    .dashboard-card h4 {
        font-size: 1.1rem;
    }
    
    .dashboard-card i {
        font-size: 1rem !important;
    }
}

/* Recent Activities - Compact */
#dashboard .card-header {
    padding: 0.5rem 1rem;
}

#dashboard .card-body {
    padding: 0.5rem 1rem;
}

/* Language Selector */
.nav-item.dropdown .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    transition: color 0.2s ease-in-out;
}

.nav-item.dropdown .nav-link:hover {
    color: rgba(255, 255, 255, 1) !important;
}

.nav-item.dropdown .dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.nav-item.dropdown .dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color 0.2s ease-in-out;
}

/* Edit Product Modal Styles */
#editProductModal .modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#editProductModal .form-label {
    font-weight: 600;
    color: #495057;
}

#editProductModal .form-control,
#editProductModal .form-select {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#editProductModal .form-control:focus,
#editProductModal .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#editProductModal .input-group-text {
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    color: #6c757d;
}

#editProductModal .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

#editProductModal .btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

#editProductModal .btn-primary:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
}

.nav-item.dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

/* Language indicator */
#currentLanguage {
    font-weight: 600;
    font-size: 0.875rem;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-brand img {
    max-height: 32px;
    width: auto;
    object-fit: contain;
}

/* Clickable navbar brand for General Managers and higher */
.navbar-brand[title="Click to change organization logo"] {
    transition: opacity 0.2s ease;
}

.navbar-brand[title="Click to change organization logo"]:hover {
    opacity: 0.8;
}

.content-section {
    min-height: 500px;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
}

.table td {
    vertical-align: middle;
}

.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Dashboard cards */
.card.text-white {
    transition: transform 0.2s ease-in-out;
    height: 100%; /* Ensure all cards have the same height */
    display: flex;
    flex-direction: column;
}

.card.text-white:hover {
    transform: translateY(-2px);
}

/* Dashboard card body to fill available space */
.card.text-white .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Dashboard card title and number spacing */
.card.text-white .card-title {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.2;
    min-height: 2.4rem; /* Ensure consistent title height */
    display: flex;
    align-items: center;
}

.card.text-white h2 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1;
    min-height: 3rem; /* Ensure consistent number height */
    display: flex;
    align-items: center;
}

/* Dashboard card interactions */
.dashboard-card {
    transition: all 0.2s ease-in-out;
    border: 2px solid transparent;
}

/* Dashboard row to ensure equal height cards */
#dashboard .row:first-of-type {
    align-items: stretch;
}

#dashboard .col-md-3 {
    display: flex;
    flex-direction: column;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.dashboard-card:active {
    transform: translateY(-1px);
    transition: transform 0.1s ease-in-out;
}

/* Navigation active state */
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 0.375rem;
}

/* Table actions */
.action-buttons .btn {
    margin-right: 0.25rem;
}

.action-buttons .btn:last-child {
    margin-right: 0;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Table Loading Indicators */
.table-loading-overlay {
    position: relative;
}

.table-loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: none;
    border-radius: 0.375rem;
}

.table-loading-overlay.loading::before {
    display: block;
}

.table-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    display: none;
}

.table-loading-overlay.loading .table-loading-spinner {
    display: block;
}

.table-loading-spinner .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2em;
    color: #0d6efd;
}

.table-loading-text {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    display: none;
}

.table-loading-overlay.loading .table-loading-text {
    display: block;
}

/* Role-based Access Control (RBAC) */
.admin-only {
    /* Admin only features */
}

.gm-or-higher {
    /* General Manager or higher features */
}

.manager-or-higher {
    /* Manager or higher features */
}

.employee-or-higher {
    /* Employee or higher features */
}

/* Hide elements by default for role-based access */
.admin-only,
.gm-or-higher,
.manager-or-higher,
.employee-or-higher {
    display: none;
}

/* Show elements when user has appropriate role */
.admin-only.show,
.gm-or-higher.show,
.manager-or-higher.show,
.employee-or-higher.show {
    display: inline-block;
}

/* For table rows and other block elements */
.admin-only.show,
.gm-or-higher.show,
.manager-or-higher.show,
.employee-or-higher.show {
    display: block;
}

/* For buttons and inline elements */
.btn.admin-only.show,
.btn.gm-or-higher.show,
.btn.manager-or-higher.show,
.btn.employee-or-higher.show {
    display: inline-block;
}

/* For navigation items */
.nav-item.admin-only.show,
.nav-item.gm-or-higher.show,
.nav-item.manager-or-higher.show,
.nav-item.employee-or-higher.show {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }

    .action-buttons .btn {
        margin-bottom: 0.25rem;
    }
    
    .action-buttons .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Mobile dashboard card adjustments */
    .card.text-white h2 {
        font-size: 2rem;
    }
    
    .card.text-white .card-title {
        font-size: 0.9rem;
    }
}

/* Inventory table styles */
.inventory-table .badge {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

/* Refresh button animation */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Notification container */
#notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    pointer-events: none;
    max-height: calc(100vh - 40px);
    overflow: visible;
}

/* Popup notification styles */
.popup-notification {
    position: relative;
    min-width: 300px;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    overflow: hidden;
    pointer-events: auto;
}

.popup-notification.show {
    transform: translateX(0);
}

.popup-notification.hide {
    transform: translateX(100%);
}

.popup-notification .popup-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.popup-notification .popup-body {
    padding: 16px;
    font-size: 14px;
    line-height: 1.4;
}

.popup-notification .popup-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.popup-notification .popup-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.popup-notification .popup-icon {
    margin-right: 8px;
    font-size: 16px;
}

/* Popup notification types */
.popup-notification.success {
    border-left: 4px solid #28a745;
}

.popup-notification.success .popup-header {
    background: rgba(40, 167, 69, 0.1);
}

.popup-notification.danger {
    border-left: 4px solid #dc3545;
}

.popup-notification.danger .popup-header {
    background: rgba(220, 53, 69, 0.1);
}

.popup-notification.info {
    border-left: 4px solid #17a2b8;
}

.popup-notification.info .popup-header {
    background: rgba(23, 162, 184, 0.1);
}

.popup-notification.warning {
    border-left: 4px solid #ffc107;
}

.popup-notification.warning .popup-header {
    background: rgba(255, 193, 7, 0.1);
}

/* Multiple notifications stack automatically with flexbox */
.popup-notification {
    margin-bottom: 0;
}

/* Animation improvements for bottom-right positioning */
.popup-notification {
    animation: slideInFromRight 0.3s ease-out;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive notifications for mobile */
@media (max-width: 768px) {
    #notification-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .popup-notification {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

.inventory-table td {
    vertical-align: top;
    padding: 1rem 0.75rem;
}

.inventory-table .product-details strong {
    color: #495057;
}

.inventory-table .store-details strong {
    color: #495057;
}

.inventory-table .text-muted {
    font-size: 0.875rem;
}

.inventory-table .text-info {
    font-weight: 500;
}

.inventory-table .text-secondary {
    font-size: 0.8rem;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation for content sections */
.content-section {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status indicators */
.status-online {
    color: #198754;
}

.status-offline {
    color: #dc3545;
}

.status-connecting {
    color: #ffc107;
}

/* Tooltip styles */
.tooltip-inner {
    background-color: #212529;
    border-radius: 0.375rem;
}

/* Custom checkbox and radio styles */
.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Success/Error message animations */
.alert-success, .alert-danger {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Language Selector Styles */
.language-selector {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
}

.language-selector .btn-group {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

.language-selector .btn-outline-primary {
    border-color: #dee2e6;
    color: #6c757d;
    transition: all 0.2s ease;
    border-radius: 0;
    padding: 0.75rem 1rem;
    font-weight: 500;
}

.language-selector .btn-outline-primary:first-child {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

.language-selector .btn-outline-primary:last-child {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.language-selector .btn-outline-primary:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    background-color: #f8f9fa;
    transform: translateY(-1px);
}

.language-selector .btn-check:checked + .btn-outline-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
    transform: scale(1.02);
}

.language-selector .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.language-selector .form-label i {
    margin-right: 0.5rem;
    color: #0d6efd;
}

/* Login form specific styles */
.login-card .card-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: white;
    border-bottom: none;
}

.login-card .card-header h4 {
    margin: 0;
    font-weight: 600;
}

.login-card .card-body {
    padding: 2rem;
}

.login-card .form-control {
    border-radius: 0.5rem;
    border: 2px solid #e9ecef;
    transition: border-color 0.2s ease;
}

.login-card .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.login-card .btn-primary {
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.login-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

/* Elegant Language Selector Styles */
.language-selector-elegant .btn-link {
    text-decoration: none;
    border: none;
    background: none;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    transition: all 0.3s ease;
}

.language-selector-elegant .btn-link:hover {
    color: var(--bs-primary) !important;
    transform: scale(1.05);
}

.language-selector-elegant .btn-link:focus {
    box-shadow: none;
    outline: none;
}

.language-selector-elegant .dropdown-menu {
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: auto;
    width: max-content;
    white-space: nowrap;
}

.language-selector-elegant .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.language-selector-elegant .dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--bs-primary);
    transform: translateX(2px);
}

.language-selector-elegant .dropdown-item i {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
}

/* Enhanced login card */
.login-card {
    border: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-radius: 12px;
    overflow: hidden;
}

.login-card .card-header {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 1.5rem;
}

/* Navbar Language Selector Enhancement */
.navbar .dropdown-menu .dropdown-item i {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
    opacity: 0.8;
}

.navbar .dropdown-menu .dropdown-item:hover i {
    opacity: 1;
    color: var(--bs-primary);
}

.navbar .dropdown-menu .dropdown-item {
    transition: all 0.2s ease;
}

.navbar .dropdown-menu .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

/* Auto-size dropdowns to content width */
.navbar .dropdown-menu {
    min-width: auto;
    width: max-content;
    white-space: nowrap;
}

/* Specific styling for language dropdown */
.navbar .nav-item.dropdown .dropdown-menu {
    padding: 0.25rem 0;
}

/* Specific styling for user menu dropdown */
#userMenu .dropdown-menu {
    padding: 0.5rem 0;
}

/* Ensure dropdown items don't wrap */
.navbar .dropdown-item {
    white-space: nowrap;
    padding: 0.375rem 1rem;
}



/* Column Visibility Controls */
#columnVisibilityControls {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

#columnVisibilityControls h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.column-toggle {
    margin-right: 0.5rem;
}

.form-check-inline {
    margin-right: 1rem;
    margin-bottom: 0.5rem;
}

.form-check-inline:last-child {
    margin-right: 0;
}



/* Responsive table styles */
@media (max-width: 768px) {
    .form-check-inline {
        margin-right: 0.5rem;
        margin-bottom: 0.25rem;
    }
    
    #columnVisibilityControls {
        padding: 0.75rem;
    }
}

/* Password toggle button styles - default for forms with generate button */
.password-toggle {
    position: absolute !important;
    right: 50px !important; /* Position to the left of the generate button */
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
    border: none !important;
    background: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    height: 20px !important;
    width: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #6c757d !important;
    transition: color 0.2s ease !important;
}

/* Password toggle button styles for login and simple forms */
.password-toggle-simple {
    position: absolute !important;
    right: 10px !important; /* Original position for login and simple forms */
    top: 50% !important;
    transform: translateY(+20%) !important;
    z-index: 10 !important;
    border: none !important;
    background: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    height: 20px !important;
    width: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #6c757d !important;
    transition: color 0.2s ease !important;
}

.password-toggle:hover,
.password-toggle-simple:hover {
    color: #495057 !important;
}

.password-toggle:focus,
.password-toggle-simple:focus {
    outline: none !important;
    box-shadow: none !important;
}

.password-toggle i {
    font-size: 1.1rem;
}

/* Password strength indicator styles */
.password-strength {
    margin-top: 0.5rem;
}

.password-strength-bar {
    width: 100%;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.password-strength-fill.weak {
    width: 25%;
    background-color: #dc3545;
}

.password-strength-fill.fair {
    width: 50%;
    background-color: #ffc107;
}

.password-strength-fill.good {
    width: 75%;
    background-color: #17a2b8;
}

.password-strength-fill.strong {
    width: 100%;
    background-color: #28a745;
}

.password-strength-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.password-strength-text.weak {
    color: #dc3545;
}

.password-strength-text.fair {
    color: #ffc107;
}

.password-strength-text.good {
    color: #17a2b8;
}

.password-strength-text.strong {
    color: #28a745;
}

/* Password input group styling */
.input-group:has(#userPassword),
.input-group:has(#editUserPassword) {
    position: relative;
}

/* Password generation button */
#generatePasswordBtn,
#editGeneratePasswordBtn {
    border-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

#generatePasswordBtn:hover,
#editGeneratePasswordBtn:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

#generatePasswordBtn:focus,
#editGeneratePasswordBtn:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

/* Table Sorting Styles */
.table th a {
    color: inherit;
    text-decoration: none;
}

.table th a:hover {
    color: #0d6efd;
    text-decoration: none;
}

.table th a i {
    opacity: 0.5;
    transition: opacity 0.2s ease-in-out;
    font-size: 0.875rem;
    margin-left: 4px;
}

.table th a:hover i {
    opacity: 1;
}

/* Active sort indicator */
.table th a.sort-active i {
    opacity: 1;
    color: #0d6efd;
}

.table th a.sort-asc i::before {
    content: "\f0de"; /* bi-arrow-up */
}

.table th a.sort-desc i::before {
    content: "\f0dd"; /* bi-arrow-down */
}

/* Login Loading Screen Styles */
.login-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.login-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.login-loading-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #495057;
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-loading-subtext {
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
}

/* Login form disabled state */
.login-form-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Contact Information Styles */
.contact-info {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-top: 1rem;
}

.contact-info a {
    color: #0d6efd;
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-info a:hover {
    color: #0b5ed7;
    text-decoration: underline;
}

.contact-info i {
    margin-right: 0.25rem;
    opacity: 0.8;
}

.login-form-loading .btn-primary {
    position: relative;
}

.login-form-loading .btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Product Search Styles */
#productSearchInput {
    border-radius: 0.375rem 0 0 0.375rem;
    border-right: none;
    transition: all 0.2s ease;
}

#productSearchInput:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    z-index: 3;
}

#productSearchInput:focus + .input-group-text {
    border-color: #0d6efd;
    z-index: 3;
}

#clearProductSearch {
    border-radius: 0 0.375rem 0.375rem 0;
    border-left: none;
    transition: all 0.2s ease;
}

#clearProductSearch:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

#clearProductSearch:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

#refreshProductsBtn {
    transition: all 0.2s ease;
}

#refreshProductsBtn:hover {
    transform: rotate(180deg);
}

#refreshProductsBtn.spin {
    animation: spin 1s linear infinite;
}

#productSearchResults {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Search input group styling */
.input-group:has(#productSearchInput) .input-group-text {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #6c757d;
    transition: all 0.2s ease;
}

.input-group:has(#productSearchInput) .input-group-text:hover {
    background-color: #e9ecef;
    color: #495057;
}

/* Responsive search layout */
@media (max-width: 768px) {
    #productSearchInput {
        font-size: 0.875rem;
    }
    
    #productSearchResults {
        font-size: 0.8rem;
        margin-right: 0.5rem !important;
    }
    
    .input-group {
        margin-bottom: 0.5rem;
    }
}

#refreshInventoryBtn {
    transition: all 0.2s ease;
}
#refreshInventoryBtn:hover {
    transform: rotate(180deg);
}
#refreshInventoryBtn.spin {
    animation: spin 1s linear infinite;
}
#inventorySearchResults {
    font-size: 0.875rem;
    font-weight: 500;
}
/* Responsive inventory search layout */
@media (max-width: 768px) {
    #inventorySearchResults {
        font-size: 0.8rem;
        margin-right: 0.5rem !important;
    }
}

/* Services Search Styles */
#serviceSearchInput {
    border-radius: 0.375rem 0 0 0.375rem;
    border-right: none;
    transition: all 0.2s ease;
}
#serviceSearchInput:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    z-index: 3;
}
#serviceSearchInput:focus + .input-group-text {
    border-color: #0d6efd;
    z-index: 3;
}
#clearServiceSearch {
    border-radius: 0 0.375rem 0.375rem 0;
    border-left: none;
    transition: all 0.2s ease;
}
#clearServiceSearch:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}
#clearServiceSearch:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}
#refreshServicesBtn {
    transition: all 0.2s ease;
}
#refreshServicesBtn:hover {
    transform: rotate(180deg);
}
#refreshServicesBtn.spin {
    animation: spin 1s linear infinite;
}
#serviceSearchResults {
    font-size: 0.875rem;
    font-weight: 500;
}
/* Services search input group styling */
.input-group:has(#serviceSearchInput) .input-group-text {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #6c757d;
    transition: all 0.2s ease;
}
.input-group:has(#serviceSearchInput) .input-group-text:hover {
    background-color: #e9ecef;
    color: #495057;
}
/* Responsive services search layout */
@media (max-width: 768px) {
    #serviceSearchInput {
        font-size: 0.875rem;
    }
    #serviceSearchResults {
        font-size: 0.8rem;
        margin-right: 0.5rem !important;
    }
    .input-group {
        margin-bottom: 0.5rem;
    }
}

/* Inventory Product Name Filter Search Styles */
#inventoryProductNameFilter {
    border-radius: 0.375rem 0 0 0.375rem;
    border-right: none;
    transition: all 0.2s ease;
}
#inventoryProductNameFilter:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    z-index: 3;
}
#inventoryProductNameFilter:focus + .input-group-text {
    border-color: #0d6efd;
    z-index: 3;
}
#clearInventoryProductSearch {
    border-radius: 0 0.375rem 0.375rem 0;
    border-left: none;
    transition: all 0.2s ease;
}
#clearInventoryProductSearch:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}
#clearInventoryProductSearch:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}
/* Inventory product name filter input group styling */
.input-group:has(#inventoryProductNameFilter) .input-group-text {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #6c757d;
    transition: all 0.2s ease;
}
.input-group:has(#inventoryProductNameFilter) .input-group-text:hover {
    background-color: #e9ecef;
    color: #495057;
}

/* Transfer Product Filter Search Styles */
#transferProductFilter {
    border-radius: 0.375rem 0 0 0.375rem;
    border-right: none;
    transition: all 0.2s ease;
}
#transferProductFilter:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    z-index: 3;
}
#transferProductFilter:focus + .input-group-text {
    border-color: #0d6efd;
    z-index: 3;
}
#clearTransferProductSearch {
    border-radius: 0 0.375rem 0.375rem 0;
    border-left: none;
    transition: all 0.2s ease;
}
#clearTransferProductSearch:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}
#clearTransferProductSearch:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}
/* Transfer product filter input group styling */
.input-group:has(#transferProductFilter) .input-group-text {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #6c757d;
    transition: all 0.2s ease;
}
.input-group:has(#transferProductFilter) .input-group-text:hover {
    background-color: #e9ecef;
    color: #495057;
}

/* Generic Search Input Styles - can be used for all search inputs */
.search-input {
    border-radius: 0.375rem 0 0 0.375rem;
    border-right: none;
    transition: all 0.2s ease;
}
.search-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    z-index: 3;
}
.search-input:focus + .input-group-text {
    border-color: #0d6efd;
    z-index: 3;
}
.search-clear-btn {
    border-radius: 0 0.375rem 0.375rem 0;
    border-left: none;
    transition: all 0.2s ease;
}
.search-clear-btn:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}
.search-clear-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}
.search-refresh-btn {
    transition: all 0.2s ease;
}
.search-refresh-btn:hover {
    transform: rotate(180deg);
}
.search-refresh-btn.spin {
    animation: spin 1s linear infinite;
}
.search-results {
    font-size: 0.875rem;
    font-weight: 500;
}
/* Generic search input group styling */
.input-group:has(.search-input) .input-group-text {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #6c757d;
    transition: all 0.2s ease;
}
.input-group:has(.search-input) .input-group-text:hover {
    background-color: #e9ecef;
    color: #495057;
}

/* Transfer Modal Product Search Styles */
#transferProductSearch {
    border-radius: 0.375rem 0 0 0.375rem;
    border-right: none;
    transition: all 0.2s ease;
}
#transferProductSearch:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    z-index: 3;
}
#transferProductSearch:focus + .input-group-text {
    border-color: #0d6efd;
    z-index: 3;
}
#clearTransferProductSearch {
    border-radius: 0 0.375rem 0.375rem 0;
    border-left: none;
    transition: all 0.2s ease;
}
#clearTransferProductSearch:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}
#clearTransferProductSearch:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

/* Transfer Modal Clear Button Styles */
#clearTransferModalProductSearch {
    border-radius: 0 0.375rem 0.375rem 0;
    border-left: none;
    transition: all 0.2s ease;
}
#clearTransferModalProductSearch:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}
#clearTransferModalProductSearch:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

/* Transfer modal product search input group styling */
.input-group:has(#transferProductSearch) .input-group-text {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #6c757d;
    transition: all 0.2s ease;
}
.input-group:has(#transferProductSearch) .input-group-text:hover {
    background-color: #e9ecef;
    color: #495057;
}

/* Connection Retry Screens */
.reconnection-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.reconnection-container {
    background: white;
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: slideInUp 0.5s ease-out;
}

.reconnection-content h4 {
    color: #333;
    margin-bottom: 1rem;
    font-weight: 600;
}

.reconnection-content p {
    color: #666;
    margin-bottom: 1.5rem;
}

.reconnection-content .progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    overflow: hidden;
    margin: 0 auto;
    max-width: 300px;
}

.reconnection-content .progress-bar {
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 4px;
}

.reconnection-content .progress-bar.attempt-2 {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.reconnection-content .progress-bar.attempt-3 {
    background: linear-gradient(90deg, #dc3545, #c82333);
}

.connection-failed-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.connection-failed-container {
    background: white;
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: slideInUp 0.5s ease-out;
}

.connection-failed-content h4 {
    color: #6c757d;
    margin-bottom: 1rem;
    font-weight: 600;
}

.connection-failed-content p {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.connection-failed-content .btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.connection-failed-content .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(108, 117, 125, 0.2);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner animation enhancement */
.reconnection-content .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
    animation: spin 1s linear infinite;
}

/* Migration Error Modal Styles */
.migration-error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.migration-error-modal.hidden {
    display: none;
}

.migration-error-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideInUp 0.4s ease-out;
}

.migration-error-header {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 1.5rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.migration-error-header h4 {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.migration-error-header .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.migration-error-header .close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.migration-error-body {
    padding: 1.5rem;
}

.migration-error-summary {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.migration-error-details {
    margin-top: 1rem;
}

.migration-error-details h6 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.migration-error-details ul {
    margin-bottom: 1rem;
    padding-left: 0;
}

.migration-error-details li {
    padding: 0.25rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.migration-error-details li:last-child {
    border-bottom: none;
}

.migration-error-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.migration-error-footer .btn {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.migration-error-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design for connection screens */
@media (max-width: 768px) {
    .reconnection-container,
    .connection-failed-container {
        padding: 2rem;
        margin: 1rem;
    }
    
    .reconnection-content h4,
    .connection-failed-content h4 {
        font-size: 1.25rem;
    }
    
    .reconnection-content .progress {
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* Floating Dropdown Styles */
.floating-dropdown {
    position: fixed;
    z-index: 1060;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    min-width: 300px;
}

.floating-dropdown .list-group {
    margin: 0;
    border-radius: 0.375rem;
}

.floating-dropdown .list-group-item {
    border: none;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    padding: 0.75rem 1rem;
}

.floating-dropdown .list-group-item:last-child {
    border-bottom: none;
}

.floating-dropdown .list-group-item:hover {
    background-color: #f8f9fa;
}

.floating-dropdown .list-group-item:active {
    background-color: #e9ecef;
}

/* Ensure the parent container has relative positioning for absolute positioning to work */
.table-responsive {
    position: relative;
}

/* Adjust z-index for modals */
.modal .floating-dropdown {
    z-index: 1060;
}