/* =============================================
   SHARED STYLES — BidChatR Portal
   Common classes extracted from Pages + Layout
   ============================================= */

/* ---- Base ---- */
.cursor-pointer { cursor: pointer; }

/* Clickable row-name link used in table "Actions"/name columns across Reports, History,
   UserManagement, and ManagementTemplatesList — has no href, so it needs an explicit pointer. */
.username-lik { cursor: pointer; }

.fs-7 { font-size: 0.85rem !important; }

.mini-text { font-size: 0.7rem; }

.hr-divider {
    border: 0;
    height: 2px;
    background-image: linear-gradient(to right, rgba(220,220,220,1), rgba(255,255,255,0));
    /* calc (not a plain 100%) so the 93px left offset doesn't push the right edge past the
       page — a plain width:100% + margin-left:93px overflowed the viewport horizontally. */
    width: calc(100% - 93px);
    margin-left: 93px;
}

/* Section heading used above ManagementDashboard's client picker, ManagementSuggestionBuilder,
   and ManagementTemplatesList — the 51px offset was tuned to roughly align with the card grid
   above it on desktop; it eats too much of a narrow phone screen, so it's reduced below 768px. */
.section-title-offset {
    font-size: 1.3em;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 27px;
    margin-left: 51px;
    margin-top: 24px;
}

/* ---- Avatar Circles ---- */
.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.avatar-circle-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.avatar-circle-xs {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* ---- Dot Badge ---- */
.dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.badge-custom {
    display: inline-flex;
    align-items: center;
    font-size: 0.62rem;
    padding: 3px 5px;
    background-color: transparent !important;
}

/* ---- Spinner ---- */
.spinner-custom {
    width: 2.5rem;
    height: 2.5rem;
    color: #2b394a;
}

/* ---- Page Loading Overlay ---- */
.page-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border-radius: 10px;
    z-index: 500;
    align-self: center;
}

.page-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* ---- Empty State ---- */
.empty-state-container { min-height: 250px; }

.empty-icon-circle {
    width: 56px;
    height: 56px;
    background-color: #f8fafc;
    border: 1px dashed #dee2e6;
    border-radius: 50%;
}

.empty-desc {
    font-size: 0.76rem;
    max-width: 220px;
    line-height: 1.4;
}

/* ---- Orange Buttons ---- */
.orange-btn {
    background-color: var(--brand-primary, #f59e23);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
}

.orange-btn:hover {
    background-color: white;
    color: var(--brand-primary, #f59e23);
    border: 1px solid var(--brand-primary, #f59e23);
}

.btn-search {
    background-color: var(--brand-primary, #f59e23);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 36px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
}

.btn-search:hover {
    background-color: white;
    color: var(--brand-primary, #f59e23);
    border: 1px solid var(--brand-primary, #f59e23);
}

/* ---- Layout Header Refresh Button ----
   Shared by ManagementLayout and PageLayout's top bars (previously duplicated byte-for-byte in
   each layout's own scoped .razor.css). */
.refresh-button {
    background-color: var(--brand-primary, #f09224); /* Accurate orange hex code */
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background-color 0.2s;
}

.refresh-button:hover {
    background-color: var(--brand-primary-dark, #d67d16);
    transform: scale(1.05);
}

.refresh-button svg {
    width: 32px;
    height: 32px;
    color: #ffffff;
}

.refresh-button::after {
    display: none !important;
}

/* ---- Floating Action Buttons ---- */
.floating-actions-container {
    position: fixed;
    bottom: 15px;
    right: 70px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1050;
}

.floating-actions-container-scroll {
    position: fixed;
    bottom: 13px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1050;
}

.btn-orange-floating {
    background-color: var(--brand-primary, #f7931e);
    color: #ffffff;
    border: none;
    font-weight: 500;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 0 10px 0 #7f8082;
}

.btn-orange-floating:hover {
    background-color: white;
    color: var(--brand-primary, #f59e23);
    border: 1px solid var(--brand-primary, #f59e23);
}

.btn-floating-delete {
    padding: 10px 28px;
    border-radius: 12px;
    box-shadow: 0 0 10px 0 #7f8082;
}

.btn-floating-add {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 0 10px 0 #7f8082;
}

    .btn-floating-add i {
        -webkit-text-stroke: 1.5px;
    }

.btn-floating-top {
    min-width: 30px;
    width: 32px;
    height: 33px;
    border-radius: 10px;
    font-size: 1rem;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 0 10px 0 #7f8082;
}

    .btn-floating-top i {
        -webkit-text-stroke: 1.5px;
        font-size: 12px
    }

    .btn-floating-top.show {
        opacity: 1;
        visibility: visible;
    }

/* Fixed container anchored at the bottom right screen edge */
.floating-actions-container-left {
    position: fixed;
    bottom: 13px;
    float: left;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1050; /* Ensures buttons sit securely above table grids and cards */
}

/* ---- Cards (shared card shell) ---- */

/*.search-card {
    border: 0 !important; 
    box-shadow: 0 0 30px 5px #efefef !important;
}*/

.search-card,
.user-list-card {
    border-radius: 12px;
    overflow: hidden;
    background-color: #ffffff;
    border: 0;
    box-shadow: 0 0 30px 5px #efefef;
}

.search-card { margin: 20px auto; }
.user-list-card { margin: 40px auto; }

/* ---- Collapsible Panel Headers ---- */
.search-header-btn,
.panel-header-btn {
    background-color: #757575;
    color: #ffffff;
    width: 100%;
    text-align: left;
    border: none;
    padding: 16px 24px;
    font-size: 1.15rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.search-header-btn:hover,
.search-header-btn:focus {
    background-color: #616161;
    color: #ffffff;
    outline: none;
    box-shadow: none;
}

.search-header-btn .bi-caret-up-fill,
.panel-header-btn .bi-caret-up-fill {
    transition: transform 0.2s ease;
    font-size: 0.85rem;
}

.search-header-btn.collapsed .bi-caret-up-fill,
.panel-header-btn.collapsed .bi-caret-up-fill {
    transform: rotate(180deg);
}

/* ---- Panel Body / Footer ---- */
.search-body,
.panel-body { padding: 24px; }

.search-instructions,
.instruction-text {
    color: #666666;
    font-size: 0.95rem;
}

.search-instructions { margin-bottom: 24px; }

.search-footer,
.panel-footer {
    padding: 0 24px 24px 24px;
    display: flex;
    justify-content: flex-end;
}

.panel-footer { padding-top: 16px; }

/* ---- Form Elements ---- */
.form-label {
    color: #666666;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.form-control,
.form-select {
    border: 1px solid #cccccc;
    border-radius: 10px;
    padding: 10px 14px;
    color: #333333;
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #a0a0a0;
    box-shadow: none;
}

.name-input-wrapper { position: relative; }

.checkbox-container {
    border: 1px solid #cccccc;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    min-height: 46px;
}

.form-check-input {
    border: 1px solid #999999;
    border-radius: 4px;
    width: 16px;
    height: 16px;
    margin-top: 0;
    cursor: pointer;
}

.form-check-input:focus {
    box-shadow: none;
    border-color: #999999;
}

/* ---- Controls Row ---- */
.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.action-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.items-per-page-select {
    width: auto;
    border: 1px solid #cccccc;
    border-radius: 6px;
    padding: 4px 30px 4px 10px;
    font-size: 0.9rem;
    color: #333333;
}

/* ---- Results Banner ---- */
.results-banner {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.9rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Table ---- */
.table-responsive-container {
    overflow-x: auto;
    width: 100%;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.users-table th {
    font-weight: 600;
    color: #333333;
    text-align: left;
    padding: 12px 8px;
    border-bottom: 2px solid #e8e8e8;
    white-space: nowrap;
}

.users-table td {
    padding: 5px;
    vertical-align: middle;
    color: #333333;
    white-space: nowrap;
}

/* Expanded detail rows (e.g. a template's Body/Header/Footer text) hold free-form, often long
   text that must wrap within the table instead of inheriting nowrap and stretching it off-screen. */
.users-table td.detail-cell {
    white-space: normal;
    overflow-wrap: anywhere;
}

.users-table tbody tr:hover { background-color: #f1f3f5; }
.users-table tbody tr.row-selected { background-color: #eaeaea; }

.username-link {
    color: var(--brand-primary, #f59e23);
    text-decoration: none;
    font-weight: 500;
}

.username-link:hover { text-decoration: underline; }

.table-checkbox {
    width: 15px;
    height: 15px;
    border: 1px solid #999999;
    border-radius: 3px;
    cursor: pointer;
}

/* ---- Status Labels ---- */
.status-locked { color: #dc3545; font-weight: 500; }
.status-active { color: #333333; }
.status-timestamp { color: #777777; font-size: 0.85rem; }

/* ---- Pagination ---- */
.custom-pagination {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background-color: #ffffff;
}

.pag-btn {
    background: none;
    border: none;
    color: #666666;
    padding: 6px 12px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    transition: background-color 0.2s;
}

.pag-btn:hover:not(:disabled) { background-color: #f1f3f5; }
.pag-btn:disabled { color: #cccccc; cursor: not-allowed; }

.pag-center {
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    padding: 0 14px;
    font-size: 0.88rem;
    color: #555555;
    background-color: #ffffff;
    height: 34px;
    display: inline-flex;
    align-items: center;
}

/* ---- User Management Container ---- */
.user-management-container {
    height: 82vh;
    overflow: auto;
    margin-bottom: 20px;
    padding: 0 4px;
}

/* ---- Chat Message View (shared between Chat.razor and HistoryView.razor) ----
   Moved here from Chat.razor.css: Blazor CSS isolation scopes a component's .razor.css
   rules to only that component's rendered markup, so HistoryView.razor's identical
   markup/classes (divider-notification, bubble-user-action, etc.) were previously
   rendering completely unstyled since those rules only lived in Chat.razor.css. */
.chat-panel {
    background-color: #f8fafc;
    position: relative;
    min-width: 0;
}

.chat-header {
    height: 55px;
}

.bubble-user-action, .bubble-received {
    font-size: 0.82rem;
    border-radius: 14px !important;
    box-shadow: 0 1px 1px rgba(0,0,0,0.02);
    word-break: break-word;
    min-width: 0;
}

.bubble-user-action {
    background-color: #eef3f7;
    color: #495057;
}

.bubble-received {
    background-color: #fff;
    color: #212529;
}

.message-time {
    font-size: 0.65rem;
}

.block-time {
    font-size: 0.62rem;
    color: #9ca3af;
    font-weight: 400;
}

.divider-notification {
    background-color: #f1f3f5;
    text-align: center;
    margin-bottom: 10px;
    border-radius: 6px;
    z-index: 2;
    font-size: 0.72rem;
    padding: 5px 20px !important;
    line-height: 1.3;
}

/* ---- Chat Tabs ---- */
.tab-pill,
.tab-pill-red {
    border: none !important;
    font-size: 0.75rem;
    padding: 5px 10px;
}

.tab-pill {
    background-color: #f1f3f5 !important;
    color: #495057 !important;
    border-radius: 4px 0 0 4px !important;
}

.tab-pill.active {
    background-color: var(--brand-primary, #f09224) !important;
    color: #fff !important;
}

.tab-pill-red {
    background-color: #f1f3f5 !important;
    color: #495057 !important;
    border-radius: 0 4px 4px 0 !important;
}

.tab-pill-red.active { color: #fff !important; }

.sub-tab { font-size: 0.75rem; font-weight: 500; }

.sub-tab-active {
    color: #2b394a !important;
    font-weight: 700 !important;
    border-bottom: 2px solid var(--brand-primary, #f09224) !important;
    border-radius: 0 !important;
}


/* ---- Table Loading ---- */
.table-loading-overlay {
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    width: 100%;
    height: 100%;
    flex-grow: 1 !important;
}

.table-loading-overlay-position {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    /* Above every other fixed/absolute element in the app (banners, modals, dropdowns) — the
       loading overlay must always win, since it's meant to block interaction with everything. */
    z-index: 100000;
    width: 100%;
    height: 100%;
}

.table-loading-overlay-position-fixed {
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    /* Above every other fixed/absolute element in the app (banners, modals, dropdowns) — the
       loading overlay must always win, since it's meant to block interaction with everything. */
    z-index: 100000;
    height: 100%;
    padding: -24px;
    padding: 0 !important;
    margin: -24px;
}

/* ---- Vertical Divider ---- */
@media (min-width: 768px) {
    .vertical-divider { border-left: 1px solid #e8e8e8; }
}

/* ---- Mobile small form adjustments ---- */
@media (max-width: 575.98px) {
    .search-body { padding: 16px; }
    .search-footer { padding: 0 16px 16px 16px; }
    .btn-search { width: 100%; }
}

/* ---- Mobile layout adjustments shared across History/Reports/UserManagement/etc ---- */
@media (max-width: 768px) {
    .search-header-btn,
    .panel-header-btn {
        padding: 14px 16px;
        font-size: 1rem;
    }

    .controls-row {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .action-controls {
        flex-wrap: wrap;
        width: 100%;
        justify-content: flex-start;
    }

    .results-banner {
        flex-wrap: wrap;
    }

    /* Momentum scrolling for the horizontally-scrollable table wrapper on touch devices. */
    .table-responsive-container {
        -webkit-overflow-scrolling: touch;
    }

    .users-table th,
    .users-table td {
        padding: 8px 6px;
    }

    .section-title-offset {
        margin-left: 16px;
    }

    /* Pull the floating action buttons in from the edge and stack the "add/delete" group above
       the scroll-to-top button so they don't overlap on narrow viewports. */
    .floating-actions-container {
        right: 16px;
        bottom: 72px;
        gap: 8px;
    }

    .floating-actions-container-left {
        left: 16px;
        bottom: 72px;
        gap: 8px;
    }

    .floating-actions-container-scroll {
        right: 16px;
        bottom: 16px;
    }

    /* Layout header's orange circular action buttons (go back / support / notifications) —
       35px is too wide for 3 of them plus the logo and mobile menu trigger to fit one row. */
    .refresh-button {
        width: 28px;
        height: 28px;
    }

        .refresh-button svg {
            width: 18px;
            height: 18px;
        }

        .refresh-button i {
            font-size: 13px !important;
        }
}
