/**
 * OFFICELESS OS - TOOLTIP STYLING
 * NTIS v1.0 Tooltip Intelligence System CSS
 */

/* ═══════════════ TOOLTIP BASE ═══════════════ */
.ofls-tooltip {
    position: relative;
    display: inline-flex;
    cursor: help;
}

.ofls-tooltip__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: var(--space-1);
    color: var(--neutral-400);
    transition: color var(--duration-fast);
}

.ofls-tooltip__trigger:hover {
    color: var(--ofls-purple);
}

.ofls-tooltip__content {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-tooltip);

    min-width: 200px;
    max-width: 320px;
    padding: var(--space-3) var(--space-4);

    background: var(--neutral-900);
    color: white;
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);

    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-fast), visibility var(--duration-fast);
}

.ofls-tooltip__content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--neutral-900);
}

.ofls-tooltip:hover .ofls-tooltip__content,
.ofls-tooltip:focus-within .ofls-tooltip__content {
    opacity: 1;
    visibility: visible;
}

.ofls-tooltip__title {
    font-weight: 600;
    font-size: var(--text-sm);
    margin-bottom: var(--space-1);
    color: white;
}

.ofls-tooltip__text {
    color: var(--neutral-300);
    font-size: var(--text-xs);
}

.ofls-tooltip__link {
    display: inline-block;
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--ofls-purple);
    text-decoration: none;
}

.ofls-tooltip__link:hover {
    text-decoration: underline;
}

/* Position variants */
.ofls-tooltip--right .ofls-tooltip__content {
    bottom: auto;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
}

.ofls-tooltip--right .ofls-tooltip__content::after {
    top: 50%;
    left: -6px;
    transform: translateY(-50%) rotate(-90deg);
}

.ofls-tooltip--left .ofls-tooltip__content {
    bottom: auto;
    right: calc(100% + 8px);
    left: auto;
    top: 50%;
    transform: translateY(-50%);
}

.ofls-tooltip--bottom .ofls-tooltip__content {
    bottom: auto;
    top: calc(100% + 8px);
}

.ofls-tooltip--bottom .ofls-tooltip__content::after {
    top: -12px;
    border-top-color: transparent;
    border-bottom-color: var(--neutral-900);
}

/* ═══════════════ NARRATIVE BLOCKS ═══════════════ */
.ofls-narrative {
    margin-bottom: var(--space-6);
    padding: var(--space-6);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
}

.ofls-narrative__headline {
    font-family: var(--font-serif);
    font-size: var(--text-2xl);
    font-style: italic;
    color: var(--portal-accent);
    margin-bottom: var(--space-3);
}

.ofls-narrative__text {
    font-size: var(--text-base);
    color: var(--neutral-600);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-4);
}

.ofls-narrative__meta {
    display: flex;
    gap: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--neutral-100);
}

.ofls-narrative__meta-item {
    flex: 1;
}

.ofls-narrative__meta-label {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--neutral-400);
    margin-bottom: var(--space-1);
}

.ofls-narrative__meta-value {
    font-size: var(--text-sm);
    color: var(--neutral-700);
}

/* ═══════════════ GET STARTED CARDS ═══════════════ */
.ofls-quickstart {
    background: linear-gradient(135deg, var(--ofls-purple), #4F46E5);
    color: white;
    padding: var(--space-6);
    border-radius: var(--radius-2xl);
    margin-top: var(--space-4);
}

.ofls-quickstart__title {
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    margin-bottom: var(--space-4);
}

.ofls-quickstart__steps {
    list-style: none;
    counter-reset: steps;
}

.ofls-quickstart__step {
    counter-increment: steps;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
}

.ofls-quickstart__step::before {
    content: counter(steps);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
}

/* ═══════════════ AGENT NARRATIVE CARDS ═══════════════ */
.ofls-agent-narrative {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
}

.ofls-agent-narrative__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.ofls-agent-narrative__tier {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--ofls-purple);
    background: rgba(108, 29, 255, 0.1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
}

.ofls-agent-narrative__summary {
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--neutral-800);
    margin-bottom: var(--space-3);
}

.ofls-agent-narrative__text {
    font-size: var(--text-sm);
    color: var(--neutral-600);
    line-height: var(--leading-relaxed);
}

.ofls-agent-narrative__examples {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--neutral-100);
}

.ofls-agent-narrative__examples-title {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--neutral-400);
    margin-bottom: var(--space-2);
}

.ofls-agent-narrative__example {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--neutral-600);
    margin-bottom: var(--space-2);
}

.ofls-agent-narrative__example::before {
    content: '→';
    color: var(--color-success);
}

/* ═══════════════ CONTEXTUAL HELP ICON ═══════════════ */
.ofls-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: var(--space-1);
    color: var(--neutral-400);
    cursor: help;
    transition: color var(--duration-fast);
}

.ofls-help-icon:hover {
    color: var(--ofls-purple);
}

.ofls-help-icon svg {
    width: 14px;
    height: 14px;
}

/* ═══════════════ BUTTON LABELS WITH CONTEXT ═══════════════ */
.ofls-btn-with-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
}

.ofls-btn-hint {
    font-size: var(--text-xs);
    color: var(--neutral-500);
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

/* ═══════════════ SEARCH RESULTS ═══════════════ */
.ofls-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    z-index: var(--z-dropdown);
}

.ofls-search-result {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    transition: background var(--duration-fast);
}

.ofls-search-result:hover {
    background: var(--neutral-50);
}

.ofls-search-result__type {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ofls-purple);
    background: rgba(108, 29, 255, 0.1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.ofls-search-result__content {
    flex: 1;
}

.ofls-search-result__title {
    font-weight: 600;
    color: var(--neutral-800);
    margin-bottom: var(--space-1);
}

.ofls-search-result__snippet {
    font-size: var(--text-sm);
    color: var(--neutral-500);
}

/* ═══════════════ ACCESSIBILITY ═══════════════ */
.ofls-tooltip:focus-visible .ofls-tooltip__trigger {
    outline: 2px solid var(--ofls-purple);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.ofls-tooltip__content[role="tooltip"] {
    /* Ensures screen readers announce tooltip content */
}

/* Skip link for keyboard users */
.ofls-skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-4);
    background: var(--ofls-purple);
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    z-index: var(--z-max);
    text-decoration: none;
    font-weight: 600;
}

.ofls-skip-link:focus {
    top: var(--space-4);
}