/* =================================================================
   SITE-LAYOUT.CSS — Layout Component Stilleri
   Egitim Sosyal Tesisler Mudurlugu
   =================================================================
   v1.0 — _Layout.cshtml inline stillerinden çıkarıldı
   Top navbar, sidebar, footer, skip-link, floating controls
   ================================================================= */

/* -----------------------------------------------------------------
   1. SKIP LINK — Erişilebilirlik
   ----------------------------------------------------------------- */

.skip-link {
    position: absolute;
    top: -40px;
    left: var(--space-2);
    background: var(--brand-primary);
    /* WCAG 2.2 AA — beyaz (#FFFFFF) brand-primary (#0A4D8C) uzerinde 7.04:1 kontrast */
    /* !important gerekli: Razor scoped CSS `a[b-...]` selector daha yuksek specificity'ye sahip */
    color: var(--acik-metin, #FFFFFF) !important;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    z-index: var(--z-tooltip, 1070);
    transition: top var(--motion-fast);
}

.skip-link:focus {
    top: var(--space-2);
    outline: var(--focus-outline);
    outline-offset: 2px;
}

/* -----------------------------------------------------------------
   2. TOP NAVBAR — Anonim kullanıcılar için
   ----------------------------------------------------------------- */

.top-navbar {
    background: var(--surface-1);
    border-bottom: 1px solid var(--border-rengi);
    padding: var(--space-3) var(--space-5);
    box-shadow: var(--elev-1);
    /* Phase 4.2 — centik (notch) guvenli alani */
    padding-top: max(var(--space-3), env(safe-area-inset-top, 0px));
    padding-left: max(var(--space-5), env(safe-area-inset-left, 0px));
    padding-right: max(var(--space-5), env(safe-area-inset-right, 0px));
}

.top-navbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    max-width: 1280px;
    margin: 0 auto;
}

.top-navbar__brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
}

.top-navbar__brand img {
    height: 40px;
}

.top-navbar__links {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-navbar__links a {
    /* WCAG 2.2 AA — #475569 (ikincil-metin guncellendi) 4.5:1+ kontrast light bg ustunde */
    color: var(--ikincil-metin, #475569);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--motion-fast);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
}

.top-navbar__links a:hover {
    color: var(--brand-primary);
    background: var(--surface-2);
}

.top-navbar__actions {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.top-navbar__btn--ghost,
.top-navbar__btn--primary {
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all var(--motion-fast);
    min-height: var(--space-11);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.top-navbar__btn--ghost {
    color: var(--brand-primary);
    border: 1px solid var(--brand-primary);
    background: transparent;
}

.top-navbar__btn--ghost:hover {
    background: var(--brand-primary);
    color: var(--acik-metin, #FFFFFF);
}

.top-navbar__btn--primary {
    /* WCAG 2.2 AA — turuncu-700 (#A44F14) 7.55:1 kontrast beyaz ustunde */
    background: var(--akdeniz-turuncu-700, #A44F14);
    color: var(--acik-metin, #FFFFFF);
    border: 1px solid var(--akdeniz-turuncu-700, #A44F14);
}

.top-navbar__btn--primary:hover {
    background: var(--akdeniz-turuncu-800, #7D3C0F);
    border-color: var(--akdeniz-turuncu-800, #7D3C0F);
}

@media (max-width: 768px) {
    .top-navbar__links {
        display: none;
    }
}

/* -----------------------------------------------------------------
   3. SIDEBAR — Authenticated user için
   ----------------------------------------------------------------- */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: var(--surface-1);
    border-right: 1px solid var(--border-rengi);
    overflow-y: auto;
    z-index: var(--z-sticky, 1020);
    transform: translateX(-100%);
    transition: transform var(--motion-base);
    /* Phase 4.2 — centik guvenli alani (ust bosluk) */
    padding-top: max(0px, env(safe-area-inset-top, 0px));
}

.sidebar.is-open {
    transform: translateX(0);
}

.sidebar__header {
    padding: var(--space-5);
    border-bottom: 1px solid var(--border-rengi);
}

.sidebar__section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ikincil-metin);
    padding: var(--space-3) var(--space-5) var(--space-2);
}

.sidebar__divider {
    height: 1px;
    background: var(--border-rengi);
    margin: var(--space-3) 0;
}

.sidebar__nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    color: var(--ikincil-metin);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--motion-fast);
    border-left: 3px solid transparent;
}

.sidebar__nav-link:hover {
    background: var(--surface-2);
    color: var(--brand-primary);
}

.sidebar__nav-link.active {
    background: linear-gradient(90deg, var(--brand-primary) 0%, transparent 100%);
    color: var(--acik-metin, #FFFFFF);
    border-left-color: var(--brand-accent);
}

.sidebar__nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0);
    }
}

/* -----------------------------------------------------------------
   4. MOBILE MENU TOGGLE
   ----------------------------------------------------------------- */

.mobile-menu-toggle {
    position: fixed;
    top: var(--space-3);
    left: var(--space-3);
    z-index: var(--z-fixed, 1030);
    width: var(--space-11);
    height: var(--space-11);
    border-radius: var(--radius-md);
    background: var(--brand-primary);
    color: var(--acik-metin, #FFFFFF);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--elev-2);
}

.mobile-menu-toggle:focus-visible {
    outline: var(--focus-outline);
    outline-offset: 2px;
}

@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* -----------------------------------------------------------------
   5. FLOATING CONTROLS (theme toggle, vb.)
   ----------------------------------------------------------------- */

.floating-controls {
    position: fixed;
    top: 75px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-fixed, 1040);
    padding: 0;
    margin: 0;
    width: 44px;
    height: 44px;
    pointer-events: none;
}

.floating-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface-1, #ffffff);
    color: var(--brand-primary, #006EED);
    border: 1px solid var(--border-subtle, rgba(0, 33, 161, 0.15));
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.floating-btn:hover {
    background: var(--surface-1, #ffffff);
    color: var(--brand-accent, #FF5304);
    border-color: var(--brand-accent, #FF5304);
    transform: translateY(-2px) scale(1.05);
}

.floating-btn:focus-visible {
    outline: var(--focus-outline);
    outline-offset: 2px;
}

/* Draggable state */
.floating-btn.is-dragging {
    cursor: grabbing;
    opacity: 0.85;
}

/* -----------------------------------------------------------------
   6. FOOTER — Akdeniz markası
   ----------------------------------------------------------------- */

.akdeniz-footer {
    background: var(--surface-1);
    border-top: 1px solid var(--border-rengi);
    padding: var(--space-12) var(--space-6) var(--space-6);
    color: var(--ikincil-metin);
    margin-top: var(--space-12);
}

.akdeniz-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-8);
}

.akdeniz-footer__column h6 {
    color: var(--ana-metin-rengi);
    font-weight: 700;
    margin-bottom: var(--space-4);
    font-size: 0.95rem;
}

.akdeniz-footer__column a {
    display: block;
    color: var(--ikincil-metin);
    text-decoration: none;
    padding: var(--space-2) 0;
    transition: color var(--motion-fast);
    font-size: 0.875rem;
}

.akdeniz-footer__column a:hover {
    color: var(--brand-primary);
}

.akdeniz-footer__bottom {
    max-width: 1280px;
    margin: var(--space-8) auto 0;
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-rengi);
    text-align: center;
    font-size: 0.875rem;
}

@media (max-width: 576px) {
    .akdeniz-footer {
        padding: var(--space-8) var(--space-4) var(--space-5);
    }
}

/* -----------------------------------------------------------------
   7. WCAG 2.2 AA — Reduced motion
   ----------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .top-navbar__links a,
    .floating-btn {
        transition: none !important;
    }
}

/* -----------------------------------------------------------------
   8. SITE-WIDE SEARCH (Phase 5) — Cmd/Ctrl+K modal
   ----------------------------------------------------------------- */

/* Navbar search trigger button — same shape as ghost/primary buttons */
.top-navbar__btn--search {
    background: transparent;
    color: var(--ana-metin-rengi);
    border: 1px solid var(--border-rengi);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.top-navbar__btn--search:hover,
.top-navbar__btn--search:focus {
    background: var(--surface-2);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}
.top-navbar__btn--search:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}
.top-navbar__search-kbd {
    background: var(--surface-2);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    /* WCAG 2.2 AA — #475569 7.07:1 kontrast #f1f5f9 ustunde */
    color: var(--ikincil-metin, #475569);
    border: 1px solid var(--border-rengi);
}

[data-theme="dark"] .top-navbar__btn--search {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .top-navbar__btn--search:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--brand-primary);
}
[data-theme="dark"] .top-navbar__search-kbd {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Modal container */
.search-modal .modal-content {
    background: var(--surface-1);
    border-radius: var(--radius-bento);
    box-shadow: var(--elev-4, 0 24px 48px rgba(0, 0, 0, 0.18));
    border: 1px solid var(--border-rengi);
}
[data-theme="dark"] .search-modal .modal-content {
    background: var(--surface-1, #1a1f2e);
}

/* Input wrapper */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3, 12px);
    padding: var(--space-3, 12px) var(--space-3, 12px);
    border: 2px solid var(--border-rengi);
    border-radius: var(--radius-md, 8px);
    background: var(--surface-2);
    transition: border-color var(--motion-fast, 150ms ease);
}
.search-input-wrapper:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(10, 77, 140, 0.18);
}
.search-input-wrapper > i.fa-search {
    color: var(--ikincil-metin);
    font-size: 1.1rem;
}
.search-input-wrapper input[type="search"] {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1.1rem;
    color: var(--ana-metin-rengi);
    box-shadow: none;
    padding: 0;
    min-width: 0;
}
.search-input-wrapper input[type="search"]::-webkit-search-cancel-button {
    cursor: pointer;
}
.search-input-wrapper .search-kbd {
    background: var(--surface-1);
    padding: 2px 8px;
    border-radius: var(--radius-sm, 4px);
    font-size: 0.7rem;
    color: var(--ikincil-metin);
    border: 1px solid var(--border-rengi);
}

/* Results container */
.search-results {
    margin-top: var(--space-4, 16px);
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.search-category {
    margin-bottom: var(--space-4, 16px);
}
.search-category__title {
    color: var(--ikincil-metin);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-2, 8px);
    padding-inline: var(--space-3, 12px);
    font-weight: 600;
}

/* Result item (rendered as <a>) */
.search-item {
    display: flex;
    align-items: center;
    gap: var(--space-3, 12px);
    padding: var(--space-3, 10px) var(--space-3, 12px);
    border-radius: var(--radius-md, 8px);
    color: var(--ana-metin-rengi);
    text-decoration: none;
    transition: background-color var(--motion-fast, 120ms ease),
                color var(--motion-fast, 120ms ease);
    border: 1px solid transparent;
}
.search-item:hover,
.search-item:focus,
.search-item--active {
    background: var(--surface-2);
    color: var(--ana-metin-rengi);
    text-decoration: none;
    outline: none;
    border-color: var(--border-rengi);
}
.search-item--active {
    background: rgba(10, 77, 140, 0.1);
    border-color: var(--brand-primary);
}
[data-theme="dark"] .search-item--active {
    background: rgba(255, 255, 255, 0.08);
}
.search-item__icon {
    color: var(--brand-primary);
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.search-item__body {
    flex: 1;
    min-width: 0;
}
.search-item__title {
    font-weight: 600;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-item__subtitle {
    font-size: 0.8rem;
    color: var(--ikincil-metin);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Empty / loading states */
.search-empty,
.search-loading {
    color: var(--ikincil-metin);
    padding: var(--space-4, 16px);
}

/* Modal footer */
.search-modal__footer {
    font-size: 0.75rem;
}
.search-modal__footer kbd {
    background: var(--surface-2);
    padding: 1px 6px;
    border-radius: var(--radius-sm, 4px);
    font-size: 0.7rem;
    border: 1px solid var(--border-rengi);
}

/* Mobile (≤576px) — full-screen feel */
@media (max-width: 576px) {
    .search-modal .modal-dialog {
        margin: var(--space-2, 8px);
    }
    .search-results {
        max-height: 60vh;
    }
    .search-input-wrapper input[type="search"] {
        font-size: 1rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .search-input-wrapper,
    .search-item {
        transition: none !important;
    }
}