/* Elegant Toolbar Styling */

/* Additional Form and Body Styles */
body {
    background-color: #ebebeb;
    height: 100%;
}

.form {
    padding-bottom: 0;
}

.content {
    display: table;
}

.formLayout-container {
    background-color: white;
    margin-left: auto;
    margin-right: auto;
    max-width: 99%;
}

.formLayout-verticalAlign {
    display: table-cell;
    vertical-align: middle;
}

.formLayout-groupBox {
    margin: 0;
    padding: 0 !important;
}

.formLayout-generalErrorText {
    color: red;
    padding: 0 !important;
}

.eye-button {
    background: none;
}

    .eye-button > div {
        background: url('Images/eye-button.svg') no-repeat center;
        width: 18px;
        height: 12px;
        vertical-align: baseline;
        pointer-events: none;
        user-select: none;
    }

    .eye-button.show-password > div {
        background: url('Images/eye-button-hide.svg') no-repeat center;
    }

input[type=password]::-ms-reveal,
input[type=password]::-ms-clear {
    display: none;
}

.footer-wrapper {
    position: static;
    display: table-row;
}

/* Main Toolbar Container */
:root {
    --toolbar-bg-gradient: linear-gradient(135deg, #4a90e2 0%, #2c5aa0 100%);
    --toolbar-radius: 10px;
    --toolbar-item-size: 45px; /* Increased back to 45px for better icon containment */
    --toolbar-item-radius: 12px;
    --toolbar-shadow: 0 10px 30px rgba(74, 144, 226, 0.3), 0 4px 15px rgba(44, 90, 160, 0.2), inset 0 1px 0 rgba(135, 206, 235, 0.2);
}

.page-toolbar {
    background: var(--toolbar-bg-gradient);
    border-radius: var(--toolbar-radius);
    box-shadow: var(--toolbar-shadow);
    position: relative;
    overflow: hidden;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    height: 50px; /* Increased from 41px to 50px to properly contain icons */
    min-height: 50px; /* Added min-height to ensure consistency */
}

    .page-toolbar .item {
        border-radius: var(--toolbar-item-radius);
        width: var(--toolbar-item-size);
        height: var(--toolbar-item-size);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border: 0 !important;
    }

    /* Animated Background Effect */
    .page-toolbar::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(135, 206, 235, 0.1), transparent);
        animation: shimmer 3s infinite;
    }

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Menu Items Container */
.page-toolbar .dxm-main {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
}

/* Individual Menu Items - Updated to match toolbar height */
.page-toolbar .item {
    border-radius: var(--toolbar-item-radius);
    width: var(--toolbar-item-size);
    height: var(--toolbar-item-size);
    background: rgba(30, 144, 255, 0.1) !important;
    border: 0 !important;
    margin: 2.5px 2px !important; /* Adjusted margin for better vertical centering */
    padding: 0 !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    backdrop-filter: blur(5px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 45px; /* Updated to match item size */
    max-width: 45px; /* Updated to match item size */
    width: 45px; /* Updated to match item size */
}

/* Menu Item Content */
.page-toolbar .dxm-content {
    color: #1e3a8a !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
}

/* Menu Item Icons - Updated to 30x30 for better containment */
.page-toolbar .dxm-image {
    filter: brightness(1.2) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)) !important;
    transition: all 0.3s ease !important;
    width: 30px !important; /* Increased from 28px to 30px */
    height: 30px !important; /* Increased from 28px to 30px */
    max-width: 30px !important;
    max-height: 30px !important;
}

/* Hover Effects */
.page-toolbar .item:hover {
    background: rgba(30, 144, 255, 0.25) !important;
    border: 0 !important;
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 4px 15px rgba(30, 144, 255, 0.1) !important;
}

    .page-toolbar .item:hover .dxm-image {
        transform: scale(1.1) rotate(5deg) !important;
        filter: brightness(1.4) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4)) !important;
    }

    .page-toolbar .item:hover .dxm-content {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
    }

/* Active/Pressed State */
.page-toolbar .item:active {
    transform: translateY(-1px) scale(0.98) !important;
    transition: all 0.1s ease !important;
}

/* Special Styling for Title - Updated height */
.page-toolbar .item:first-child {
    background: rgba(30, 144, 255, 0.15) !important;
    border: 0 !important;
    padding: 0 !important;
    margin-right: 20px !important;
    margin-top: -2.5px !important; /* Adjusted for new toolbar height */
    width: auto !important;
    height: 50px !important; /* Updated to match toolbar height */
    min-width: auto !important;
    min-height: 50px !important; /* Updated to match toolbar height */
    max-width: none !important;
    max-height: 50px !important; /* Updated to match toolbar height */
}

    .page-toolbar .item:first-child .dxm-content {
        font-size: 16px !important;
        font-weight: 700 !important;
        color: #1e3a8a !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
        width: 100% !important;
        height: 100% !important;
        padding: 0 !important;
    }

/* Navigation Buttons (First, Prev, Next, Last) */
.page-toolbar .item[data-name="PageFirst"],
.page-toolbar .item[data-name="PagePrev"],
.page-toolbar .item[data-name="PageNext"],
.page-toolbar .item[data-name="PageLast"] {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    border: 0 !important;
}

    .page-toolbar .item[data-name="PageFirst"]:hover,
    .page-toolbar .item[data-name="PagePrev"]:hover,
    .page-toolbar .item[data-name="PageNext"]:hover,
    .page-toolbar .item[data-name="PageLast"]:hover {
        background: linear-gradient(135deg, #43a4fd 0%, #00e8fe 100%) !important;
        box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4) !important;
    }

/* Action Buttons (Save, New, Edit, Delete) */
.page-toolbar .item[data-name="Save"] {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%) !important;
    border: 0 !important;
}

.page-toolbar .item[data-name="New"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: 0 !important;
}

.page-toolbar .item[data-name="Delete"] {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%) !important;
    border: 0 !important;
}

.page-toolbar .item[data-name="Print"] {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%) !important;
    border: 0 !important;
}

.page-toolbar .item[data-name="Export"] {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%) !important;
    border: 0 !important;
}

/* Operations Menu - Updated positioning */
.page-toolbar .item[data-name="Operations"] {
    width: 400px !important;
    min-width: 400px !important;
    max-width: 400px !important;
    margin-top: 0px !important; /* Adjusted for new toolbar height */
    padding: 0 !important;
    text-align: center;
    border: 0 !important;
}

    .page-toolbar .item[data-name="Operations"] .dxm-content {
        color: #1e3a8a !important;
    }

    /* Ensure dropdown arrow doesn't cause overflow */
    .page-toolbar .item[data-name="Operations"] .dxm-dropDownArrow {
        margin-left: 10px !important;
    }

/* Pager Special Styling - DevExpress Menu Item Targeting */
.page-toolbar .dxm-item[name="Pager"],
.page-toolbar .dxm-item:has(table),
.page-toolbar .dxm-content:has(table),
.page-toolbar li[data-name="Pager"],
.page-toolbar li:has(#GotoBox) {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    background: rgba(30, 144, 255, 0.2) !important;
    border: 0 !important;
    padding: 0 !important;
}

/* More specific DevExpress targeting */
.dxmMenuItemWithImage_Aqua:has(#GotoBox),
.dxmMenuItem_Aqua:has(#GotoBox),
.dxmMenuSeparator_Aqua + .dxmMenuItem_Aqua:has(table),
.page-toolbar .dxm-main .dxm-item:has(#GotoBox) {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    padding: 0 !important;
}

/* Direct control targeting */
.page-toolbar #GotoBox {
    width: 10mm !important;
    min-width: 10mm !important;
    max-width: 10mm !important;
    background-color: #4169e1 !important;
    padding: 0 !important;
    border: 0 !important;
}

.page-toolbar #LblTotalRecords {
    width: 10mm !important;
    min-width: 10mm !important;
    max-width: 10mm !important;
    height: 25px !important;
    border: 0 !important;
    padding: 0 !important;
}

/* Table container targeting */
.page-toolbar table:has(#GotoBox),
.page-toolbar table:has(#LblTotalRecords) {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    padding: 0 !important;
}

/* Alternative targeting using parent containers */
div:has(> #GotoBox),
td:has(#GotoBox),
tr:has(#GotoBox),
table:has(#GotoBox) {
    width: 150px !important;
    padding: 0 !important;
}

/* Fallback - target ALL dropdown menu items (if you only have one dropdown) */
.page-toolbar .dxmMenuItemWithSubMenu {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    border: 0 !important;
    border-radius: 12px !important;
    padding: 0 !important;
}

.page-toolbar .item[data-name="Pager"] table {
    border-spacing: 8px;
    width: 100%;
    padding: 0 !important;
}

.page-toolbar .item[data-name="Pager"] .dxeTextBox,
.page-toolbar .item[data-name="Pager"] .dxeLabel {
    border-radius: 8px !important;
    border: 0 !important;
    background: rgba(30, 144, 255, 0.9) !important;
    color: #1e3a8a !important;
    font-weight: 600 !important;
    text-align: center !important;
    width: 65px !important;
    min-width: 65px !important;
    padding: 0 !important;
}

/* Specific styling for pager components */
.page-toolbar .item[data-name="Pager"] #GotoBox {
    background-color: rgba(65, 105, 225, 0.8) !important;
    width: 10mm !important;
    min-width: 10mm !important;
    max-width: 10mm !important;
    padding: 0 !important;
    border: 0 !important;
}

.page-toolbar .item[data-name="Pager"] #LblTotalRecords {
    width: 10mm !important;
    min-width: 10mm !important;
    max-width: 10mm !important;
    height: 25px !important;
    line-height: 25px !important;
    border: 0 !important;
    background: rgba(30, 144, 255, 0.9) !important;
    text-align: center !important;
    padding: 0 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-toolbar {
        border-radius: 15px;
        margin: 10px 0;
        padding: 0 !important;
        border: 0 !important;
        height: 45px; /* Adjusted for responsive - increased from 37px */
        min-height: 45px; /* Added min-height */
    }

        .page-toolbar .item {
            width: 40px; /* Increased from 37px */
            height: 40px; /* Increased from 37px */
            border-radius: 8px;
            padding: 0 !important;
            border: 0 !important;
            margin: 2.5px 2px !important; /* Adjusted margin */
        }

        .page-toolbar .dxm-content {
            font-size: 11px !important;
            padding: 0 !important;
            color: #1e3a8a !important;
        }

        .page-toolbar .dxm-image {
            width: 26px !important; /* Increased from 22px */
            height: 26px !important; /* Increased from 22px */
            max-width: 26px !important;
            max-height: 26px !important;
        }

        .page-toolbar .item:first-child {
            padding: 0 !important;
            margin-right: 10px !important;
            margin-top: -2.5px !important; /* Adjusted for new height */
            width: auto !important;
            height: 45px !important; /* Updated height */
            min-width: auto !important;
            min-height: 45px !important; /* Updated height */
            max-width: none !important;
            max-height: 45px !important; /* Updated height */
            border: 0 !important;
        }

            .page-toolbar .item:first-child .dxm-content {
                font-size: 14px !important;
                padding: 0 !important;
                color: #1e3a8a !important;
            }

        .page-toolbar .item[data-name="Pager"] {
            width: 100px !important;
            height: auto !important;
            min-width: 100px !important;
            min-height: auto !important;
            max-width: 100px !important;
            max-height: none !important;
            padding: 0 !important;
            border: 0 !important;
        }

            .page-toolbar .item[data-name="Pager"] #GotoBox,
            .page-toolbar .item[data-name="Pager"] #LblTotalRecords {
                width: 8mm !important;
                min-width: 8mm !important;
                max-width: 8mm !important;
                font-size: 12px !important;
                padding: 0 !important;
                border: 0 !important;
            }

        /* Fix for Operations menu width */
        .page-toolbar .item[data-name="Operations"] {
            width: 400px !important;
            min-width: 400px !important;
            max-width: 400px !important;
            margin-top: 0px !important; /* Adjusted for new height */
            padding: 0 !important;
            text-align: center;
            border: 0 !important;
        }

            .page-toolbar .item[data-name="Operations"] .dxm-content {
                color: #1e3a8a !important;
            }

            /* Ensure dropdown arrow doesn't cause overflow */
            .page-toolbar .item[data-name="Operations"] .dxm-dropDownArrow {
                margin-left: 10px !important;
            }

    /* Responsive adjustments */
    @media (max-width: 768px) {
        .page-toolbar .item[data-name="Operations"] {
            width: 400px !important;
            min-width: 400px !important;
            max-width: 400px !important;
            padding: 0 !important;
            border: 0 !important;
        }
    }

    @media (max-width: 480px) {
        .page-toolbar .item[data-name="Operations"] {
            width: 400px !important;
            min-width: 400px !important;
            max-width: 400px !important;
            padding: 0 !important;
            border: 0 !important;
        }
    }
}

@media (max-width: 480px) {
    .page-toolbar {
        border-radius: 12px;
        margin: 0px 0;
        padding: 0 !important;
        border: 0 !important;
        height: 40px; /* Increased from 35px for better containment */
        min-height: 40px; /* Added min-height */
    }

        .page-toolbar .item {
            width: 36px; /* Increased from 33px */
            height: 36px; /* Increased from 33px */
            border-radius: 8px;
            padding: 0 !important;
            border: 0 !important;
            margin: 2px 2px !important; /* Adjusted margin */
        }

        .page-toolbar .dxm-image {
            width: 24px !important; /* Adjusted icon size */
            height: 24px !important; /* Adjusted icon size */
            max-width: 24px !important;
            max-height: 24px !important;
        }
}

/* Loading State */
.page-toolbar.loading {
    opacity: 0.7;
    pointer-events: none;
    padding: 0 !important;
}

    .page-toolbar.loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        margin: -10px 0 0 -10px;
        border: 2px solid rgba(135, 206, 235, 0.3);
        border-top: 2px solid #87ceeb;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Accessibility */
.page-toolbar .item:focus {
    outline: 3px solid rgba(135, 206, 235, 0.6);
    outline-offset: 2px;
}

.page-toolbar .item:focus-visible {
    outline: 3px solid #87ceeb;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .page-toolbar {
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%) !important;
        border: 0 !important;
        padding: 0 !important;
    }

        .page-toolbar .item {
            border: 0 !important;
            background: rgba(30, 144, 255, 0.5) !important;
            padding: 0 !important;
        }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .page-toolbar .item,
    .page-toolbar .dxm-image,
    .page-toolbar::before {
        transition: none !important;
        animation: none !important;
    }

        .page-toolbar .item:hover {
            transform: none !important;
        }
}

/* Print Styles */
@media print {
    .page-toolbar {
        background: #e6f3ff !important;
        color: #1e40af !important;
        box-shadow: none !important;
        border: 0 !important;
        padding: 0 !important;
    }

        .page-toolbar .item {
            background: #dbeafe !important;
            color: #1e40af !important;
            border: 0 !important;
            padding: 0 !important;
        }
}
