/* ─── Topbar ─────────────────────────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    /* subtle drop shadow replaces hard border at desktop */
    box-shadow: 0 1px 0 var(--border), 0 2px 8px rgba(11, 35, 71, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    will-change: transform, backdrop-filter;
}

html[data-theme="dark"] .topbar {
    background: rgba(8, 12, 24, 0.82);
    border-bottom-color: var(--border);
}

.topbar__brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    text-decoration: none;
}

/* Brand pin icon — uses Corporate Green accent */
.topbar__pin {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--brand-green);
    background: var(--brand-green-muted);
    border: 1px solid rgba(26, 183, 105, 0.22);
    box-shadow: 0 2px 8px rgba(26, 183, 105, 0.12);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.topbar__pin:hover,
.topbar__brand:hover .topbar__pin {
    box-shadow: 0 4px 16px rgba(26, 183, 105, 0.22);
    transform: translateY(-1px);
}

html[data-theme="dark"] .topbar__pin {
    background: rgba(26, 183, 105, 0.12);
    border-color: rgba(26, 183, 105, 0.20);
    box-shadow: 0 2px 8px rgba(26, 183, 105, 0.08);
}

.topbar__pin svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.topbar__title {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.topbar__eyebrow {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--brand-navy);
    font-size: var(--font-base);
    font-weight: 900;
    /* Corporate: daha sıkı tracking, Inter'in cv02 alternate-a'sını öne çıkarır */
    letter-spacing: -0.03em;
    line-height: 1.1;
}

html[data-theme="dark"] .topbar__eyebrow {
    color: var(--text);
}

.topbar__headline {
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.02em;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ─── Theme Toggle ───────────────────────────────────────────────────────────── */
/*
 * Convention: show the icon for what you'll SWITCH TO.
 * Default (light mode): show MOON → click → go dark.
 * Dark mode: show SUN  → click → go light.
 */
.theme-toggle {
    position: relative;
    overflow: hidden;
}

.theme-toggle__icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.theme-toggle__icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Default (light): sun is hidden, moon is visible */
.theme-toggle__icon--sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.3);
}

.theme-toggle__icon--moon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Dark mode: sun is visible, moon is hidden */
html[data-theme="dark"] .theme-toggle__icon--sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

html[data-theme="dark"] .theme-toggle__icon--moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.3);
}

.theme-toggle:focus-visible {
    box-shadow: 0 0 0 3px var(--brand-green-ring);
}

/* ─── Icon Buttons ───────────────────────────────────────────────────────────── */
.icon-btn--search {
    color: var(--muted);
}

.icon-btn--search svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.icon-btn--search:hover {
    color: var(--brand-green);
}

/* ─── Status dot ─────────────────────────────────────────────────────────────── */
.status-dot {
    width: 9px;
    height: 9px;
    border-radius: var(--radius-pill);
    flex: 0 0 auto;
}

.status-dot--green {
    background: var(--brand-green);
    box-shadow: 0 0 0 3px rgba(26, 183, 105, 0.18);
    animation: status-dot-pulse 2.4s ease-in-out infinite;
}

@keyframes status-dot-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(26, 183, 105, 0.18); }
    50%      { box-shadow: 0 0 0 6px rgba(26, 183, 105, 0.05); }
}

@media (prefers-reduced-motion: reduce) {
    .status-dot--green { animation: none; }
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .topbar {
        padding: var(--space-3) var(--space-3);
        flex-wrap: nowrap;
        align-items: center;
    }

    .topbar__brand {
        gap: var(--space-2);
    }

    .topbar__pin {
        width: 34px;
        height: 34px;
    }

    .topbar__pin svg {
        width: 16px;
        height: 16px;
    }

    .topbar__eyebrow {
        font-size: var(--font-sm);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar__headline {
        font-size: 0.6875rem;
    }

    .topbar__actions {
        gap: 6px;
        min-width: 0;
        flex-wrap: nowrap;
        justify-content: flex-end;
        align-items: center;
        width: auto;
    }

    /* FIX: WCAG 2.5.5 — minimum 44×44px tap target on touch screens (was 38px) */
    .icon-btn--search,
    .theme-toggle {
        width: 44px;
        height: 44px;
        flex: 0 0 auto;
    }
}

