:root {
    --logo-dark: url('Fractl_Agents_Horizontal_Logo_White.svg');
    --logo-light: url('Fractl_Agents_Horizontal_Logo_Black.svg');
}


    * {
        font-family: "Open Sans", serif;
        font-optical-sizing: auto;
        font-weight: <weight>;
        font-style: normal;
        font-variation-settings:
          "wdth" 100;
      }



[data-testid="stHorizontalBlock"] {
    margin-bottom:10px !important;
}
/* Default based on the user's preferred color scheme */
@media (prefers-color-scheme: dark) {
    .header-logo img {
        content: var(--logo-dark);
    }
}

@media (prefers-color-scheme: light) {
    .header-logo img {
        content: var(--logo-light);
    }
}

/* Override with data-theme attribute */
[data-theme="dark"] .header-logo img {
    content: var(--logo-dark);
}

[data-theme="light"] .header-logo img {
    content: var(--logo-light);
}


body, p {
    font-size: 0.95em !important;
    font-weight: 500 !important;
    font-family: 'Open Sans', sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#sidebar-profile > div > span {
    color:#ffffff !important;
}


.page-title {
    font-size: 1.5rem !important;
    font-weight:600;
    margin-bottom:8px;
}

.page-title-text {
    margin-left:5px;
}


/* Target the Streamlit spinner using the data-testid attribute */
[data-testid="stSpinner"] {
    display: flex; /* Ensure the spinner container remains visible */
    justify-content: center;
    align-items: center;
    background: transparent; /* Optional: remove background if needed */
    border:none !important;
}

/* Replace the spinner's icon with your custom image */
[data-testid="stSpinner"] > div > i {
    content: '';
    display: block; /* Make sure it behaves like a block element */
    width: 28px; /* Set the desired size */
    height: 28px;
    background: url('https://agents.frac.tl/favicon.png') no-repeat center center;
    background-size: contain; /* Adjust to ensure the image fits */
    animation: rotate 1s linear infinite; /* Add rotation animation */
    border:none !important;
}

/* Hide the default spinner icon (optional, if you need a clean slate) */
[data-testid="stSpinner"] > div > i::before {
    content: none;
}

/* Rotation animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}



/* Sidebar styles - these stay dark regardless of theme */
[data-testid="stSidebarContent"] {
    background-color: #1f1f1f;
    background-image: url('Fractl_Agents_Horizontal_Logo_White.svg');
    background-repeat: no-repeat;
    background-position: center 30px;
    background-size: 300px auto;
    font-family: 'Open Sans', sans-serif;
}

[data-testid="stSidebarContent"] a span {
    color: white;
    font-size: 0.93em !important;
    font-weight: 550 !important;
    line-height: 1.55em !important;
}

[data-testid="stSidebarNavItems"] {
    max-height: none !important;
    position: relative;
    background-color: #2a2a2a;
    border-radius: 10px;
    margin-top: 200px !important;
    margin-left: 12px !important;
    margin-right: 12px !important;
}

/* Toggle functionality */
.toggle-item {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, margin-left 0.3s ease-out;
    opacity: 0;
}

.toggle-item.show {
    max-height: 1000px;
    opacity: 1;
    margin-left: 15px;
}

.toggle-item.show > div > a > span {
    font-weight: 300 !important;
}

.toggle-arrow {
    cursor: pointer;
}

.toggle-arrow::after {
    content: '';
    display: inline-block;
    margin-right: 10px;
    float: right;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #fffce7;
    transition: transform 0.3s ease-out;
    margin-top: 12px;
}

.toggle-arrow:hover::after {
    border-radius: 3px;
}

.toggle-arrow.up::after {
    transform: rotate(180deg);
}

.toggle-insert {
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    border-radius: 0.25rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin: 0.125rem 1rem;
    line-height: 2;
    font-family: 'Open Sans', sans-serif;
}

.toggle-insert > a:hover {
    text-decoration: none !important;
}

.toggle-insert a {
    text-decoration: none;
}

.toggle-insert:hover {
    background-color: rgba(172, 177, 195, 0.15);
}

/* Sidebar navigation */
ul[data-testid="stSidebarNavItems"] {
    padding-top: 1em !important;
}

div[data-testid="stSidebarNavSeparator"] {
    display: none;
}

[data-testid="stSidebarUserContent"] p {
    color: #FFFFFF !important;
}

[data-testid="stSidebarUserContent"] button p {
    color: #152535 !important;
}

/* Common elements */
*, ::before, ::after {
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
}

/* Tabs and Buttons */
[data-baseweb="tab-list"] > button > [data-testid="stMarkdownContainer"] > p {
    color: #e94e29 !important;
    font-weight: 600 !important;
    font-size: 0.93em !important;
}

.stButton > button,.myButton {
    background: #40C4A8 !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    padding: 0.5rem 1.2rem !important;
    font-family: 'Open Sans', sans-serif;
}




.stAlert > div:has([data-testid="stNotificationContentInfo"]) {
    background: linear-gradient(135deg, #f38154 0%, #FF6B4A 100%);
    padding: 20px;
    border-radius: 8px;
    font-weight: 800 !important;
    font-size: 0.95em !important;
  }
  
  .stAlert > div:has([data-testid="stNotificationContentInfo"]) > div > div > div > div > p {
    color: #ffffff !important;
  }

  .stAlert > div:has([data-testid="stNotificationContentInfo"]) > div > div > div > div > ol {
    color: #ffffff !important;
  }

  .stAlert > div:has([data-testid="stNotificationContentInfo"]) > div > div > div > div > ul {
    color: #ffffff !important;
  }

div[data-testid="stVerticalBlockBorderWrapper"]:not(div[data-testid="stVerticalBlockBorderWrapper"] div[data-testid="stVerticalBlockBorderWrapper"]):not(:has(div[data-testid="stAppSkeleton"])) {
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

/* Reset styles for placeholders and empty containers */
div[data-testid="stVerticalBlockBorderWrapper"]:has(div.element-container:empty) {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
    overflow: hidden;
    visibility: hidden;
}


/* Exclude containers with skeleton loading states */
div[data-testid="stVerticalBlockBorderWrapper"]:has(div[data-testid="stAppSkeleton"]) {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Table styles */
.stTable table {
    border: 1px solid #ccc !important;
    width: 100% !important;
    border-collapse: collapse !important;
    font-family: 'Open Sans', sans-serif;
}

.stTable th {
    background-color: #333 !important;
    color: #fff !important;
    font-weight: normal !important;
}

.stTable td, .stTable th {
    padding: 0.5rem !important;
}

/* Page links */
.stPageLink a[data-testid="stPageLink-NavLink"] {
    background: #e94e29 !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    font-weight: 800 !important;
    font-family: 'Open Sans', sans-serif;
    padding: 0.5rem 1.2rem !important;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38.4px;
    margin: 0px;
    line-height: 1.6;
    width: auto;
    user-select: none;
    cursor: pointer;
}

.stPageLink a[data-testid="stPageLink-NavLink"] span {
    color: white !important;
    font-weight: 900 !important;
    text-align: center;
    font-size: 16px;
}

.stPageLink a[data-testid="stPageLink-NavLink"] span > div > p {
    color: white !important;
}


.stPageLink a[data-testid="stPageLink-NavLink"]:hover {
    background: #35B398 !important;
    transform: scale(1.03);
}

.stPageLink a[data-testid="stPageLink-NavLink"]:active {
    background: #2C9E85 !important;
    transform: scale(0.98);
}

.stPageLink {
    text-align: center;
}




/* Description styles */
.featured_item_description {
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    margin-top: 8px;
    margin-bottom: 16px;
    text-align: center;
    line-height: 1.5;
    font-weight: 500 !important;
}

/* Status and decoration */
[data-testid="baseButton-header"] {
    display: none !important;
}

[data-testid="stStatusWidget"] > div > img {
    width: 4em !important;
    height: 4em !important;
    margin-right: -10px !important;
}

[data-testid="stDecoration"] {
    background: linear-gradient(to right, #e94e29 0%, #e94e29 65%, #47cf9f 100%) !important;
}

/* Sidebar reset */
div[data-testid="stSidebarUserContent"] div[data-testid="stVerticalBlockBorderWrapper"] {
    display: none;
}

/* Light Theme Styles */
html:not([data-theme="dark"]),
[data-theme="light"] {
    /* Main content areas */

    .App {
        background-color: #ffffff !important;
    }




 


    & section:nth-of-type(2) {
        background-color: #f4f4f4;
    }

    & div[data-testid="stVerticalBlockBorderWrapper"]:not(div[data-testid="stVerticalBlockBorderWrapper"] div[data-testid="stVerticalBlockBorderWrapper"]):not(:has(div[data-testid="stAppSkeleton"])) {
        background-color: #ffffff;
        border: 1px solid #e0e0e0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
        color: #000000;
    }

    & [data-testid="stHeader"] {
        background: linear-gradient(to right, #f4f4f4 0%, #f4f4f4 45%, #ffffff 100%);
        border-image: linear-gradient(to right, #f4f4f4 0%, #f4f4f4 45%, #ffffff 100%);
        border-image-slice: 1;
    }
    

    & .featured_item_description {
        color: #666666;
    }

    & .coming-soon span {
        color: black;
    }

    & .coming-soon span span {
        color: gray;
    }

    & [data-testid="stMarkdownContainer"] {
        color: #000000;
    }

    & input, & textarea {
        color: #000000 !important;
        background-color: #ffffff !important;
    }

    & select {
        color: #000000 !important;
        background-color: #ffffff !important;
    }
}

/* Dark Theme Styles */
html[data-theme="dark"] {

    [data-testid="stSidebarContent"] {
        background-color: #2d2d2d;
    }

    [data-testid="stSidebarNavItems"] {
        background-color: #1e1e1e;
    }

    #sidebar-profile {
        background-color: rgb(42 42 42) !important;

    }

    .App {
        background-color: rgb(45,45,45) !important;
    }

    [data-testid="stForm"]{
        border-color:#565656 !important;
    }

    [data-testid="stExpander"]{
        border-color:#565656 !important;
    }
    /* Main content areas */
    & section:nth-of-type(2) {
        background-color: #1e1e1e;
    }

    & div[data-testid="stVerticalBlockBorderWrapper"]:not(div[data-testid="stVerticalBlockBorderWrapper"] div[data-testid="stVerticalBlockBorderWrapper"]):not(:has(div[data-testid="stAppSkeleton"])) {
        background-color: #2d2d2d;
        border: 1px solid #3d3d3d;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
        color: #ffffff;
    }

    & [data-testid="stHeader"] {
        background: linear-gradient(to right, #1e1e1e 0%, #1e1e1e 45%, #2d2d2d 100%);
        border-image: linear-gradient(to right, #1e1e1e 0%, #1e1e1e 45%, #2d2d2d 100%);
        border-image-slice: 1;
    }

    

    & .featured_item_description {
        color: #cccccc;
    }

    & .coming-soon span {
        color: white;
    }

    & .coming-soon span span {
        color: #cccccc;
    }

    & [data-testid="stMarkdownContainer"] {
        color: #ffffff;
    }

    & input, & textarea {
        color: #ffffff !important;
        background-color: #2d2d2d !important;
    }


}

/* Default to light theme if no preference set */
@media (prefers-color-scheme: light) {
    html:not([data-theme]) {
        color-scheme: light;
    }
}

/* Default to dark theme if system prefers dark */
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) {
        color-scheme: dark;
    }
}

/* Light Theme Styles */
html:not([data-theme="dark"]),
[data-theme="light"] {
    /* Main text elements */
    & .stMarkdown,
    & .stMarkdown p,
    & .stMarkdown span,
    & [data-testid="stMarkdownContainer"],
    & [data-testid="stMarkdownContainer"] p,
    & [data-testid="stMarkdownContainer"] span,
    & .element-container,
    & .element-container p,
    & .element-container span,
    & h1, & h2, & h3, & h4, & h5, & h6,
    & .stHeading,
    & span,
    & p,
    & div,
    & label,
    & text {
        color: #000000 !important;
    }
    

    

    /* Form elements and containers */
    & .stTextInput input,
    & .stTextArea textarea,
    & .stNumberInput input,
    & .stMultiSelect select,
    & .stDateInput input,
    & div[data-baseweb="input"] input,
    & div[data-baseweb="textarea"] textarea,
    & div[data-baseweb="select"] select,
    & .stMultiSelect > div[data-baseweb] {
        color: #000000 !important;
        background-color: #ffffff !important;
        border: 1px solid rgba(49, 51, 63, 0.2) !important;
        border-radius: 0.5rem !important;
    }

    /* Container borders */
    & div[data-testid="stVerticalBlockBorderWrapper"] {
        border-color: rgba(49, 51, 63, 0.2) !important;
    }

    /* Widget labels */
    & .stWidgetLabel span {
        color: #000000 !important;
    }
}

/* Dark Theme Styles */
html[data-theme="dark"] {
    /* Main text elements */
    & .stMarkdown,
    & .stMarkdown p,
    & .stMarkdown span,
    & [data-testid="stMarkdownContainer"],
    & [data-testid="stMarkdownContainer"] p,
    & [data-testid="stMarkdownContainer"] span,
    & .element-container,
    & .element-container p,
    & .element-container span,
    & h1, & h2, & h3, & h4, & h5, & h6,
    & .stHeading,
    & span,
    & p,
    & div,
    & label,
    & text {
        color: #ffffff !important;
    }

    [data-testid="stMarkdownContainer"] p > a {
        color:#ffffff !important;
    }


    [data-testid="stExpander"] > details {
        border-color: rgb(85 85 85) !important;
    }

    [data-testid="textInputRootElement"] {
        border:0px !important;
    }

    label[data-baseweb="checkbox"] > span {
        background-color:#ff7352 !important;
    }
    /* Form elements and containers */
    & .stTextInput input,
    & .stTextArea textarea,
    & .stNumberInput input,
    & .stMultiSelect select,
    & .stDateInput input,
    & div[data-baseweb="input"] input,
    & div[data-baseweb="textarea"] textarea,
    & div[data-baseweb="select"] select,
    & .stMultiSelect > div[data-baseweb] {
        color: #ffffff !important;
        background-color: #2d2d2d !important;
        border: 1px solid #565656 !important;
        border-radius: 0.5rem !important;
    }

    
    /* Container borders */
    & div[data-testid="stVerticalBlockBorderWrapper"] {
        border-color: rgba(250, 250, 250, 0.2) !important;
    }

    /* Widget labels */
    & .stWidgetLabel span {
        color: #ffffff !important;
    }
}

/* Common focus states for form elements */
.stTextInput input:focus,
.stTextArea textarea:focus,
.stNumberInput input:focus,
.stMultiSelect select:focus,
.stDateInput input:focus,
div[data-baseweb="input"] input:focus,
div[data-baseweb="textarea"] textarea:focus,
div[data-baseweb="select"] select:focus {
    border-color: #40C4A8 !important;
    box-shadow: 0 0 0 1px #40C4A8 !important;
}


    /* Sidebar styles - these stay dark regardless of theme */
    [data-testid="stSidebarContent"] {
        background-color: #1f1f1f;
        font-family: 'Open Sans', sans-serif;
    }

    
    
    [data-testid="stSidebarContent"] a span {
        color: white;
        font-size: 0.93em !important;
        font-weight: 550 !important;
        line-height: 1.55em !important;
    }
    
    [data-testid="stSidebarNavItems"] {
        max-height: none !important;
        position: relative;
        background-color: #2a2a2a;
        border-radius: 10px;
        margin-top: 200px !important;
        margin-left: 12px !important;
        margin-right: 12px !important;
        border:1px solid #565656 !important;
    }
    
    /* Toggle functionality */
    .toggle-item {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out, opacity 0.3s ease-out, margin-left 0.3s ease-out;
        opacity: 0;
        padding-left: 0px !important;
    }
    
    .toggle-item.show {
        max-height: 1000px;
        opacity: 1;
        margin-left: 15px;
    }
    
    .toggle-item.show > div > a > span {
        font-weight: 300 !important;
    }
    
    .toggle-item a, .toggle-item span {
        color: #ffffff !important;
        text-decoration: none;
        width: 100%;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .toggle-arrow {
        cursor: pointer;
    }
    
    .toggle-arrow::after {
        content: '';
        display: inline-block;
        margin-right: 10px;
        float: right;
        width: 0;
        height: 0;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 6px solid #fffce7;
        transition: transform 0.3s ease-out;
        margin-top: 12px;
    }
    
    .toggle-arrow:hover::after {
        border-radius: 3px;
    }
    
    .toggle-arrow.up::after {
        transform: rotate(180deg);
    }
    
    .toggle-insert {
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
        border-radius: 0.25rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        margin: 0.125rem 1rem;
        line-height: 2;
        font-family: 'Open Sans', sans-serif;
    }
    
    .toggle-insert > a:hover {
        text-decoration: none !important;
    }
    
    .toggle-insert a {
        text-decoration: none;
    }
    
    .toggle-insert:hover {
        background-color: rgba(172, 177, 195, 0.15);
    }
    
    /* Menu items with icons */
    .menu-item-with-icon {
        display: flex;
        align-items: center;
        padding: 2px 0.5rem;
        cursor: pointer;
        border-radius: 0.25rem;
        margin: 0.125rem 1rem;
    }
    
    .menu-item-with-icon:hover, .menu-item-with-icon.active {
        background-color: rgba(172, 177, 195, 0.15);
    }
    
    .menu-item-with-icon.active {
        border-left: 2px solid #ffffff;
        margin-left: calc(1rem - 2px);
    }
    
    .menu-item-with-icon i {
        color: #ffffff !important;
        width: 20px;
        text-align: center;
        display: inline-block;
    }
    
    .menu-item-with-icon span {
        font-size: 0.95em !important;
        line-height: 1.3em !important;
    }
    
    .menu-item-with-icon svg {
        color: #ffffff !important;
        width: 30px !important;
        min-width: 30px !important;
    }
    
    /* Font Awesome icons */
    .fa-regular {
        width: 20px !important;
        text-align: center !important;
        font-family: "Font Awesome 6 Free" !important;
        -webkit-font-smoothing: antialiased;
        display: inline-block;
        font-style: normal;
        font-variant: normal;
        text-rendering: auto;
        line-height: 1;
    }
    
    /* Coming soon styles */
    .coming-soon {
        cursor: not-allowed !important;
        opacity: 0.8 !important;
        animation: shimmer 2s infinite linear;
        padding-left: 0px;
    }
    
    .coming-soon span {
        background: linear-gradient(90deg, #666 0%, #999 50%, #666 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        position: relative;
    }
    
    /* Sidebar navigation */
    ul[data-testid="stSidebarNavItems"] {
        padding-top: 1em !important;
    }
    
    div[data-testid="stSidebarNavSeparator"] {
        display: none;
    }
    
    [data-testid="stSidebarUserContent"] p {
        color: #FFFFFF !important;
    }
    
    [data-testid="stSidebarUserContent"] button p {
        color: #152535 !important;
    }
    
    /* Force all sidebar text to stay white in light mode */
    html:not([data-theme="dark"]),
    [data-theme="light"] {
        & [data-testid="stSidebarContent"] {
            & .toggle-item a, 
            & .toggle-item span,
            & .menu-item-with-icon i,
            & .menu-item-with-icon svg,
            & .hasToggleEvent .toggle-insert a span,
            & .hasToggleEvent .toggle-arrow span,
            & .toggle-insert a span,
            & [data-testid="stSidebarNavLink"],
            & [data-testid="stSidebarNavLink"] span,
            & .st-emotion-cache-18l0hbk span,
            & .st-emotion-cache-17lntkn {
                color: #ffffff !important;
            }
        }
    }

    


[data-testid="stFileUploadDropzone"] {
    background-color:#40c4a8 !important;
}
    /* 1. Reset st-* styles for form elements and children */
[class^="st-"] input,
[class^="st-"] textarea,
[class^="st-"] select,
[class^="st-"] div[data-baseweb="input"],
[class^="st-"] div[data-baseweb="base-input"],
[class^="st-"] div[data-baseweb="select"],
[class^="st-"] div[data-baseweb="select"] * {
    background: none !important;
    color: inherit !important;
    border: none !important;
    background-color: none !important;
}

/* 2. Form styling */
div[data-testid="stForm"] {
    background: transparent !important;
    padding: 1rem !important;
    border-radius: 6px !important;
}

/* 3. Base Checkbox and Toggle styling */
[data-baseweb="checkbox"] {
    position: relative !important;
}

/* Regular Checkbox Styling */
[data-baseweb="checkbox"] > span[class^="st-ew"] {
    width: 18px !important;
    height: 18px !important;
    border: 2px solid #ccc !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
}

[data-baseweb="checkbox"]:has(input:checked) > span[class^="st-ew"] {
    background-color: #40C4A8 !important;
    border-color: #40C4A8 !important;
}

/* Toggle Switch Styling */
[data-baseweb="checkbox"] > div[class^="st-b0"] {
    width: 36px !important;
    height: 20px !important;
    border-radius: 12px !important;
    transition: background-color 0.2s ease !important;
    background-color: #e0e0e0 !important;
    position: relative !important;
}

[data-baseweb="checkbox"] > div[class^="st-b0"] > div {
    width: 16px !important;
    height: 16px !important;
    background-color: white !important;
    border-radius: 50% !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    transition: transform 0.2s ease !important;
}

[data-baseweb="checkbox"]:has(input:checked) > div[class^="st-b0"] {
    background-color: #40C4A8 !important;
}

[data-baseweb="checkbox"]:has(input:checked) > div[class^="st-b0"] > div {
    transform: translateX(16px) !important;
}

/* Ensure text container never changes color */
[data-baseweb="checkbox"] > div:last-of-type {
    color: inherit !important;
}

/* 4. Select and Dropdown styling */
div[data-baseweb="select"] {
    border-radius: 6px !important;
    overflow: hidden !important;
}

div[data-baseweb="popover"] {
    border-radius: 6px !important;
}

div[data-baseweb="popover"] > div > div > div {
    overflow: hidden !important;
}

div[data-baseweb="popover"] > div > div {
    overflow: hidden !important;
}

div[data-baseweb="popover"] ul[data-testid="stVirtualDropdown"] {
    background-color: #f9f9f9 !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    padding: 4px !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

div[data-baseweb="popover"] ul[data-testid="stVirtualDropdown"] li {
    background: transparent !important;
    color: #333 !important;
    padding: 10px 12px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

div[data-testid="stToolbar"]{
    top: 0.7rem !important;
}

div[data-baseweb="popover"] ul[data-testid="stVirtualDropdown"] li:hover {
    background-color: #40C4A8 !important;
    color: #ffffff !important;
}

/* 5. Tooltip/help icon styling */
.stTooltipIcon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.stTooltipIcon svg {
    fill: none !important;
    stroke: currentColor !important;
    width: 16px !important;
    height: 16px !important;
    transition: color 0.2s ease-in-out !important;
}

.stTooltipIcon:hover svg {
    color: #40C4A8 !important;
}

div[data-testid="tooltipHoverTarget"] {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    background-color: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 6. Theme-specific styles */
/* Case 1: Preferred Dark Mode, Data-Theme Light */
@media (prefers-color-scheme: dark) {
    html[data-theme="light"] {
        input, textarea, select, div[data-baseweb="select"] {
            background-color: #ffffff !important;
            color: #000000 !important;
            border: 1px solid #ccc !important;
        }


        div[data-baseweb="tab-border"] {
            background-color:rgba(49, 51, 63, 0.1) !important;
        }

        [data-testid="stExpander"] > details {
            margin-bottom: 0px;
            margin-top: 0px;
            width: 100%;
            border-style: solid;
            border-width: 1px;
            border-color: rgba(49, 51, 63, 0.2);
            border-radius: 0.5rem;
        }

        [data-baseweb="checkbox"] > span {
            background-color: #ffffff !important;
            border-color: rgb(173 173 178) !important;
        }

        div[data-baseweb="popover"] ul[data-testid="stVirtualDropdown"] {
            background-color: #ffffff !important;
            color: #000000 !important;
        }

        [data-baseweb="checkbox"] > div[class^="st-b0"] > div {
            background-color: #ffffff !important;
        }

        [data-baseweb="checkbox"]:has(input:checked) > div[class^="st-b0"] > div {
            background-color: #ffffff !important;
        }

        .stTooltipIcon svg {
            color: #000000 !important;
        }

        div[data-testid="stForm"] {
            border: 1px solid #e6e6e6 !important;
        }

        div[data-baseweb="popover"] ul[data-testid="stVirtualDropdown"] li::selection {
            background-color: #40C4A8 !important;
            color: #ffffff !important;
        }
    }
}

/* Case 2: Preferred Dark Mode, Data-Theme Dark */
@media (prefers-color-scheme: dark) {
    html[data-theme="dark"] {
        input, textarea, select, div[data-baseweb="select"] {
            background-color: #2d2d2d !important;
            color: #ffffff !important;
            border: 1px solid #565656 !important;
        }

        [data-baseweb="checkbox"] > span[class^="st-ew"] {
            background-color: #2d2d2d !important;
        }

        div[data-baseweb="popover"] ul[data-testid="stVirtualDropdown"] {
            background-color: #2d2d2d !important;
            color: #ffffff !important;
        }

        [data-baseweb="checkbox"] > div[class^="st-b0"] > div {
            background-color: #2C9E85 !important;
        }

        [data-baseweb="checkbox"]:has(input:checked) > div[class^="st-b0"] > div {
            background-color: #ffffff !important;
        }

        .stTooltipIcon svg {
            color: #ffffff !important;
        }

        div[data-testid="stForm"] {
            border: 1px solid #565656 !important;
        }

        div[data-baseweb="popover"] ul[data-testid="stVirtualDropdown"] li::selection {
            background-color: #40C4A8 !important;
            color: #ffffff !important;
        }
    }
}

/* Case 3: Preferred Light Mode, Data-Theme Dark */
@media (prefers-color-scheme: light) {
    html[data-theme="dark"] {
        input, textarea, select, div[data-baseweb="select"] {
            background-color: #2d2d2d !important;
            color: #ffffff !important;
            border: 1px solid #565656 !important;
        }

        div[data-baseweb="tab-border"] {
            background-color:rgba(250, 250, 250, 0.1) !important;
        }

        [data-baseweb="checkbox"] > span {
            background-color: #2d2d2d !important;
            border-color:rgba(250, 250, 250, 0.4) !important;
        }

        div[data-baseweb="popover"] ul[data-testid="stVirtualDropdown"] {
            background-color: #2d2d2d !important;
            color: #ffffff !important;
        }

        [data-baseweb="checkbox"] > div[class^="st-b0"] > div {
            background-color: #2C9E85 !important;
        }

        [data-baseweb="checkbox"]:has(input:checked) > div[class^="st-b0"] > div {
            background-color: #ffffff !important;
        }

        .stTooltipIcon svg {
            color: #ffffff !important;
        }

        div[data-testid="stForm"] {
            border: 1px solid #565656 !important;
        }

        div[data-baseweb="popover"] ul[data-testid="stVirtualDropdown"] li::selection {
            background-color: #40C4A8 !important;
            color: #ffffff !important;
        }
    }
}

/* Case 4: Preferred Light Mode, Data-Theme Light */
@media (prefers-color-scheme: light) {
    html[data-theme="light"] {
        input, textarea, select, div[data-baseweb="select"] {
            background-color: #ffffff !important;
            color: #000000 !important;
            border: 1px solid #ccc !important;
        }

        [data-baseweb="checkbox"] > span[class^="st-ew"] {
            background-color: #ffffff !important;
        }

        div[data-baseweb="popover"] ul[data-testid="stVirtualDropdown"] {
            background-color: #ffffff !important;
            color: #000000 !important;
        }

        [data-baseweb="checkbox"] > div[class^="st-b0"] > div {
            background-color: #ffffff !important;
        }

        
        [data-baseweb="checkbox"]:has(input:checked) > div[class^="st-b0"] > div {
            background-color: #ffffff !important;
        }

        .stTooltipIcon svg {
            color: #000000 !important;
        }

        div[data-testid="stForm"] {
            border: 1px solid #e6e6e6 !important;
        }

        div[data-baseweb="popover"] ul[data-testid="stVirtualDropdown"] li::selection {
            background-color: #40C4A8 !important;
            color: #ffffff !important;
        }
    }
}



.stButton > button > div > p {
    color: white !important;
    font-size:1.05em !important;
    font-weight:600 !important;
}


ol li{
    font-size:0.95em !important;
}


/* Default (light mode) */
.stTabs::after {
    content: " " !important;
    position: absolute !important;
    z-index: 1 !important;
    top: 0px !important;
    right: 0px !important;
    pointer-events: none !important;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8)) !important;
    width: 1rem !important;
    height: 2.5rem !important;
}

/* Dark mode based on prefers-color-scheme */
@media (prefers-color-scheme: dark) {
    .stTabs::after {
        background-image: linear-gradient(to right, rgba(45, 45, 45, 0), rgba(30, 30, 30, 0.5)) !important;
    }
}

/* Override with data-theme="dark" */
[data-theme="dark"] .stTabs::after {
    background-image: linear-gradient(to right, rgba(45, 45, 45, 0), rgba(30, 30, 30, 0.5)) !important;
}

/* Override with data-theme="light" */
[data-theme="light"] .stTabs::after {
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8)) !important;
}

/* Handles conflicts: prefers light + data-theme="dark" */
@media (prefers-color-scheme: light) {
    [data-theme="dark"] .stTabs::after {
        background-image: linear-gradient(to right, rgba(45, 45, 45, 0), rgba(30, 30, 30, 0.5)) !important;
    }
}

/* Handles conflicts: prefers dark + data-theme="light" */
@media (prefers-color-scheme: dark) {
    [data-theme="light"] .stTabs::after {
        background-image: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8)) !important;
    }
}

