﻿/* ========================================
   MODERN BASE STYLES AND IMPROVEMENTS
   ======================================== */

/* Modern Typography and Base Styles */
body {
    background-color: #fafafa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #374151;
    /* Keep existing background images for legacy support */
    background-image: url('/images/side_bar_slice.png');
    background-position: top left;
    background-repeat: repeat-y;
}

/* Box-sizing for all elements */
*, *::before, *::after {
    /* 
        Keep this as content-box for compatibility with existing layout
        Consider add a class for "box-sizing: border-box" in future updates for more modern approach
    */
    box-sizing: content-box;
}

/* Modern Input Styling */
input, textarea, select {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: white;
    font-family: inherit;
    font-size: 13px;
}

    input:focus, textarea:focus, select:focus {
        outline: none;
        border-color: #1e40af;
        box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    }

textarea {
    resize: vertical;
}

/* Modern Button Styling */
button, input[type="button"], input[type="submit"] {
    /* background-color: #1e40af;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;*/

    background-color: #eee;
    color: #000;
    border: 1px solid #787878;
    cursor: pointer;
    font-size: 1.0em;
    padding: 5px;
    float: left;
    margin-right: 2px;
    margin-bottom: 2px;
    text-align: center;
    text-decoration: none;
}

    button:hover, input[type="button"]:hover, input[type="submit"]:hover {
        background-color: #1d4ed8;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(30, 64, 175, 0.3);
    }

    button:active, input[type="button"]:active, input[type="submit"]:active {
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
    }

    button:disabled, input[type="button"]:disabled, input[type="submit"]:disabled {
        background-color: #f3f4f6;
        color: #9ca3af;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    /* Secondary Button Style */
    button.secondary {
        background-color: #f3f4f6;
        color: #374151;
        border: 1px solid #d1d5db;
    }

        button.secondary:hover {
            background-color: #e5e7eb;
            color: #1f2937;
        }

/* Modern Link Styling */
a, a:link, a:visited {
    color: #1e40af;
    text-decoration: none;
    transition: color 0.2s ease;
}

    a:hover {
        color: #1d4ed8;
        text-decoration: underline;
    }

/* Enhanced Layout Components */
#appFrame {
    min-height: 100vh;
    background-color: #fafafa;
}

#appHeader {
    width: 100%;
    height: 36px;
    /* Keep existing background for compatibility */
    background-image: url('/images/header_slice.png');
    background-position: bottom left;
    background-repeat: repeat-x;
    margin: 0;
    padding: 0;
    border: 0;
    vertical-align: bottom;
    /* Add modern shadow */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 10;
}

#appHeaderActions {
    float: right;
    padding: 3px;
}

#appBody {
    width: 100%;
    display: flex;
    min-height: calc(100vh - 36px);
}

#appLogo {
    float: left;
}

#appMenu {
    float: left;
}

#appSidebar {
    background-color: white;
    border-right: 1px solid #e5e7eb;
    box-shadow: 1px 0 3px 0 rgba(0, 0, 0, 0.1);
    /* Keep existing background for compatibility */
    background-position: top left;
    background-repeat: repeat-y;
    float: left;
    position: fixed;
    width: 30px;
}

#sidebar-pullout {
    position: fixed;
    top: 50px;
    background-image: url('/images/sidebar-pullout2-bk.png');
    background-repeat: repeat-y;
    width: 25px;
    font-weight: bold;
}

#appSidebar .leftSide {
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAECAIAAAAxsZngAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADdJREFUeNpiXFRjau4YxgAC///+/v7/3x8g4/+/f0Dy359f/////f8PhC5fPM3EQDSgjVKAAAMAN80cW90ams8AAAAASUVORK5CYII=');
    background-position: top left;
    background-repeat: repeat-y;
    float: left;
    height: 100%;
}

#appSidebar .rightSide {
    border-right: 1px solid #d7d3c5;
    display: block;
    float: left;
    height: 100%;
}

#appSidebar .subSectionHeader {
    background: white url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAAcCAIAAADECPmYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAERJREFUeNpi3Lx+OgMDAxMDGDD++vUTwUOlWP79+wui/v//D6IYGP4j8f79RZaDU/8wBbGa8u/fP2wa/hEwE+oygAADACfXP/i7m8VEAAAAAElFTkSuQmCC') repeat-x;
    height: 28px;
    margin-top: 20px;
}

    #appSidebar .subSectionHeader div {
        font-weight: 600;
        color: #374151;
        padding: 8px 0 0 10px;
    }

#appSidebar ul {
    margin: 8px 0;
    padding-left: 0;
    list-style: none;
}

#appSidebar li {
    padding: 8px 0;
    padding-left: 20px;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACVJREFUeNpinGSq+5+BgYERiBmYGCDgPzIHLIDMYYRxwHoAAgwAwb8D/meXxE0AAAAASUVORK5CYII=');
    background-repeat: no-repeat;
    background-position: 0.5em;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

    #appSidebar li:last-child {
        border-bottom: none;
    }

    #appSidebar li:hover {
        background-color: #f0f4f8;
    }

    #appSidebar li a {
        font-weight: 600;
        cursor: pointer;
        color: #1e40af;
        transition: color 0.2s ease;
    }

        #appSidebar li a:hover {
            color: #1d4ed8;
        }

#appContent, #ermFrameworkContent {
    margin-left: 30px;
    float: left;
    flex: 1;
    padding: 6px;
    background-color: #fafafa;
    overflow-y: auto;
}

.data-table {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

    .data-table th:first-child {
        border-top-left-radius: 8px;
    }

    .data-table th:last-child {
        border-top-right-radius: 8px;
    }

.dxrpControl {
    padding: 2px 0;
    margin: 2px 0;
}

/* Modern Table Styling */
/*table {
    width: 100%;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    margin: 3px 0;
}

th {
    background-color: #1e40af;
    color: white;
    font-weight: 600;
    font-size: 13px;
    padding: 12px 16px;
    text-align: left;
    border: none;
    transition: background-color 0.2s ease;
}

    th:first-child {
        border-top-left-radius: 8px;
    }

    th:last-child {
        border-top-right-radius: 8px;
    }

    th:hover {
        background-color: #1d4ed8;
    }

    th a {
        color: white !important;
        text-decoration: none;
        font-weight: 600;
    }

        th a:hover {
            color: #e0f2fe !important;
        }

td {
    padding: 3px 3px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 13px;
    color: #334155;
    transition: background-color 0.15s ease;
}

tr:nth-child(odd) td {
    background-color: #f8fafc;
}

tr:nth-child(even) td {
    background-color: white;
}

tr:hover td {
    background-color: #f0f4f8 !important;
}*/
/* Enhanced Page Title */
.pageTitleLabel {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #6C9CD3;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

/* Modern Forms */
.form {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin: 16px 0;
}

    .form th {
        padding: 12px 16px;
        background-color: #1e40af;
        color: white;
        font-weight: 600;
        font-size: 13px;
    }

    .form td {
        padding: 12px 16px;
        border-bottom: 1px solid #f3f4f6;
    }

    .form .label {
        background-color: #f9fafb;
        color: #374151;
        font-weight: 600;
        border-right: 1px solid #e5e7eb;
    }

/* Error Styling */
.error {
    color: #dc2626;
}

input.error {
    border: 2px solid #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

div.error {
    color: #dc2626;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 12px;
    margin: 12px 0;
}

/* Progress Indicators */
.progressIndicator {
    background-color: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Modern Status Prompt */
#status_prompt {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
    border-radius: 6px 0 0 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

/* Modern Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* Accessibility Improvements */
*:focus {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
}

button:focus, input:focus, textarea:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    th {
        background: #000 !important;
        color: #fff !important;
        border: 2px solid #fff;
    }

    td {
        border-bottom: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   EXISTING STYLES (Keep for compatibility)
   ======================================== */

/* --- Main Menu --- */
.jqx-widget-content-appMenu {
    border-color: #a4bed4;
}

.jqx-fill-state-normal-appMenu, .jqx-widget-header-appMenu {
    border-color: #a4bed4;
    background-color: #e0e9f5;
}

.jqx-fill-state-hover-appMenu {
    border-color: #a4bed4;
    background-color: #cfdde9;
}

.jqx-fill-state-pressed-appMenu {
    border-color: #5e8cb3;
    background-color: #cfdde9;
}

.jqx-fill-state-focus-appMenu {
    border-color: #477396;
}

.jqx-scrollbar-state-normal-appMenu, .jqx-grid-bottomright-appMenu, .jqx-panel-bottomright-appMenu, .jqx-listbox-bottomright-appMenu {
    background-color: #e0e9f5;
}

.jqx-widget-appMenu .jqx-grid-column-header-appMenu, .jqx-grid-cell-appMenu, .jqx-widget-appMenu .jqx-grid-cell-appMenu, .jqx-widget-appMenu .jqx-grid-group-cell-appMenu, .jqx-grid-group-cell-appMenu {
    border-color: #a4bed4;
}

.jqx-tabs-title-selected-bottom-appMenu, .jqx-tabs-selection-tracker-bottom-appMenu, .jqx-tabs-title-selected-top-appMenu, .jqx-tabs-selection-tracker-top-appMenu {
    border-color: #a4bed4;
    border-bottom: 1px solid #fff;
    background: #fff;
}

.jqx-grid-cell-sort-alt-appMenu, .jqx-grid-cell-filter-alt-appMenu, .jqx-grid-cell-pinned-appMenu, .jqx-grid-cell-alt-appMenu, .jqx-grid-cell-sort-appMenu {
    background-color: #e7eef8;
}

.jqx-grid-cell-selected-appMenu {
    background-color: #cfdde9 !important;
    color: #2b465e !important;
}

.jqx-grid-cell-hover-appMenu {
    background-color: #cfdde9 !important;
}

.jqx-menu-vertical-appMenu {
    background: #e0e9f5;
}

.jqx-menu-appMenu {
    background: none;
    border: none;
    font-family: Verdana;
    font-weight: 700;
}

.jqx-menu-item-appMenu {
    font-size: .9em;
    white-space: nowrap;
}

.jqx-menu-item-top-selected-appMenu {
    border-color: transparent;
    background: none;
}

.jqx-menu-item-top-hover-appMenu {
    border-color: #527697;
    background-color: #527697;
}
/* --- End Main Menu --- */

/* --- Page Menu --- */
.jqx-widget-content-pageMenu {
    border-color: #a4bed4;
}

.jqx-fill-state-normal-pageMenu, .jqx-widget-header-pageMenu {
    border-color: #a4bed4;
    background-color: #e0e9f5;
}

.jqx-fill-state-hover-pageMenu {
    border-color: #a4bed4;
    background-color: #cfdde9;
}

.jqx-fill-state-pressed-pageMenu {
    border-color: #5e8cb3;
    background-color: #cfdde9;
}

.jqx-fill-state-focus-pageMenu {
    border-color: #477396;
}

.jqx-scrollbar-state-normal-pageMenu, .jqx-grid-bottomright-pageMenu, .jqx-panel-bottomright-pageMenu, .jqx-listbox-bottomright-pageMenu {
    background-color: #e0e9f5;
}

.jqx-widget-pageMenu .jqx-grid-column-header-pageMenu, .jqx-grid-cell-pageMenu, .jqx-widget-pageMenu .jqx-grid-cell-pageMenu, .jqx-widget-pageMenu .jqx-grid-group-cell-pageMenu, .jqx-grid-group-cell-pageMenu {
    border-color: #a4bed4;
}

.jqx-tabs-title-selected-bottom-pageMenu, .jqx-tabs-selection-tracker-bottom-pageMenu, .jqx-tabs-title-selected-top-pageMenu, .jqx-tabs-selection-tracker-top-pageMenu {
    border-color: #a4bed4;
    border-bottom: 1px solid #fff;
    background: #fff;
}

.jqx-grid-cell-sort-alt-pageMenu, .jqx-grid-cell-filter-alt-pageMenu, .jqx-grid-cell-pinned-pageMenu, .jqx-grid-cell-alt-pageMenu, .jqx-grid-cell-sort-pageMenu {
    background-color: #e7eef8;
}

.jqx-grid-cell-selected-pageMenu {
    background-color: #cfdde9 !important;
    color: #2b465e !important;
}

.jqx-grid-cell-hover-pageMenu {
    background-color: #cfdde9 !important;
}

.jqx-menu-vertical-pageMenu {
    background: #e0e9f5;
}

.jqx-menu-pageMenu {
    background: none;
    border: none;
    font-family: Verdana;
    font-size: .9em;
    font-weight: bold;
}

.jqx-menu-item-pageMenu {
    font-size: .9em;
    white-space: nowrap;
}

.jqx-menu-item-top-selected-pageMenu {
    border-color: transparent;
    background: none;
}

.jqx-menu-item-top-hover-pageMenu {
    border-color: #527697;
    background-color: #527697;
}

.jqx-menu-item-top-pageMenu {
    padding: 1px 2px;
}
/* --- End Page Menu --- */

/* Enhanced Dropdown Menus */
.dropup,
.dropdown {
    position: relative;
}

.dropdown-toggle:focus {
    outline: 0;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    float: left;
    min-width: 160px;
    padding: 8px 0;
    margin: 2px 0 0;
    text-align: left;
    list-style: none;
    background-color: white;
    background-clip: padding-box;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

    .dropdown-menu.pull-right {
        right: 0;
        left: auto;
    }

    .dropdown-menu .divider {
        height: 1px;
        margin: 4px 0;
        overflow: hidden;
        background-color: #e5e7eb;
    }

    .dropdown-menu > li .icon {
        position: absolute;
        padding-left: 3px;
        padding-top: 2px;
    }

    .dropdown-menu > li > a {
        display: block;
        padding: 8px 16px;
        clear: both;
        font-weight: 500;
        line-height: 1.42857143;
        color: #374151;
        white-space: nowrap;
        font-size: 13px;
        transition: all 0.2s ease;
    }

        .dropdown-menu > li > a:hover,
        .dropdown-menu > li > a:focus {
            color: #1f2937;
            text-decoration: none;
            background-color: #f3f4f6;
        }

    .dropdown-menu > .active > a,
    .dropdown-menu > .active > a:hover,
    .dropdown-menu > .active > a:focus {
        color: white;
        text-decoration: none;
        background-color: #1e40af;
        outline: 0;
    }

    .dropdown-menu > .disabled > a,
    .dropdown-menu > .disabled > a:hover,
    .dropdown-menu > .disabled > a:focus {
        color: #9ca3af;
    }

        .dropdown-menu > .disabled > a:hover,
        .dropdown-menu > .disabled > a:focus {
            text-decoration: none;
            cursor: not-allowed;
            background-color: transparent;
            background-image: none;
        }

.open > .dropdown-menu {
    display: block;
}

.open > a {
    outline: 0;
}

.dropdown-menu-right {
    right: 0;
    left: auto;
}

.dropdown-menu-left {
    right: auto;
    left: 0;
}

.dropdown-header {
    display: block;
    padding: 8px 16px;
    color: #6b7280;
    white-space: nowrap;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropdown-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 990;
}

.pull-right > .dropdown-menu {
    right: 0;
    left: auto;
}
