/* ============================================================================
   أبحاثي — saved research views page + the shared save-view dialog
   ============================================================================ */

.research-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.research-header h1 {
    color: var(--color-primary);
    margin-bottom: 4px;
}

.research-subtitle {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.research-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-gray-border);
    margin-bottom: 14px;
}

.research-btn {
    padding: 6px 14px;
    border: 1px solid var(--color-gray-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: var(--transition-all);
}

.research-btn:hover:not(:disabled) {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.research-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.research-count {
    margin-inline-start: auto;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

.research-status {
    background: #eef2ff;
    color: #3730a3;
    border-radius: var(--radius-md);
    padding: 8px 14px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 0.9rem;
}

.research-empty {
    text-align: center;
    color: var(--color-text-secondary);
    padding: 60px 20px;
    line-height: 2;
}

.research-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.research-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-white);
    border: 1px solid var(--color-gray-border);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
}

.research-badge {
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: var(--radius-md);
    padding: 2px 10px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.research-row-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.research-title {
    font-weight: var(--font-weight-semibold);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.research-note {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.research-stale {
    color: #b45309;
    font-size: 1.1rem;
    cursor: help;
}

.research-date {
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
    direction: ltr;
}

.research-row-actions {
    display: flex;
    gap: 6px;
}

.research-open {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.research-open:hover:not(:disabled) {
    background: var(--color-primary-dark, #6B5344);
}

.research-delete:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* Nav brand styles used to live here; they moved to navigation-bar.css,
   where the rest of the nav is defined. */

/* ---- Global nav-bar save button + history link --------------------------- */

.nav-save-button {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-md);
    padding: 6px 16px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-all);
    white-space: nowrap;
}

.nav-save-button:hover {
    filter: brightness(1.12);
}

.nav-save-button.saved {
    background: #15803d;
}

.nav-corner-divider {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: var(--color-gray-border);
    margin: 0 6px;
    align-self: center;
}

.nothing-to-save-hint {
    color: var(--color-text-secondary);
    font-size: 0.92rem;
    line-height: 1.9;
    margin: 0 0 10px;
}

/* Semantic-search "in development" notice — reuses the dialog shell */
.semantic-notice {
    width: min(500px, 92vw);
}

.semantic-notice h3 {
    margin-bottom: 12px;
}

.semantic-notice strong {
    color: var(--color-text-primary);
}

/* A search mode that exists in the UI but is not yet operational */
.mode-btn-pending {
    position: relative;
    opacity: 0.72;
}

.mode-btn-pending:hover {
    opacity: 0.9;
}

.mode-pending-dot {
    color: var(--color-warning, #a9781f);
    font-size: 1.1em;
    line-height: 0;
    margin-inline-start: 3px;
    vertical-align: middle;
}

/* ---- Save-view dialog ---------------------------------------------------- */

.save-view-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-view-dialog {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: 22px 24px;
    width: min(420px, 90vw);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.save-view-dialog h3 {
    margin: 0 0 16px;
    color: var(--color-primary);
}

.save-view-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.save-view-field input {
    padding: 8px 10px;
    border: 1px solid var(--color-gray-border);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
}

.save-view-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 6px;
}

.save-view-confirm {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-md);
    padding: 8px 22px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    cursor: pointer;
}

.save-view-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.save-view-cancel {
    background: var(--color-white);
    border: 1px solid var(--color-gray-border);
    border-radius: var(--radius-md);
    padding: 8px 18px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    cursor: pointer;
}

/* The per-page save button reuses viz footer / toolbar button styles where
   mounted; this class is for standalone placements */
.save-view-button {
    padding: 6px 14px;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
    background: var(--color-white);
    color: var(--color-primary);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.save-view-button:hover {
    background: var(--color-primary);
    color: var(--color-white);
}
