/* Dark Mode for BugTracker.NET - Inspired by OneDark Pro */
/* Color Palette from OneDark Pro:
   Background: #282c34
   Foreground: #abb2bf
   Selection: #3e4451
   Comment: #5c6370
   Red: #e06c75
   Green: #98c379
   Yellow: #e5c07b
   Blue: #61afef
   Purple: #c678dd
   Cyan: #56b6c2
   White: #abb2bf
*/

/* Dark mode styles - applied when body has 'dark-mode' class */
body.dark-mode {
    background: #282c34;
    color: #abb2bf;
}

/* Default link styling for dark mode */
    body.dark-mode a {
        color: #61afef;
        /*color: #2c313a;*/
        text-decoration: none;
    }

        body.dark-mode a:hover {
            color: #61afef;
            text-decoration: none;
        }

/* Specific styles for toggle links in edit_bug.aspx */
body.dark-mode #hideshow_images,
body.dark-mode #hideshow_history {
    color: #61afef !important;
}

/* Main containers */
body.dark-mode .menubar {
    background: linear-gradient(135deg, #21252b 0%, #282c34 100%) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

body.dark-mode .align {
    background: #282c34;
}

/* Tables */
body.dark-mode .bugt {
    background: #21252b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

    body.dark-mode .bugh {
        background: #2c313a;
        color: #abb2bf;
        border-color: #3e4451;
        padding: 10px !important;
    }

body.dark-mode .bugh a {
    color: #61afef !important;
}

body.dark-mode .bugh a:hover {
    color: #98c379 !important;
}

/* Table header styles for first row */
body.dark-mode .bugt thead tr:first-child th,
body.dark-mode .bugt tr:first-child .bugh {
    background: #2c313a;
    color: #abb2bf;
    border-color: #3e4451;
}

body.dark-mode .bugd {
    background: #282c34;
    color: #abb2bf;
    border-color: #3e4451;
}

body.dark-mode .bugd a {
    color: #61afef !important;
}

body.dark-mode .bugd a:hover {
    color: #98c379 !important;
}

/* Alternate row coloring */
body.dark-mode tr:nth-child(even) .bugd {
    background: #2c313a;
}

body.dark-mode tr:nth-child(even) .bugd_desc_dark {
    background: #2c313a;
}

/* Alternate row coloring for text-based status colors (Category column) */
body.dark-mode tr:nth-child(even) .bugd_red_text,
body.dark-mode tr:nth-child(even) .bugd_purple_text,
body.dark-mode tr:nth-child(even) .bugd_blue_text,
body.dark-mode tr:nth-child(even) .bugd_green_text,
body.dark-mode tr:nth-child(even) .bugd_black_text {
    background: #2c313a !important;
}

/* Form controls */
body.dark-mode select,
body.dark-mode input[type="text"],
body.dark-mode input[type="password"],
body.dark-mode textarea {
    background: #21252b;
    color: #abb2bf;
    border-color: #3e4451;
    margin: 5px;
}

body.dark-mode select:focus,
body.dark-mode input[type="text"]:focus,
body.dark-mode input[type="password"]:focus,
body.dark-mode textarea:focus {
    border-color: #61afef;
    box-shadow: 0 0 0 3px rgba(97, 175, 239, 0.2);
}

/* Filter controls */
    body.dark-mode .bugs_filter {
        background: #21252b;
        color: #abb2bf;
        border-color: #3e4451;
        margin: 0px !important;
    }

body.dark-mode .bugs_filter_selected {
    background: #528bcc !important;
    color: white !important;
    border-color: #61afef !important;
    font-weight: bold;
}

/* Selected input styling for dark mode */
    body.dark-mode .buginput_selected {
       /* background: #61afef !important;
        color: #282c34 !important;*/
        border-color: #61afef !important;
        /* background: #61afef !important;
        color: #282c34 !important;
        border-color: #528bcc !important;*/
        font-size: 11pt;
        margin: 5px;
        margin-top: 0px;
        padding: 3px;
        vertical-align: middle;
    }

body.dark-mode .buginput_selected:focus {
    /*background: #528bcc !important;*/
    box-shadow: 0 0 0 3px rgba(97, 175, 239, 0.3);
}

/* Buttons */
body.dark-mode .menubtn,
body.dark-mode .btn {
    background: #61afef;
    color: #282c34;
}

body.dark-mode .menubtn:hover,
body.dark-mode .btn:hover {
    background: #528bcc;
    box-shadow: 0 4px 8px rgba(97, 175, 239, 0.3);
}

/* White background cells - convert to dark mode background */
body.dark-mode .bugd_white {
    background: #282c34 !important;
    color: #abb2bf !important;
    border-color: #3e4451 !important;
}

/* Status colors - adjusted for dark mode */
body.dark-mode .bugd_red {
    background: #e06c75 !important;
    color: #282c34 !important;
    border-color: #3e4451;
}

body.dark-mode .bugd_purple {
    background: #c678dd !important;
    color: #282c34 !important;
    border-color: #3e4451;
}

body.dark-mode .bugd_blue {
    background: #61afef !important;
    color: #282c34 !important;
    border-color: #3e4451;
}

body.dark-mode .bugd_green {
    background: #98c379 !important;
    color: #282c34 !important;
    border-color: #3e4451;
}

body.dark-mode .bugd_yellow {
    background: #e5c07b !important;
    color: #282c34 !important;
    border-color: #3e4451;
}

body.dark-mode .bugd_dark-blue {
    background: #56b6c2 !important;
    color: #282c34 !important;
    border-color: #3e4451;
}

body.dark-mode .bugd_dark-black {
    background: #21252b !important;
    color: #abb2bf !important;
    border-color: #5c6370 !important;
}

/* Text-based status colors - override base CSS with higher specificity */
body.dark-mode td .bugd_red_text,
body.dark-mode .bugd_red_text {
    color: #e06c75 !important;
    border-color: #3e4451 !important;
    background: #282c34 !important;
}

body.dark-mode td .bugd_purple_text,
body.dark-mode .bugd_purple_text {
    color: #c678dd !important;
    border-color: #3e4451 !important;
    background: #282c34 !important;
}

body.dark-mode td .bugd_blue_text,
body.dark-mode .bugd_blue_text {
    color: #61afef !important;
    border-color: #3e4451 !important;
    background: #282c34 !important;
}

body.dark-mode td .bugd_green_text,
body.dark-mode .bugd_green_text {
    color: #98c379 !important;
    border-color: #3e4451 !important;
    background: #282c34 !important;
}

body.dark-mode td .bugd_black_text,
body.dark-mode .bugd_black_text {
    color: #abb2bf !important;
    border-color: #3e4451 !important;
    background: #282c34 !important;
}

/* Popup */
body.dark-mode .buglist_popup {
    background: #21252b;
    color: #abb2bf;
    border-color: #3e4451;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* Paging section */
body.dark-mode .buglist_paging {
    color: #abb2bf;
}

body.dark-mode .buglist_paging a {
    color: #61afef !important;
}

/* Logo area */
body.dark-mode .logo {
    background: transparent !important;
}

/* Dark mode toggle button - two styles available */

/* Style 1: Floating button (commented out by default) */
/*
.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #61afef;
    color: #282c34;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}
*/

/* Style 2: Inline toggle in header */
.theme-toggle {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 15px;
    padding: 5px 15px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    vertical-align: middle;
    font-weight: normal;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

body.dark-mode .theme-toggle {
    background: rgba(171, 178, 191, 0.1);
    border-color: rgba(171, 178, 191, 0.2);
    color: #abb2bf;
}

body.dark-mode .theme-toggle:hover {
    background: rgba(171, 178, 191, 0.2);
}

/* Icon for toggle - removed to keep it minimal */
.theme-toggle::before {
    display: none;
}

/* Toggle text */
.theme-toggle-text {
    font-size: 12px;
    font-weight: normal;
}

/* Smooth transitions */
body,
.menubar,
.bugt,
.bugh,
.bugd,
select,
input,
textarea,
.btn,
.menubtn,
.buglist_popup {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Special cells with bgcolor - override for dark mode */
body.dark-mode td[bgcolor] {
    opacity: 0.9;
}

/* Convert white backgrounds to dark mode */
body.dark-mode td[bgcolor="white"],
body.dark-mode td[bgcolor="#ffffff"],
body.dark-mode td[bgcolor="#FFFFFF"],
body.dark-mode td[bgcolor="#fff"],
body.dark-mode td[bgcolor="#FFF"] {
    background: #282c34 !important;
    color: #abb2bf !important;
}

/* Specific class + bgcolor combinations */
body.dark-mode .bugd_project[bgcolor="#ffffff"],
body.dark-mode .bugd_project[bgcolor="#FFFFFF"],
body.dark-mode .bugd_project[bgcolor="#fff"],
body.dark-mode .bugd_project[bgcolor="#FFF"],
body.dark-mode .bugd_project[bgcolor="white"] {
    background: #282c34 !important;
    color: #abb2bf !important;
}

/* Other bugd_ classes that might have white backgrounds */
body.dark-mode .bugd_desc,
body.dark-mode .bugd_project,
body.dark-mode .bugd_store {
    border-color: #3e4451 !important;
}

/* Filter row cells (bugf class) */
body.dark-mode .bugf {
    background: #282c34 !important;
    color: #abb2bf !important;
    border-color: #3e4451 !important;
}

/* When these classes have white backgrounds */
    body.dark-mode .bugd_desc[bgcolor="#ffffff"],
    body.dark-mode .bugd_desc[bgcolor="#FFFFFF"],
    body.dark-mode .bugd_desc[bgcolor="#fff"],
    body.dark-mode .bugd_desc[bgcolor="#FFF"],
    body.dark-mode .bugd_desc[bgcolor="white"],
    body.dark-mode .bugd_store[bgcolor="#ffffff"],
    body.dark-mode .bugd_store[bgcolor="#FFFFFF"],
    body.dark-mode .bugd_store[bgcolor="#fff"],
    body.dark-mode .bugd_store[bgcolor="#FFF"],
    body.dark-mode .bugd_store[bgcolor="white"],
    body.dark-mode .bugd_store[bgcolor="#b37beb"] {
        background: #282c34 !important;
        color: #abb2bf !important;
    }

/* Links within white background cells (non-bugd_desc) */
body.dark-mode td[bgcolor="#ffffff"]:not(.bugd_desc) a,
body.dark-mode td[bgcolor="#FFFFFF"]:not(.bugd_desc) a,
body.dark-mode td[bgcolor="#fff"]:not(.bugd_desc) a,
body.dark-mode td[bgcolor="#FFF"]:not(.bugd_desc) a,
body.dark-mode td[bgcolor="white"]:not(.bugd_desc) a {
    color: #61afef !important;
}

/*body.dark-mode .bugd_desc[bgcolor="#ffffff"] a:hover,
body.dark-mode .bugd_desc[bgcolor="#FFFFFF"] a:hover,
body.dark-mode .bugd_desc[bgcolor="#fff"] a:hover,
body.dark-mode .bugd_desc[bgcolor="#FFF"] a:hover,
body.dark-mode .bugd_desc[bgcolor="white"] a:hover,
body.dark-mode td[bgcolor="#ffffff"] a:hover,
body.dark-mode td[bgcolor="#FFFFFF"] a:hover,
body.dark-mode td[bgcolor="#fff"] a:hover,
body.dark-mode td[bgcolor="#FFF"] a:hover,
body.dark-mode td[bgcolor="white"] a:hover {
    color: #98c379 !important;
}*/

/* Adjust colored backgrounds for better visibility in dark mode */
body.dark-mode td[bgcolor="#ff9999"] { background: #a63946 !important; }
body.dark-mode td[bgcolor="#ffcccc"] { background: #8b3139 !important; }
body.dark-mode td[bgcolor="#ffdddd"] { background: #70282f !important; }

body.dark-mode td[bgcolor="#aaffaa"] { background: #4a7c4e !important; }
body.dark-mode td[bgcolor="#ccffcc"] { background: #3d6b41 !important; }
body.dark-mode td[bgcolor="#ddffdd"] { background: #305a34 !important; }

body.dark-mode td[bgcolor="#ffff99"] { background: #8b7531 !important; }
body.dark-mode td[bgcolor="#ffffcc"] { background: #70602a !important; }
body.dark-mode td[bgcolor="#ffffdd"] { background: #564b22 !important; }

body.dark-mode td[bgcolor="#ccccff"] { background: #3e4a7c !important; }
body.dark-mode td[bgcolor="#ddddff"] { background: #313d6b !important; }
body.dark-mode td[bgcolor="#aaaaff"] { background: #4a5695 !important; }

/* Small text and labels */
body.dark-mode .smallnote {
    color: #abb2bf;
}

body.dark-mode .lbl {
    color: #abb2bf;
}

/* Bug ID styling for dark mode */
body.dark-mode .bugid {
    color: #61afef; /* Blue color for bug ID in dark mode */
    font-weight: bold;
}

/* Bug ID update status colors for dark mode */
body.dark-mode .bugid.update-success {
    color: #98c379 !important; /* Green from OneDark palette */
    font-weight: bold !important;
}

body.dark-mode .bugid.update-failed {
    color: #e06c75 !important; /* Red from OneDark palette */
    font-weight: bold !important;
}

/* Control border highlighting for dark mode */
body.dark-mode .control-update-success {
    border: 4px solid #98c379 !important; /* Green from OneDark palette */
    box-shadow: 0 0 8px rgba(152, 195, 121, 0.6) !important; /* Stronger glow in dark mode */
}

body.dark-mode .control-update-failed {
    border: 4px solid #e06c75 !important; /* Red from OneDark palette */
    box-shadow: 0 0 8px rgba(224, 108, 117, 0.6) !important; /* Stronger glow in dark mode */
}

/* Edit bug page specific */
body.dark-mode .frm {
    background: #21252b;
    border-color: #3e4451;
}

body.dark-mode .cmt {
    background: #21252b;
    border-color: #3e4451;
}

/* Comment text styling for dark mode - optimized for readability */
    body.dark-mode .cmt_text {
        color: #abb2bf !important; /* Lighter gray for better contrast */
        font-family: 'Segoe UI', 'Arial', sans-serif; /* More modern, readable font */
        line-height: 1.8; /* Increased line height for easier reading */
        font-size: 13pt; /* Slightly larger base font */
    }

    body.dark-mode .cmt_text p {
        color: #abb2bf !important;
        font-size: 13pt !important;
        margin: 0.8em 0; /* More spacing between paragraphs */
    }

    body.dark-mode .cmt_text td {
        color: #abb2bf !important;
        font-size: 13pt !important;
        padding: 4px; /* Add padding for table cells */
    }

/* Override inline styles and font tags in comments */
    body.dark-mode .cmt_text span[style*="color: rgb(0, 0, 0)"],
    body.dark-mode .cmt_text span[style*="color:#000000"],
    body.dark-mode .cmt_text span[style*="color: #000000"],
    body.dark-mode .cmt_text font[color="#000000"],
    body.dark-mode .cmt_text font[color="black"],
    body.dark-mode .cmt_text * {
        color: #abb2bf;
    }

/* Links within comments */
body.dark-mode .cmt_text a {
    color: #61afef !important;
    text-decoration: underline;
}

body.dark-mode .cmt_text a:hover {
    color: #98c379 !important;
    text-decoration: none;
}

/* Code blocks or preformatted text in comments */
        body.dark-mode .cmt_text pre,
        body.dark-mode .cmt_text code {
            background: #e6e6e6;
            color: #e06c75;
            padding: 2px 4px;
            border-radius: 3px;
            font-family: 'Consolas', 'Monaco', monospace;
        }

/* Tables within comments */
body.dark-mode .cmt_text table {
    border-color: #3e4451;
}

body.dark-mode .cmt_text th {
    background: #2c313a;
    color: #abb2bf;
    border-color: #3e4451;
}

body.dark-mode .cmt_text tr {
    border-color: #3e4451;
}

/* Blockquotes in comments */
body.dark-mode .cmt_text blockquote {
    border-left: 4px solid #3e4451;
    padding-left: 1em;
    color: #828997;
    margin: 0.5em 0;
}

/* Post/comment metadata - brighter green for dark mode */
    body.dark-mode .pst {
        font-size: 9pt;
        color: #abb2bf !important; /* Bright green for better visibility */
    }

/* Mobile menu toggle */
body.dark-mode #mobile-menu-toggle {
    background: #21252b;
    color: #abb2bf;
}

/* Edit bug page action links */
body.dark-mode #merge_bug a,
body.dark-mode #clone_bug a,
body.dark-mode #delete_bug a,
body.dark-mode #tasks a,
body.dark-mode #attachment a {
    color: #61afef !important;
}

body.dark-mode #merge_bug a:hover,
body.dark-mode #clone_bug a:hover,
body.dark-mode #delete_bug a:hover,
body.dark-mode #tasks a:hover,
body.dark-mode #attachment a:hover {
    color: #98c379 !important;
}

/* Prev/Next navigation links */
body.dark-mode #prev_next a.warn {
    color: #61afef !important;
}

body.dark-mode #prev_next a.warn:hover {
    color: #98c379 !important;
}

/* Disabled prev/next links */
body.dark-mode #prev_next .gray_link {
    color: #5c6370 !important; /* Dimmed gray for disabled state */
}

/* Menu labels */
body.dark-mode .menulabel {
    color: #61afef !important;
}

body.dark-mode .menulabel:hover {
    color: #98c379 !important;
}

/* Disable hover effects - prevent the light gray background from appearing */
body.dark-mode .bugt tr:hover .bugd {
    background: transparent !important;
}

/* For cells with bgcolor attribute, maintain their dark mode colors on hover */
body.dark-mode .bugt tr:hover td[bgcolor="#ffffff"],
body.dark-mode .bugt tr:hover td[bgcolor="white"] {
    background: #282c34 !important;
}

/* Keep status colors unchanged on hover */
body.dark-mode .bugt tr:hover .bugd_red { background: #e06c75 !important; }
body.dark-mode .bugt tr:hover .bugd_purple { background: #c678dd !important; }
body.dark-mode .bugt tr:hover .bugd_blue { background: #61afef !important; }
body.dark-mode .bugt tr:hover .bugd_green { background: #98c379 !important; }
body.dark-mode .bugt tr:hover .bugd_yellow { background: #e5c07b !important; }
body.dark-mode .bugt tr:hover .bugd_dark-blue { background: #56b6c2 !important; }
body.dark-mode .bugt tr:hover .bugd_white { background: #282c34 !important; }

/* Special handling for Store, Task, and other columns that may have class + bgcolor */
body.dark-mode .bugt tr:hover .bugd_store[bgcolor="#ffffff"],
body.dark-mode .bugt tr:hover .bugd_desc[bgcolor="#ffffff"],
body.dark-mode .bugt tr:hover .bugd_project[bgcolor="#ffffff"] {
    background: #282c34 !important;
}

/* Handle inline styles in comment tables */
/* Override inline background-color styles with rgb values */
body.dark-mode .cmt_text td[style*="background-color: rgb(239, 239, 239)"],
body.dark-mode .cmt_text td[style*="background-color: rgb(255, 255, 255)"],
body.dark-mode .cmt_text td[style*="background-color: rgb(255,255,255)"],
body.dark-mode .cmt_text td[style*="background-color: rgb(239,239,239)"] {
    background-color: #282c34 !important;
}

/* Handle specific text colors for better contrast */
body.dark-mode .cmt_text td[style*="color: rgb(234, 153, 153)"],
body.dark-mode .cmt_text td[style*="color: rgb(234,153,153)"] {
    color: #e06c75 !important; /* Bright red for dark mode */
}

body.dark-mode .cmt_text td[style*="color: rgb(255, 0, 0)"],
body.dark-mode .cmt_text td[style*="color: rgb(255,0,0)"] {
    color: #ff6b6b !important; /* Brighter red for warnings */
}

body.dark-mode .cmt_text td[style*="color: rgb(32, 213, 81)"],
body.dark-mode .cmt_text td[style*="color: rgb(32,213,81)"] {
    color: #98c379 !important; /* Adjusted green for dark mode */
}

/* Handle border colors in comment tables */
body.dark-mode .cmt_text td[style*="border"],
body.dark-mode .cmt_text tr[style*="border"] {
    border-color: #3e4451 !important;
}

/* Ensure all text in comment tables is visible */
body.dark-mode .cmt_text td {
    color: #e6e6e6 !important;
}

/* Special handling for nested elements in comment tables */
body.dark-mode .cmt_text td span,
body.dark-mode .cmt_text td div {
    color: inherit !important;
}

/* Post container styling for dark mode */
body.dark-mode .cmt {
    background: #21252b !important;
    background-color: #21252b !important;
    color: #abb2bf !important;
}

/* Ensure all post backgrounds are dark */
body.dark-mode .post,
body.dark-mode div[id^="posts"],
body.dark-mode table[bgcolor="white"],
body.dark-mode table[bgcolor="#ffffff"],
body.dark-mode td[bgcolor="white"],
body.dark-mode td[bgcolor="#ffffff"],
body.dark-mode table[style*="background-color: white"],
body.dark-mode table[style*="background-color:#ffffff"],
body.dark-mode table[style*="background-color: #ffffff"],
body.dark-mode table[style*="background-color: rgb(255, 255, 255)"],
body.dark-mode td[style*="background-color: white"],
body.dark-mode td[style*="background-color:#ffffff"],
body.dark-mode td[style*="background-color: #ffffff"],
body.dark-mode td[style*="background-color: rgb(255, 255, 255)"] {
    background: #21252b !important;
    background-color: #21252b !important;
    color: #abb2bf !important;
}

/* Post content table styling for server-side generated posts */
body.dark-mode .post-content-table {
    background: #21252b !important;
    background-color: #21252b !important;
    color: #abb2bf !important;
}

body.dark-mode .post-content-table td {
    background: #21252b !important;
    background-color: #21252b !important;
    color: #abb2bf !important;
}

/* Override any inline styles on post tables */
body.dark-mode .post-content-table[style],
body.dark-mode .post-content-table td[style] {
    background: #21252b !important;
    background-color: #21252b !important;
    color: #abb2bf !important;
}

/* Override inline background styles on comment cells */
body.dark-mode td.cmt[style*="background"] {
    background: #21252b !important;
    background-color: #21252b !important;
}

/* Fix reported_by span appearance in dark mode */
body.dark-mode #reported_by {
    color: #abb2bf !important;
    background-color: transparent !important;
    font-size: 12px;
}

body.dark-mode #reported_by a {
    color: #61afef !important;
    text-decoration: none;
}

body.dark-mode #reported_by a:hover {
    color: #98c379 !important;
    text-decoration: underline;
}

/* Fix white background with white text issue in dark mode */
    /*body.dark-mode input,
    body.dark-mode select,
    body.dark-mode textarea,
    body.dark-mode .txt,
    body.dark-mode .buginput,
    body.dark-mode input.txt,
    body.dark-mode input.buginput,
    body.dark-mode select.txt,
    body.dark-mode select.buginput
    {
        background-color: #282c34 !important;
        color: #abb2bf !important;
        border-color: #abb2bf !important;
    }*/

/* Remove the universal selector that was causing issues */

/* Specifically target form elements */
/*body.dark-mode input[type="text"],
body.dark-mode input[type="password"],
body.dark-mode input[type="email"],
body.dark-mode input[type="number"],
body.dark-mode input[type="date"],
body.dark-mode select,
body.dark-mode textarea {
    background-color: #282c34 !important;
    color: #abb2bf !important;
}*/

/* Override any inline styles */
body.dark-mode [style*="background"] {
    background: #282c34 !important;
    background-color: #282c34 !important;
}

body.dark-mode [style*="color: white"],
body.dark-mode [style*="color:#fff"],
body.dark-mode [style*="color: #fff"],
body.dark-mode [style*="color:#ffffff"],
body.dark-mode [style*="color: #ffffff"] {
    color: #abb2bf !important;
}

/* Target specific problematic elements */
/*body.dark-mode .frm input,
body.dark-mode .frm select,
body.dark-mode .frm textarea {
    background-color: #282c34 !important;
    color: #abb2bf !important;
}*/

/* Ensure dropdown options are visible */
body.dark-mode option {
    background-color: #282c34 !important;
    color: #abb2bf !important;
}

/* Selected dropdown options should have contrasting colors */
body.dark-mode .bugs_filter_selected option {
    background-color: #21252b !important;
    color: #abb2bf !important;
}

body.dark-mode .bugs_filter_selected option:checked {
    background-color: #3e4451 !important;
    color: #61afef !important;
}

/* Fix placeholders */
body.dark-mode input::placeholder {
    color: #5c6370 !important;
    opacity: 1 !important;
}

/* Fix specific white-on-white text issues */
body.dark-mode .stat {
    background-color: transparent !important;
    color: #abb2bf !important;
}

body.dark-mode span {
    background-color: transparent !important;
}

/* Fix any remaining white text */
body.dark-mode [style*="color: white"] {
    color: #abb2bf !important;
}

/* Ensure all text in form is visible */
body.dark-mode .frm {
    color: #abb2bf !important;
}

/*body.dark-mode .frm * {
    color: inherit !important;
}*/

/* Fix code blocks and preformatted text in dark mode */
body.dark-mode code {
    background-color: #3e4451 !important;
    color: #e06c75 !important;
    padding: 2px 4px;
    border-radius: 3px;
}

body.dark-mode pre {
    background-color: #3e4451 !important;
    color: #abb2bf !important;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
}

body.dark-mode pre code {
    background-color: transparent !important;
    color: inherit !important;
    padding: 0;
}

/* Fix inline code elements that might have white background */
body.dark-mode code[style*="background"],
body.dark-mode code[style*="color: white"],
body.dark-mode code[style*="color:#fff"],
body.dark-mode code[style*="color: #fff"],
body.dark-mode code[style*="color:#ffffff"],
body.dark-mode code[style*="color: #ffffff"] {
    background-color: #3e4451 !important;
    color: #e06c75 !important;
}

/* Ensure monospace text is visible */
body.dark-mode .mono,
body.dark-mode .monospace,
body.dark-mode tt {
    background-color: #3e4451 !important;
    color: #e06c75 !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Fix imports status column in dark mode */
body.dark-mode .imports_d {
    background-color: #282c34;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .imports_green_font {
    background-color: #282c34 !important;
    color: #98c379 !important; /* Bright green for completed status */
    border-color: #4b5263;
}

/* Fix imports table headers and filters */
body.dark-mode .imports_h {
    background: #21252b;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .imports_f {
    background: #21252b;
    border-color: #4b5263;
}

body.dark-mode .imports_filter {
    background: #21252b;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .imports_filter_selected,
body.dark-mode select.imports_filter_selected {
    background: #e5c07b !important; /* Yellow for selected */
    color: #282c34 !important;
    border: 1px solid #e5c07b !important;
    font-weight: bold;
}

body.dark-mode .imports_title {
    color: #e5c07b; /* Yellow/orange theme color */
}

body.dark-mode .imports_menulabel {
    color: #98c379; /* Green */
}

body.dark-mode .imports_menubtn {
    background: #e5c07b;
    color: #282c34;
}

body.dark-mode .imports_menuinput {
    background: #21252b;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .imports_menuinput_selected,
body.dark-mode input.imports_menuinput_selected {
    background: #e5c07b !important;
    color: #282c34 !important;
    border-color: #e5c07b !important;
}

body.dark-mode .imports_checkbox {
    color: #e5c07b;
}

/* Fix deployments page dark mode */
body.dark-mode .deployments_h {
    background: #21252b;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .deployments_f {
    background: #21252b;
    border-color: #4b5263;
}

body.dark-mode .deployments_filter {
    background: #21252b;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .deployments_filter_selected,
body.dark-mode select.deployments_filter_selected {
    background: #98c379 !important; /* Green for selected */
    color: #282c34 !important;
    border: 1px solid #98c379 !important;
    font-weight: bold;
}

body.dark-mode .deployments_d {
    background-color: #282c34;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .deployments_green_font {
    background-color: #282c34 !important;
    color: #98c379 !important;
    border-color: #4b5263;
}

body.dark-mode .deployments_red_font {
    background-color: #282c34 !important;
    color: #e06c75 !important;
    border-color: #4b5263;
}

body.dark-mode .deployments_title {
    color: #98c379; /* Green theme color */
}

body.dark-mode .deployments_menulabel {
    color: #98c379;
}

body.dark-mode .deployments_menubtn {
    background: #98c379;
    color: #282c34;
}

body.dark-mode .deployments_menuinput {
    background: #21252b;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .deployments_menuinput_selected,
body.dark-mode input.deployments_menuinput_selected {
    background: #98c379 !important;
    color: #282c34 !important;
    border-color: #98c379 !important;
}

body.dark-mode .deployments_checkbox {
    color: #98c379;
}

/* Fix builds page dark mode */
body.dark-mode .builds_h {
    background: #21252b;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .builds_f {
    background: #21252b;
    border-color: #4b5263;
}

body.dark-mode .builds_filter {
    background: #21252b;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .builds_filter_selected,
body.dark-mode select.builds_filter_selected {
    background: #61afef !important; /* Blue for selected */
    color: #282c34 !important;
    border: 1px solid #61afef !important;
    font-weight: bold;
}

body.dark-mode .builds_d {
    background-color: #282c34;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .builds_title {
    color: #61afef; /* Blue theme color */
}

body.dark-mode .builds_menulabel {
    color: #98c379;
}

body.dark-mode .builds_menubtn {
    background: #61afef;
    color: #282c34;
}

body.dark-mode .builds_menuinput {
    background: #21252b;
    color: #abb2bf;
    border-color: #4b5263;
}

    body.dark-mode .builds_menuinput_selected,
    body.dark-mode input.builds_menuinput_selected {
        background: #21252b !important;
        /*color: #282c34 !important;*/
        border-color: #61afef !important;
    }

body.dark-mode .builds_checkbox {
    color: #61afef;
}

body.dark-mode .builds_green_font {
    background-color: #282c34 !important;
    color: #98c379 !important;
    border-color: #4b5263;
}

body.dark-mode .builds_red_font {
    background-color: #282c34 !important;
    color: #e06c75 !important;
    border-color: #4b5263;
}

/* Fix dark borders on monitor page search buttons */
body.dark-mode .imports_menubtn,
body.dark-mode .deployments_menubtn,
body.dark-mode .builds_menubtn,
body.dark-mode .tests_menubtn,
body.dark-mode .merges_menubtn,
body.dark-mode .sprints_menubtn,
body.dark-mode .app_monitor_menubtn {
    border: 1px solid currentColor !important;
    cursor: pointer;
}

/* Merges filter selected */
body.dark-mode .merges_filter_selected,
body.dark-mode select.merges_filter_selected {
    background: #cf6464 !important; /* Reddish color matching merges theme */
    color: #282c34 !important;
    border: 1px solid #cf6464 !important;
    font-weight: bold;
}

/* Fix tests page dark mode */
body.dark-mode .tests_h {
    background: #21252b;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .tests_f {
    background: #21252b;
    border-color: #4b5263;
}

body.dark-mode .tests_filter {
    background: #21252b;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .tests_filter_selected,
body.dark-mode select.tests_filter_selected {
    background: #e06c75 !important; /* Red for selected */
    color: #282c34 !important;
    border: 1px solid #e06c75 !important;
    font-weight: bold;
}

body.dark-mode .tests_d {
    background-color: #282c34;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .tests_title {
    color: #e06c75; /* Red theme color */
}

body.dark-mode .tests_menulabel {
    color: #98c379;
}

body.dark-mode .tests_menubtn {
    background: #e06c75;
    color: #282c34;
}

body.dark-mode .tests_menuinput {
    background: #21252b;
    color: #abb2bf;
    border-color: #4b5263;
}

body.dark-mode .tests_menuinput_selected,
body.dark-mode input.tests_menuinput_selected {
    background: #e06c75 !important;
    color: #282c34 !important;
    border-color: #e06c75 !important;
}

/* Merges menuinput_selected */
body.dark-mode .merges_menuinput_selected,
body.dark-mode input.merges_menuinput_selected {
    background: #cf6464 !important; /* Reddish color matching merges theme */
    color: #282c34 !important;
    border-color: #cf6464 !important;
}

/* General menuinput_selected (used in bugs.aspx) */
    body.dark-mode .menuinput_selected,
    body.dark-mode input.menuinput_selected {
        background: #21252b !important; /* Blue to match general theme */
        color: #61afef !important;
        border-color: #61afef !important;
    }

/* Fix search button borders in dark mode */
body.dark-mode input[type="submit"][value="Search"] {
    border: 1px solid #61afef !important;
    background-color: #61afef !important;
    color: #282c34 !important;
    cursor: pointer;
}

/* Fix Clear button X visibility in dark mode */
body.dark-mode input[type="submit"][value="Clear"],
body.dark-mode input[type="button"][value="Clear"],
body.dark-mode button:contains("Clear") {
    border: 1px solid #abb2bf !important;
    background-color: #3e4451 !important;
    color: #abb2bf !important;
    cursor: pointer;
}

/* If Clear button uses × symbol */
body.dark-mode input[type="submit"][value="×"],
body.dark-mode input[type="button"][value="×"],
body.dark-mode input[value*="×"] {
    border: 1px solid #abb2bf !important;
    background-color: #3e4451 !important;
    color: #abb2bf !important;
    font-weight: bold;
    cursor: pointer;
}

    /* Default: fallback to dark text unless overridden */
    body.dark-mode td.bugd_desc a {
        color: #282c34;
        text-decoration: none;
    }

    /* New class for Task column when Priority is empty - dark mode styling */
    body.dark-mode td.bugd_desc_dark {
        background: #282c34;
        color: #abb2bf;
        border-color: #3e4451;
    }
    
    body.dark-mode td.bugd_desc_dark a {
        color: #61afef !important;
        text-decoration: none;
    }
    
    body.dark-mode td.bugd_desc_dark a:hover {
        color: #98c379 !important;
    }


/* Links in Task column without bgcolor (dark background) inherit from .bugd a */
/* No need to override - they already get #61afef from .bugd a */

body.dark-mode .tests_checkbox {
    color: #e06c75;
}

/* Clear Filters Button - Dark Mode */
body.dark-mode #clearFiltersBtn {
    background: #3e4451 !important;
    color: #abb2bf !important;
}

body.dark-mode #clearFiltersBtn:hover {
    background: #4b5263 !important;
    border-color: #61afef !important;
    color: #61afef !important;
}

/* Fix tests status column colors */
body.dark-mode .tests_green_font {
    background-color: #282c34 !important;
    color: #98c379 !important; /* Bright green for completed/passed */
    border-color: #4b5263;
}

body.dark-mode .tests_red_font {
    background-color: #282c34 !important;
    color: #e06c75 !important; /* Bright red for failed/canceled */
    font-weight: bold;
    border-color: #4b5263;
}

/* Modern button-17 styles for Dark theme */
body.dark-mode .button-17 {
    background: #2c313a;
    border: 2px solid #3e4451;
    color: #abb2bf;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    border-radius: 8px; /* More squared to match menubar buttons */
    padding: 8px 20px; /* Adjusted padding for better proportions */
    height: 40px; /* Slightly reduced height */
}

body.dark-mode .button-17:hover {
    background: #3e4451;
    border-color: #4b5263;
    color: #e6e6e6;
    box-shadow: 0 3px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08);
    transform: translateY(-1px);
}

    body.dark-mode .button-17:active {
        /*background: #21252b;*/
        background: #2c313a;
        color: #abb2bf;
        border-color: #21252b;
        box-shadow: 0 1px 2px rgba(0,0,0,0.4), inset 0 1px 3px rgba(0,0,0,0.2);
        transform: translateY(0);
    }

body.dark-mode .button-17:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(97, 175, 239, 0.25), 0 2px 4px rgba(0,0,0,0.3);
    border-color: #61afef;
}

/* Pressed state for Dark theme */
    body.dark-mode .button-17.pressed {
        background: #2c313a;
        color: #abb2bf;
        border-color: #61afef;
        box-shadow: 0 2px 4px rgba(97, 175, 239, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
        font-weight: 600;
    }

body.dark-mode .button-17.pressed:hover {
    background: #528bcc;
    border-color: #4279bb;
    box-shadow: 0 3px 6px rgba(97, 175, 239, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

body.dark-mode .button-17.pressedFilter {
    background: #c678dd;
    border-color: #b465d3;
    color: #282c34;
    box-shadow: 0 2px 4px rgba(198, 120, 221, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
    font-weight: 600;
}

body.dark-mode .button-17.pressedFilter:hover {
    background: #b465d3;
    border-color: #a252c8;
    box-shadow: 0 3px 6px rgba(198, 120, 221, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Menu button styling for dark mode */
    body.dark-mode .menubtn {
        border: 1px solid #61afef !important;
        background-color: #61afef !important;
        color: #282c34 !important;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        transition: all 0.2s ease;
    }

body.dark-mode .menubtn:hover {
    background: #4b5263;
    color: #e6e6e6;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.4);
    text-decoration: none;
}

body.dark-mode .menubtn:active {
    background: #2c313a;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Fix Search button positioning in filter forms */
body.dark-mode #searchFilters .menubtn,
body.dark-mode form[action="search_text.aspx"] .menubtn {
    /*margin-top: 22px !important;*/
   /* margin-bottom: 5px !important;*/
    vertical-align: bottom;
}

/* Fix form layout in dark mode - remove float to prevent cutoff */
body.dark-mode #searchFilters > div {
    float: none !important;
}

/* Ensure form maintains horizontal layout without floats - but only when visible */
body.dark-mode #searchFilters.visible {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-end !important;
    gap: 16px !important;
}

/* Merges page styling for dark mode */
body.dark-mode .merges_h {
    background: #2c313a;
    color: #abb2bf;
    border-color: #3e4451;
}

body.dark-mode .merges_f {
    background: #21252b;
    color: #abb2bf;
    border-color: #3e4451;
}

/* Merges page form controls */
body.dark-mode .merges_f select,
body.dark-mode .merges_f input[type="text"] {
    background: #282c34;
    color: #abb2bf;
    border: 1px solid #3e4451;
}

body.dark-mode .merges_f select:focus,
body.dark-mode .merges_f input[type="text"]:focus {
    border-color: #61afef;
    box-shadow: 0 0 0 2px rgba(97, 175, 239, 0.2);
}

/* Merges table cells alternating rows */
body.dark-mode tr:nth-child(even) .merges_f {
    background: #282c34;
}

/* Dark mode scrollbar styling for dropdowns */
body.dark-mode .bugs_filter {
    scrollbar-width: thin;
    scrollbar-color: #4b5263 #21252b;
}

/* Webkit browsers (Chrome, Safari, Edge) */
body.dark-mode .bugs_filter::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

body.dark-mode .bugs_filter::-webkit-scrollbar-track {
    background: #21252b;
    border-radius: 6px;
}

body.dark-mode .bugs_filter::-webkit-scrollbar-thumb {
    background: #4b5263;
    border-radius: 6px;
    border: 2px solid #21252b;
}

body.dark-mode .bugs_filter::-webkit-scrollbar-thumb:hover {
    background: #61afef;
}

/* Also style scrollbars for all select elements in dark mode */
body.dark-mode select {
    scrollbar-width: thin;
    scrollbar-color: #4b5263 #21252b;
}

body.dark-mode select::-webkit-scrollbar {
    width: 12px;
}

body.dark-mode select::-webkit-scrollbar-track {
    background: #21252b;
}

body.dark-mode select::-webkit-scrollbar-thumb {
    background: #4b5263;
    border-radius: 4px;
}

body.dark-mode select::-webkit-scrollbar-thumb:hover {
    background: #61afef;
}

/* Active row styling for app monitor page */
body.dark-mode .deployments_d.active-row {
    background-color: #3e4451 !important;
    color: #e6e6e6 !important;
    /*border-color: #61afef !important;
    box-shadow: inset 0 0 0 2px #61afef;*/
}

/* Target Monitor Status Column Colors - Dark Theme */
body.dark-mode .assignee-counts .bugh.status-opendev,
body.dark-mode .assignee-counts .status-opendev {
    color: #c678dd !important;  /* Purple - adjusted for dark theme */
    font-weight: bold;
}

body.dark-mode .assignee-counts .bugh.status-openci,
body.dark-mode .assignee-counts .status-openci {
    color: #61afef !important;  /* Blue - dark theme blue */
    font-weight: bold;
}

body.dark-mode .assignee-counts .bugh.status-openqa,
body.dark-mode .assignee-counts .status-openqa {
    color: #98c379 !important;  /* Green - dark theme green */
    font-weight: bold;
}

body.dark-mode .assignee-counts .bugh.status-opencd,
body.dark-mode .assignee-counts .status-opencd {
    color: #e5c07b !important;  /* Yellow - adjusted for dark theme */
    font-weight: bold;
}

body.dark-mode .assignee-counts .bugh.status-closed,
body.dark-mode .assignee-counts .status-closed {
    color: #5c6370 !important;  /* Gray - lighter for visibility */
    font-weight: bold;
}

body.dark-mode .assignee-counts .bugh.status-waiting,
body.dark-mode .assignee-counts .status-waiting {
    color: #e06c75 !important;  /* Red - dark theme red */
    font-weight: bold;
}

body.dark-mode .assignee-counts .bugh.status-total,
body.dark-mode .assignee-counts .status-total {
    color: #abb2bf !important;  /* Default text color in dark mode */
    font-weight: bold;
}

/* Modal dialog styles for dark mode - Add New Target popup */
body.dark-mode .modal {
    background-color: rgba(0,0,0,0.7);
}

body.dark-mode .modal-content {
    background-color: #2c313a;
    color: #abb2bf;
    border: 1px solid #3e4451;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

body.dark-mode .modal-header {
    color: #e5c07b;
    border-bottom: 1px solid #3e4451;
}

body.dark-mode .modal-body {
    color: #abb2bf;
}

body.dark-mode .modal-footer {
    border-top: 1px solid #3e4451;
}

body.dark-mode .form-label {
    color: #abb2bf;
}

body.dark-mode .form-input,
body.dark-mode .form-select {
    background-color: #21252b;
    color: #abb2bf;
    border: 1px solid #3e4451;
    padding: 5px;
}

body.dark-mode .form-input:focus,
body.dark-mode .form-select:focus {
    border-color: #61afef;
    outline: none;
    box-shadow: 0 0 3px rgba(97, 175, 239, 0.3);
}

body.dark-mode .modal-footer .btn {
    background-color: #3e4451;
    color: #abb2bf;
    border: 1px solid #4b5263;
    padding: 5px 15px;
    cursor: pointer;
    margin-left: 5px;
}

body.dark-mode .modal-footer .btn:hover {
    background-color: #4b5263;
    color: #61afef;
}

/* Save button gets primary color */
body.dark-mode .modal-footer .btn:first-child {
    background-color: #61afef;
    color: #282c34;
}

body.dark-mode .modal-footer .btn:first-child:hover {
    background-color: #98c379;
}
