@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    --bg-page: #09090b;
    --bg-panel: #09090b;
    --border-color: #27272a;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: #fafafa;
    overflow: hidden;
    height: 100vh;
}

.font-mono { font-family: 'JetBrains Mono', monospace; }

.workspace-grid {
    background-color: #000000;
    background-image:
            linear-gradient(rgba(39, 39, 42, 0.3) 1px, transparent 1px),
            linear-gradient(90deg, rgba(39, 39, 42, 0.3) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Medium-Small Text, Inbetween text-xs (0.75rem) and text-sm (0.875rem) */
.text-ms {
    font-size: 0.8125rem;
    line-height: 1.125rem;
}

/* Sidebar Base Logic */
.sidebar {
    z-index: 40;
    height: calc(100% - 32px - 56px); /* minus footer and header */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(12px);
    overflow: hidden;
}


/* Make sure the search header sticks to the top of the popover */
.sticky {
    position: sticky;
    top: 0;
}

/* Ensure the search input doesn't get focus ring styles that break the dark theme */
.dropdown-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(161, 161, 170, 0.2);
}

@media (prefers-color-scheme: dark) {
    .brand-logo {
        filter: invert(1);
    }
}


.sidenav-icon {
    border-radius: 6px !important;
}

@media (min-width: 768px) {
    .sidebar {
        top: 56px !important;
    }

    .sidebar-left { width: 0; border-right-width: 0; left: 0; }
    .sidebar-right { width: 0; border-left-width: 0; right: 0; }
    .sidebar-left.open { width: 18rem; border-right-width: 1px; }
    .sidebar-right.open { width: 20rem; border-left-width: 1px; }
}

@media (max-width: 767px) {


    .sidebar {
        position: absolute;
        top: 3.5rem;
        bottom: 0;
        z-index: 40;
        width: 80%;
    }
    .sidebar-left { transform: translateX(-100%); border-right: 1px solid var(--border-color); }
    .sidebar-right { transform: translateX(100%); right: 0; border-left: 1px solid var(--border-color); }
    .sidebar-left.open { transform: translateX(0); }
    .sidebar-right.open { transform: translateX(0); }

}




input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.input-group { transition: all 0.2s ease; border: 1px solid var(--border-color); }
.input-group:focus-within { border-color: #52525b; box-shadow: 0 0 0 4px rgba(63, 63, 70, 0.15); background-color: #18181b; }

.huge-input { background: transparent; border: none; outline: none; width: 100%; font-family: 'JetBrains Mono', monospace; color: #fafafa; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; border-radius: 0.375rem; font-size: 0.875rem; font-weight: 500; transition: all 0.15s ease; cursor: pointer; }
.btn-ghost { color: #a1a1aa; }
.btn-ghost:hover { background-color: #27272a; color: #fafafa; }
.btn-icon { width: 2rem; height: 2rem; padding: 0; }

.preset-chip { background: #18181b; border: 1px solid var(--border-color); color: #a1a1aa; font-size: 0.75rem; padding: 6px 10px; border-radius: 4px; cursor: pointer; transition: all 0.2s; display: flex; justify-content: space-between; align-items: center; }
.preset-chip:hover { background: #27272a; color: #fafafa; border-color: #3f3f46; }

.thermal-bar-container { height: 4px; background: #18181b; border-radius: 99px; overflow: hidden; position: relative; }
.thermal-indicator { position: absolute; top: 0; bottom: 0; width: 6px; background: #fff; border-radius: 99px; box-shadow: 0 0 8px 1px rgba(255, 255, 255, 0.5); transition: left 0.3s ease-out; }
.thermal-gradient { width: 100%; height: 100%; opacity: 0.5; background: linear-gradient(90deg, #3b82f6 0%, #22c55e 35%, #eab308 65%, #ef4444 100%); }

.width-100 {
    width: 100%;
}

/* Updated Dropdown Styling */
.dropdown-content {
    background: #09090b;
    border: 1px solid #27272a;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.5);
    display: flex;
    flex-direction: column;
    max-height: 40vh;
    overflow-y: auto;
    /* Smooth entry */
    animation: dropdownEnter 0.15s ease-out;
}

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

.dropdown-content.hidden {
    display: none;
}

.menu-scroll-area {
    padding: 0.25rem;
}

/* Universal custom scrollbar styling */
*::-webkit-scrollbar {
    width: 6px;
}
*::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 4px;
}
* {
    scrollbar-width: thin;
    scrollbar-color: #27272a #09090b;
}

/* Ensure categories and items look correct */
.unit-group .group-header {
    background: #09090b;
    position: sticky;
    top: 0;
    z-index: 5;
}

/* Dropdown slide-down and fade-in animation */
.dropdown-animate-in {
  animation: dropdown-slide-fade-in 0.32s cubic-bezier(0.4, 0.2, 0.2, 1) both;
}

.dropdown-animate-out {
  animation: dropdown-slide-fade-out 0.22s cubic-bezier(0.4, 0.2, 0.2, 1) both;
}

@keyframes dropdown-slide-fade-in {
  0% {
    opacity: 0;
    transform: translateY(-16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dropdown-slide-fade-out {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-16px);
  }
}

.sidebar-link {
    transition: all ease-in-out 0.15s;
}

/* Sidebar item premium animation */
.sidebar-item-animate-in {
  animation: sidebar-item-fade-slide-in 0.38s cubic-bezier(0.4, 0.2, 0.2, 1) both;
    transition: all ease-in-out 0.15s;
}
.sidebar-item-animate-out {
  animation: sidebar-item-fade-slide-out 0.28s cubic-bezier(0.4, 0.2, 0.2, 1) both;
    transition: all ease-in-out 0.15s;
}
@keyframes sidebar-item-fade-slide-in {
  0% {
    opacity: 0;
    transform: translateX(-24px) scale(0.98);
    filter: blur(2px);
  }
  80% {
    filter: blur(0.5px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}
@keyframes sidebar-item-fade-slide-out {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateX(24px) scale(0.98);
    filter: blur(2px);
  }
}
