/* Global Font */
html,
body {
    font-family: 'Pretendard', sans-serif;
    font-size: 16px;
}

/* Ensure form elements use the custom font without overriding icons */
input,
button,
select,
textarea {
    font-family: 'Pretendard', sans-serif;
}

/* Custom Scrollbar */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 99px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* Card Hover Effects */
.dashboard-card {
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
}

/* Calendar Grid */
.calendar-day {
    min-height: 80px;
}

/* Dense Table Optimization */
.table-dense th,
.table-dense td {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    font-size: 14px;
}

/* Card View Font Size */
#cardViewContainer {
    font-size: 14px;
}

/* Dashboard Stats Grid Item Numbers - 20px */
#equipStatsGrid .text-lg.font-bold,
#assetStatsGrid .text-lg.font-bold {
    font-size: 25px !important;
}

/* Equipment/Asset Status Cards Equipment/Asset Name - 16px */
#maintenanceDataContainer h4,
#equipCheckoutDataContainer h4,
#equipIssueDataContainer h4,
#assetCheckoutDataContainer h4,
#assetIssueDataContainer h4 {
    font-size: 14px !important;
}

/* Sticky Header */
.sticky-header th {
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    z-index: 10;
    box-shadow: inset 0 -1px 0 #e5e7eb;
}

/* Tab Active State */
.tab-active {
    border-bottom: 2px solid #f97316;
    color: #ea580c;
    font-weight: 600;
}

.tab-inactive {
    border-bottom: 2px solid transparent;
    color: #6b7280;
}

.tab-inactive:hover {
    color: #1f2937;
    border-bottom-color: #e5e7eb;
}

/* Row Hover Effect */
tr.machine-row {
    transition: background-color 0.1s;
}

tr.machine-row:hover {
    background-color: #f3f4f6;
}

/* Active Row (Selected) */
tr.machine-row.active {
    background-color: #fff7ed;
}

tr.asset-row {
    transition: background-color 0.1s;
}

tr.asset-row:hover {
    background-color: #f3f4f6;
}

tr.asset-row.active {
    background-color: #eff6ff;
}

/* Drawer Animation */
.drawer {
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer.open {
    transform: translateX(0);
}

/* Gradient Divider */
.gradient-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, #d1d5db, #e5e7eb, transparent);
    margin: 1.5rem 0;
}

/* Page Section Visibility */
section[id^="page-"] {
    display: flex;
}

section[id^="page-"].hidden {
    display: none;
}

/* Gradient Animation */
@keyframes gradient-x {
    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.animate-gradient-x {
    background-size: 200% 200%;
    animation: gradient-x 15s ease infinite;
}

/* Sidebar Styles */
#mainSidebar {
    overflow: hidden;
    width: 12.8rem;
    transition: width 0.3s ease-in-out;
}

#mainSidebar.sidebar-collapsed {
    width: 4rem !important;
}

#mainSidebar.sidebar-collapsed .sidebar-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    margin: 0;
}

#mainSidebar.sidebar-collapsed .sidebar-nav-item {
    justify-content: center;
    align-items: center;
    padding: 0.75rem 0;
    width: 140%;
    margin-left: -20%;
    margin-right: -20%;
    gap: 0;
}

#mainSidebar.sidebar-collapsed .sidebar-nav-item i {
    margin: 0 auto;
}

#mainSidebar.sidebar-collapsed nav {
    align-items: center;
}

#mainSidebar.sidebar-collapsed #btnLogout {
    justify-content: center;
    align-items: center;
    padding: 0.75rem 0;
    width: 140%;
    margin-left: -20%;
    margin-right: -20%;
    gap: 0;
}

#mainSidebar.sidebar-collapsed #btnLogout i {
    margin: 0 auto;
}

#mainSidebar.sidebar-collapsed #sidebarToggle {
    margin-left: auto;
    margin-right: auto;
}

#mainSidebar.sidebar-collapsed>div:first-child {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

#mainSidebar.sidebar-collapsed>div:first-child>div:first-child {
    margin: 0;
}

#mainSidebar.sidebar-collapsed #userProfileArea .flex.items-center.gap-3 {
    justify-content: center;
}

#mainSidebar.sidebar-collapsed #userProfileArea #welcomeMsg {
    display: none;
}

#mainSidebar.sidebar-collapsed #welcomeInitial {
    display: flex !important;
}

#mainSidebar.sidebar-collapsed .my-4.flex.justify-center {
    padding: 0;
    margin: 1rem 0;
}

#mainSidebar.sidebar-collapsed .bg-gray-800.rounded-lg {
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-text {
    transition: opacity 0.2s ease, width 0.2s ease, margin 0.2s ease;
    opacity: 1;
}

/* Main content area adjustments */
main {
    transition: max-width 0.3s ease, margin-left 0.3s ease;
    max-width: calc(100vw - 12.8rem - 5px);
}

#mainSidebar.sidebar-collapsed+main {
    margin-left: 5px;
    max-width: calc(100vw - 4rem - 5px);
}

.sidebar-nav-item {
    transition: all 0.2s ease;
}

#sidebarToggle {
    transition: all 0.2s ease;
}

#sidebarToggle i {
    transition: transform 0.3s ease;
}
