/**
 * Custom CSS for Pedidos Nelisul
 * Contains project-specific styles and overrides
 * 
 * @version 1.0.0
 * @author Lucas Silva <lucasgabriel317@gmail.com>
 */

/* ==========================================================================
   Form Controls & Input Styling
   ========================================================================== */

/* Remove spinner arrows from number inputs */
.remove-arrow::-webkit-inner-spin-button,
.remove-arrow::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.remove-arrow {
    appearance: textfield;
    -moz-appearance: textfield;
}

/* ==========================================================================
   Loading & Animation States
   ========================================================================== */

/* Loading state for elements */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Fade-in animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* ==========================================================================
   HTMX Indicators (for base.html)
   ========================================================================== */

.htmx-indicator {
    display: none;
}

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

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

/* HTMX swapping animation */
tr.htmx-swapping td {
    opacity: 0;
    transition: opacity 0.1s ease-out;
}

/* ==========================================================================
   Custom Scrollbar Styles
   ========================================================================== */

/* Smooth scrolling for all pages */
html {
    scroll-behavior: smooth;
}

/* Webkit browsers (Chrome, Safari, Edge) - Main scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgb(241 245 249); /* slate-100 */
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgb(203 213 225); /* slate-300 */
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(148 163 184); /* slate-400 */
}

::-webkit-scrollbar-corner {
    background: rgb(241 245 249); /* slate-100 */
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgb(203 213 225) rgb(241 245 249); /* thumb track */
}

/* Dark theme scrollbar styles */
html.dark ::-webkit-scrollbar-track {
    background: rgb(30 41 59) !important; /* slate-800 */
}

html.dark ::-webkit-scrollbar-thumb {
    background: rgb(71 85 105) !important; /* slate-600 */
}

html.dark ::-webkit-scrollbar-thumb:hover {
    background: rgb(100 116 139) !important; /* slate-500 */
}

html.dark ::-webkit-scrollbar-corner {
    background: rgb(30 41 59) !important; /* slate-800 */
}

html.dark * {
    scrollbar-color: rgb(71 85 105) rgb(30 41 59) !important; /* thumb track */
}

/* Scrollbar for overflow containers (modals, dropdowns) */
.overflow-y-auto::-webkit-scrollbar,
.overflow-x-auto::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.overflow-y-auto::-webkit-scrollbar-thumb,
.overflow-x-auto::-webkit-scrollbar-thumb {
    background: rgb(203 213 225); /* slate-300 */
}

.overflow-y-auto:hover::-webkit-scrollbar-thumb,
.overflow-x-auto:hover::-webkit-scrollbar-thumb {
    background: rgb(148 163 184); /* slate-400 */
}

/* Dark theme for overflow containers */
html.dark .overflow-y-auto::-webkit-scrollbar-thumb,
html.dark .overflow-x-auto::-webkit-scrollbar-thumb {
    background: rgb(71 85 105) !important; /* slate-600 */
}

html.dark .overflow-y-auto:hover::-webkit-scrollbar-thumb,
html.dark .overflow-x-auto:hover::-webkit-scrollbar-thumb {
    background: rgb(100 116 139) !important; /* slate-500 */
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* Hide scrollbar while maintaining functionality */
.scroll-hidden {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.scroll-hidden::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}
