/* ==========================================================================
   eFileMyForms Omnibox Styles
   Shared across inline Omnibox inputs, floating bottom-right Omnibox widget,
   contextual "?" / info triggers, answer modal, and Admin template preview.
   ========================================================================== */

/* --- Contextual Help Trigger ("?" / Info Glyphicon) --- */
.omnibox-help-trigger {
    display: none;
    background: none;
    border: none;
    padding: 2px 4px;
    margin-left: 4px;
    color: var(--bg-primary, #023C40);
    font-size: 14px;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

body.omnibox-enabled .omnibox-help-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.omnibox-help-trigger:hover,
.omnibox-help-trigger:focus {
    opacity: 1;
    transform: scale(1.1);
    outline: none;
}

.omnibox-help-trigger:focus-visible {
    box-shadow: 0 0 0 2px rgba(2, 60, 64, 0.25);
    border-radius: 50%;
}

.omnibox-help-trigger.is-loading {
    pointer-events: none;
    opacity: 0.5;
}

/* --- Multi-Instance Omnibox Search Input --- */
.omnibox-wrap {
    position: relative;
    max-width: 360px;
    width: 100%;
}

.omnibox-inner {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.omnibox-icon {
    height: 20px;
    width: 18px;
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 2;
}

.omnibox-input {
    width: 100%;
    height: 36px !important;
    padding: 6px 46px 6px 36px !important;
    font-size: 14px;
    color: #333;
    background: #fff;
    border: 1px solid #d2d6dc !important;
    border-radius: 8px !important;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    max-width: 400px;
}

.omnibox-input:focus {
    border-color: var(--bg-primary, #023C40) !important;
    box-shadow: 0 0 0 2px rgba(2, 60, 64, 0.15) !important;
    outline: none;
    font-style: normal;
}

/* --- Rotating Placeholder Fade Animation --- */
    .omnibox-input::-webkit-input-placeholder {
        color: #333;
        opacity: 1;
        transition: opacity 0.4s ease-in-out;
        font-size: 12px;
    }

    .omnibox-input::-moz-placeholder {
        color: #333;
        opacity: 1;
        transition: opacity 0.4s ease-in-out;
        font-size: 12px;
    }

    .omnibox-input::placeholder {
        color: #333;
        opacity: 1;
        transition: opacity 0.4s ease-in-out;
        font-size: 12px;
    }

.omnibox-input.placeholder-fading::-webkit-input-placeholder {
    opacity: 0;
}

.omnibox-input.placeholder-fading::-moz-placeholder {
    opacity: 0;
}

.omnibox-input.placeholder-fading::placeholder {
    opacity: 0;
}

/* --- Clear & Spinner Controls --- */
.omnibox-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 16px;
    color: #8c939f;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    z-index: 2;
}

.omnibox-clear:hover {
    color: #4a5568;
}

.omnibox-spinner {
    position: absolute;
    right: 30px;
    top: 56%;
    transform: translateY(-50%);
    color: #8c939f;
    font-size: 13px;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
}

/* --- Suggestions Dropdown (Default: Downward) --- */
.omnibox-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d2d6dc;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    z-index: 1050;
    max-height: 280px;
    overflow-y: auto;
}

.omnibox-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 4px 0 !important;
}

.omnibox-item {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #1a202c;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #f1f3f5;
    transition: background-color 0.12s ease;
}

.omnibox-item:last-child {
    border-bottom: none;
}

.omnibox-item:hover,
.omnibox-item:focus,
.omnibox-item.active {
    background-color: #f4f7f6;
    color: var(--bg-primary, #023C40);
    outline: none;
}

.omnibox-item-category {
    font-size: 11px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.omnibox-no-results {
    padding: 10px 14px;
    font-size: 12.5px;
    color: #718096;
    font-style: italic;
}

/* --- Floating Bottom-Right Omnibox Widget --- */
.omnibox-floating-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1040;
}

.omnibox-wrap.omnibox-floating {
    max-width: calc(100vw - 48px);
    width: 320px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
    border-radius: 8px;
    transition: width 0.25s ease, box-shadow 0.25s ease;
}

.omnibox-wrap.omnibox-floating:focus-within {
    width: 380px;
    max-width: calc(100vw - 48px);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
}

.omnibox-wrap.omnibox-floating .omnibox-input {
    border-radius: 8px !important;
    padding-right: 64px !important;
    height: 40px !important;
}

.omnibox-minimize-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 19px;
    color: #8c939f;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
    z-index: 2;
}

.omnibox-minimize-btn:hover {
    color: #4a5568;
}

.omnibox-wrap.omnibox-floating .omnibox-clear {
    right: 30px;
}

.omnibox-wrap.omnibox-floating .omnibox-spinner {
    right: 48px;
}

.omnibox-wrap.omnibox-floating .omnibox-dropdown {
    top: auto;
    bottom: calc(100% + 8px);
    max-height: 360px;
    box-shadow: 0 -6px 22px rgba(0, 0, 0, 0.16);
    border-radius: 8px;
}

.omnibox-fab {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--bg-primary, #023C40);
    border: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.omnibox-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
}

.omnibox-fab img {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1);
}

@media (prefers-reduced-motion: reduce) {
    .omnibox-input::placeholder,
    .omnibox-input::-webkit-input-placeholder,
    .omnibox-input::-moz-placeholder,
    .omnibox-help-trigger,
    .omnibox-wrap.omnibox-floating,
    .omnibox-fab {
        transition: none;
    }
}

/* --- Shared Omnibox Answer Modal & Rich Content Formatting --- */
.omnibox-modal {
    background: #ffffff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

#omniboxModalContainer .omnibox-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 650px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 9999;
}

#omniboxModalContainer .omnibox-modal.omnibox-modal-small {
    max-width: 450px;
}

#omniboxModalContainer .omnibox-modal.omnibox-modal-medium {
    max-width: 650px;
}

#omniboxModalContainer .omnibox-modal.omnibox-modal-large {
    max-width: 900px;
}

.omnibox-modal .efmf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.omnibox-modal .efmf-modal-title {
    margin: 0;
    font-weight: 600;
    color: var(--bg-primary, #023C40);
    font-size: 18px;
}

.omnibox-modal .efmf-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #666;
    padding: 0;
}

.omnibox-modal .efmf-modal-close:hover {
    color: #1a202c;
}

.omnibox-modal .efmf-modal-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.omnibox-modal-body,
.omnibox-modal .efmf-modal-body {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.omnibox-answer table th,
.omnibox-answer table td {
    padding: 4px;
}

.omnibox-modal ul,
.omnibox-answer ul,
#omniboxModalBody ul {
    list-style: disc !important;
    list-style-type: disc !important;
    margin: 10px 0 16px 0 !important;
    padding-left: 24px !important;
}

.omnibox-modal ul > li,
.omnibox-answer ul > li,
#omniboxModalBody ul > li {
    list-style: disc !important;
    list-style-type: disc !important;
    display: list-item !important;
    margin-bottom: 6px !important;
}

.omnibox-modal ol,
.omnibox-answer ol,
#omniboxModalBody ol {
    list-style: decimal !important;
    list-style-type: decimal !important;
    margin: 10px 0 16px 0 !important;
    padding-left: 24px !important;
}

.omnibox-modal ol > li,
.omnibox-answer ol > li,
#omniboxModalBody ol > li {
    list-style: decimal !important;
    list-style-type: decimal !important;
    display: list-item !important;
    margin-bottom: 6px !important;
}

.omnibox-modal .alert,
.omnibox-modal .alert-warning,
.omnibox-modal .alert-info,
.omnibox-modal .alert-success,
.omnibox-modal .alert-danger {
    display: block !important;
    margin-bottom: 16px !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.omnibox-modal .alert-warning {
    background-color: #fff8e6 !important;
    border: 1px solid #ffd591 !important;
    color: #874d00 !important;
}

.omnibox-modal .alert-info {
    background-color: #e6f7ff !important;
    border: 1px solid #91d5ff !important;
    color: #0050b3 !important;
}

.omnibox-modal .alert-success {
    background-color: #f6ffed !important;
    border: 1px solid #b7eb8f !important;
    color: #237804 !important;
}

.omnibox-modal .alert-danger {
    background-color: #fff1f0 !important;
    border: 1px solid #ffa39e !important;
    color: #a8071a !important;
}

.omnibox-modal h5 {
    font-size: 15px !important;
    font-weight: 600 !important;
    margin: 16px 0 8px 0 !important;
    color: #1a202c !important;
}

.omnibox-modal .card {
    background: #fafbfc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 14px 16px;
}

.omnibox-modal .badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.omnibox-modal .badge-success { background: #d4edda; color: #155724; }
.omnibox-modal .badge-warning { background: #fff3cd; color: #856404; }
.omnibox-modal .badge-danger  { background: #f8d7da; color: #721c24; }
.omnibox-modal .badge-info    { background: #d1ecf1; color: #0c5460; }

.omnibox-modal a {
    color: #00707c;
    text-decoration: underline;
    font-weight: 500;
}

.omnibox-modal a:hover {
    color: #023c40;
}

.omnibox-modal .omnibox-links {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 16px;
}

.omnibox-modal .omnibox-links p {
    margin-bottom: 6px !important;
    font-size: 13.5px;
}

.omnibox-modal .omnibox-links p:last-child {
    margin-bottom: 0 !important;
}
