/* Custom CSS to fix DatePickerRange and Dropdowns in dark mode */

/* Fix standard dbc.Select dropdown background and text */
.dark-select {
    background-color: #0B1F3A !important;
    color: #F8FAFC !important;
    border: 1px solid rgba(214, 180, 106, 0.3) !important;
}

/* Fix DatePickerRange in dark mode */
.DateInput_input {
    background-color: #0B1F3A !important;
    color: #F8FAFC !important;
    border: none !important;
    font-family: 'Roboto Flex', sans-serif !important;
    font-size: var(--font-size-base) !important;
}

.DateRangePickerInput {
    background-color: #0B1F3A !important;
    border: 1px solid rgba(214, 180, 106, 0.3) !important;
    border-radius: 4px;
    overflow: hidden;
}

.DateRangePickerInput_arrow_svg {
    fill: #F8FAFC !important;
}

.CalendarMonth_caption {
    color: #07111F !important; /* Datepicker calendar header is white bg by default */
}

/* Add custom scrollbar for the table */
.dash-table-container .dash-spreadsheet-container {
    overflow-x: auto !important;
    max-width: 100%;
}
.dash-table-container .dash-spreadsheet-container::-webkit-scrollbar {
    height: 8px;
}
.dash-table-container .dash-spreadsheet-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.dash-table-container .dash-spreadsheet-container::-webkit-scrollbar-thumb {
    background: rgba(214, 180, 106, 0.5);
    border-radius: 4px;
}

/* 
 * Sleek Hover Sidebar 
 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 60px; /* Collapsed width */
    background-color: rgba(11, 31, 58, 0.85);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(214, 180, 106, 0.15);
    transition: width 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    padding-top: 30px;
}

.sidebar:hover {
    width: 240px; /* Expanded width */
    box-shadow: 4px 0 15px rgba(0,0,0,0.5);
}

.sidebar-brand {
    font-size: var(--font-size-header);
    font-weight: 500;
    color: #D6B46A;
    margin-bottom: 40px;
    padding-left: 18px;
    display: flex;
    align-items: center;
}

.sidebar-brand span.brand-text {
    opacity: 0;
    margin-left: 15px;
    transition: opacity 0.3s;
}

.sidebar:hover .sidebar-brand span.brand-text {
    opacity: 1;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 15px 18px;
    color: #F8FAFC !important;
    text-decoration: none !important;
    transition: background-color 0.2s;
    font-size: var(--font-size-base);
}

.sidebar-nav-item:hover {
    background-color: rgba(214, 180, 106, 0.15);
    color: #D6B46A !important;
}

.sidebar-nav-item span.nav-label {
    opacity: 0;
    margin-left: 15px;
    transition: opacity 0.3s;
}

.sidebar:hover .sidebar-nav-item span.nav-label {
    opacity: 1;
}

/* Page Content Wrapper */
.page-content {
    margin-left: 60px; /* Always 60px to prevent layout shift on hover */
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

/* fallback font definitions, allows custom overrides */
body, html, input, button, select, textarea {
    font-family: 'Roboto Flex', sans-serif;
}

:root {
    --base-font-size: clamp(11px, 1.2vw, 13px);
    --font-size-base: var(--base-font-size);
    --font-size-header: calc(var(--base-font-size) + 2px);
    --font-size-card-number: calc(var(--base-font-size) + 4px);
    --font-size-page-header: calc(var(--base-font-size) + 6px);
}

body {
    margin: 0;
    padding: 0;
    background-color: #07111F;
    color: #F8FAFC;
    min-height: 100vh;
}

.page-padding {
    padding: 20px 40px;
}

/* Mobile Layout - Bottom Navigation */
@media (max-width: 768px) {
    .sidebar {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 70px;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding-top: 0;
        border-right: none;
        border-top: 1px solid rgba(214, 180, 106, 0.15);
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom, 0px); /* For iPhone notch */
    }
    
    .sidebar:hover {
        width: 100%; /* Disable hover expand on mobile */
        box-shadow: 0 -4px 15px rgba(0,0,0,0.3);
    }
    
    .sidebar-brand {
        display: none; /* Hide AYKAZ logo on bottom nav */
    }
    
    .sidebar-nav-item {
        padding: 5px 10px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .sidebar-nav-item span:first-child {
        font-size: 1.3rem !important; /* Slightly smaller icons */
    }
    
    .sidebar-nav-item span.nav-label {
        opacity: 1 !important;
        margin-left: 0 !important;
        margin-top: 4px;
        font-size: 0.65rem !important;
        transition: none;
    }
    
    .page-content {
        margin-left: 0;
        padding-bottom: 80px; /* Space for the bottom nav */
    }
    
    /* Override inline padding for mobile to save space */
    .page-content > div > div, .page-content > div {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    
    .page-padding {
        padding: 10px 5px !important;
    }
}


/* Custom Dropdown Styling for Dash */
.custom-dropdown .Select-control {
    background-color: #0B1F3A !important;
    color: #F8FAFC !important;
    border: 1px solid rgba(214, 180, 106, 0.3) !important;
}
.custom-dropdown .has-value.Select--single > .Select-control .Select-value .Select-value-label,
.custom-dropdown .has-value.is-pseudo-focused.Select--single > .Select-control .Select-value .Select-value-label {
    color: #F8FAFC !important;
}
.custom-dropdown .Select-value-label {
    color: #F8FAFC !important;
}
.custom-dropdown .Select-value {
    color: #F8FAFC !important;
}
.custom-dropdown .Select-menu-outer {
    background-color: #0B1F3A !important;
    border: 1px solid rgba(214, 180, 106, 0.3) !important;
}
.custom-dropdown .Select-option {
    background-color: #0B1F3A !important;
    color: #F8FAFC !important;
}
.custom-dropdown .Select-option:hover {
    background-color: rgba(214, 180, 106, 0.15) !important;
    color: #D6B46A !important;
}
.custom-dropdown .Select-option.is-selected {
    background-color: rgba(214, 180, 106, 0.25) !important;
}
.custom-dropdown input {
    color: #F8FAFC !important;
}
.custom-dropdown .is-focused:not(.is-open) > .Select-control {
    border-color: #D6B46A !important;
    box-shadow: none !important;
}
.custom-dropdown .Select.is-focused > .Select-control {
    background-color: #0B1F3A !important;
}

/* YoY Table Header Font Size reduction on mobile */
@media (max-width: 768px) {
    .yoy-table-header th {
        font-size: 11px !important;
        padding: 4px !important;
    }
}

/* BRUTE FORCE DROPDOWN STYLING FOR ALL VERSIONS */
.custom-dropdown > div {
    background-color: #0B1F3A !important;
    border-color: rgba(214, 180, 106, 0.3) !important;
}
.custom-dropdown > div * {
    color: #F8FAFC !important;
}
.custom-dropdown [class*="menu"] {
    background-color: #0B1F3A !important;
    border: 1px solid rgba(214, 180, 106, 0.3) !important;
}
.custom-dropdown [class*="option"] {
    background-color: #0B1F3A !important;
    color: #F8FAFC !important;
}
.custom-dropdown [class*="option"]:hover {
    background-color: rgba(214, 180, 106, 0.15) !important;
    color: #D6B46A !important;
}
.custom-dropdown input {
    color: #F8FAFC !important;
}
