/* TorchLine Custom Styles */

/* Hide Blazor error UI by default */
#blazor-error-ui {
    display: none !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}

#blazor-error-ui.show {
    display: block !important;
}

/* Loading Screen Styles */
.loading-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    z-index: 9999;
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.loading-content {
    text-align: center;
    max-width: 400px;
    animation: fadeInUp 0.6s ease-out;
}

.loading-logo h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3f80ea !important;
    margin-bottom: 0.5rem;
}

.loading-logo i {
    color: #ffc107 !important;
    filter: drop-shadow(0 2px 4px rgba(255, 193, 7, 0.3));
}

.loading-logo p {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.loading-spinner {
    margin: 2rem 0;
}

.spinner-wrapper {
    position: relative;
    display: inline-block;
}

.spinner-wrapper .spinner-border {
    width: 3.5rem;
    height: 3.5rem;
    border-width: 4px;
    border-color: #3f80ea;
    border-right-color: transparent;
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite alternate;
}

.loading-text p {
    margin-bottom: 0.25rem;
}

.loading-text .h6 {
    color: #495057;
    font-weight: 600;
}

.loading-text .small {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(63, 128, 234, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(63, 128, 234, 0.1);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(63, 128, 234, 0);
    }
}

/* Hide loading screen when app loads */
#app:not(:empty) .loading-wrapper {
    display: none;
}

/* Fullscreen loader for test page and other components */
.fullscreen-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.fullscreen-loader .loading-container {
    text-align: center;
}

.fullscreen-loader .loading-content {
    max-width: 400px;
    padding: 2rem;
}

.fullscreen-loader .spinner-wrapper {
    position: relative;
    display: inline-block;
    margin: 1rem 0;
}

.fullscreen-loader .spinner-border {
    width: 3.5rem;
    height: 3.5rem;
    border-width: 4px;
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    animation: spin 1s linear infinite;
}

/* Avatar styling */
.avatar {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid #fff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Enhanced navbar avatar */
.navbar .avatar {
    max-height: 32px !important;
}

/* Profile photo placeholder */
.avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3f80ea 0%, #5a95f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* User dropdown improvements */
.dropdown-toggle::after {
    margin-left: 8px;
}

/* Better spacing for user info in navbar */
.nav-link.dropdown-toggle {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

.nav-link.dropdown-toggle:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Flagged row highlighting */
.flagged-row {
    background-color: #fff3cd !important;
    border-left: 4px solid #fd7e14 !important;
}

.flagged-row:hover {
    background-color: #ffe69c !important;
}

/* ============================================================
   DevExpress DxMaskedInput — Bootstrap form-control integration
   The DX wrapper adds its own border/bg/shadow; strip it and
   restore full Bootstrap form-control appearance on the inner input,
   matching the project's custom validation colors from validation-styles.css
   ============================================================ */

/* 1. Outer wrapper: invisible flex container, no visual chrome */
.dxbl-text-edit {
    display: flex !important;
    align-items: stretch !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: 100%;
}

/* 2. Inner input — base Bootstrap form-control appearance
      (DX resets border:0, background:transparent, box-shadow:none; we undo all of that) */
.dxbl-text-edit > .dxbl-text-edit-input.form-control,
.dxbl-text-edit > .dxbl-text-edit-template .dxbl-text-edit-input.form-control {
    display: block !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    color: var(--bs-body-color, #212529) !important;
    border: 1px solid var(--bs-border-color, #dee2e6) !important;
    border-radius: var(--bs-border-radius, 0.375rem) !important;
    font-weight: 400 !important;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out !important;
    box-shadow: none !important;
    outline: 0 !important;
}

/* 3. Default focus */
.dxbl-text-edit > .dxbl-text-edit-input.form-control:focus,
.dxbl-text-edit > .dxbl-text-edit-template .dxbl-text-edit-input.form-control:focus {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* 4. is-invalid — orange (matches validation-styles.css) */
.dxbl-text-edit > .dxbl-text-edit-input.form-control.is-invalid,
.dxbl-text-edit > .dxbl-text-edit-template .dxbl-text-edit-input.form-control.is-invalid {
    border-color: #f59e0b !important;
    border-width: 2px !important;
}
.dxbl-text-edit > .dxbl-text-edit-input.form-control.is-invalid:focus,
.dxbl-text-edit > .dxbl-text-edit-template .dxbl-text-edit-input.form-control.is-invalid:focus {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 0.25rem rgba(245, 158, 11, 0.25) !important;
}

/* 5. is-valid — theme blue (matches validation-styles.css) */
.dxbl-text-edit > .dxbl-text-edit-input.form-control.is-valid,
.dxbl-text-edit > .dxbl-text-edit-template .dxbl-text-edit-input.form-control.is-valid {
    border-color: #3f80ea !important;
    border-width: 2px !important;
}
.dxbl-text-edit > .dxbl-text-edit-input.form-control.is-valid:focus,
.dxbl-text-edit > .dxbl-text-edit-template .dxbl-text-edit-input.form-control.is-valid:focus {
    border-color: #3f80ea !important;
    box-shadow: 0 0 0 0.25rem rgba(63, 128, 234, 0.25) !important;
}

/* 6. When a trailing button exists (date-picker "..."), square the right edge of the input */
.dxbl-text-edit:has(.dxbl-edit-btn) > .dxbl-text-edit-input.form-control,
.dxbl-text-edit:has(.dxbl-edit-btn) > .dxbl-text-edit-template .dxbl-text-edit-input.form-control {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* 7. Date-picker toggle button styled as Bootstrap input-group-text */
.dxbl-text-edit .dxbl-edit-btn {
    display: flex !important;
    align-items: center !important;
    padding: 0.375rem 0.75rem !important;
    background-color: var(--bs-tertiary-bg, #f8f9fa) !important;
    border: 1px solid var(--bs-border-color, #dee2e6) !important;
    border-left: 0 !important;
    border-top-right-radius: var(--bs-border-radius, 0.375rem) !important;
    border-bottom-right-radius: var(--bs-border-radius, 0.375rem) !important;
    color: var(--bs-body-color, #212529) !important;
    cursor: pointer !important;
}
.dxbl-text-edit:has(.dxbl-text-edit-input.form-control.is-invalid) .dxbl-edit-btn {
    border-color: #f59e0b !important;
    border-width: 2px !important;
    border-left: 0 !important;
}
.dxbl-text-edit:has(.dxbl-text-edit-input.form-control.is-valid) .dxbl-edit-btn {
    border-color: #3f80ea !important;
    border-width: 2px !important;
    border-left: 0 !important;
}
