/* Header arama/menü stilleri: assets/css/header-custom.css */

/* ─── Merkezi arama modal ─── */
.site-search-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    box-sizing: border-box;
}
.site-search-modal[hidden] { display: none !important; }

.site-search-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: siteSearchBackdropIn 0.22s ease;
}
@keyframes siteSearchBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.site-search-modal-panel {
    position: relative;
    width: min(560px, 100%);
    max-height: min(86dvh, 680px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    margin: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    animation: siteSearchModalIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes siteSearchModalIn {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.site-search-modal.is-closing .site-search-modal-backdrop {
    animation: siteSearchBackdropOut 0.22s ease forwards;
}
.site-search-modal.is-closing .site-search-modal-panel {
    animation: siteSearchModalOut 0.22s ease forwards;
}
@keyframes siteSearchBackdropOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes siteSearchModalOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to   { opacity: 0; transform: scale(0.96) translateY(10px); }
}

/* Header */
.site-search-modal-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 0;
    background: #fff;
}
.site-search-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.site-search-modal-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.site-search-modal-close {
    flex-shrink: 0;
    border: none;
    background: none;
    color: #999;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.15s;
}
.site-search-modal-close:hover {
    color: #333;
}

/* Form — modal içi */
.modal-site-search {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: 12px 18px 0;
    transform: none;
    top: auto;
    left: auto;
}
.modal-site-search .search-input-wrap {
    position: relative;
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.modal-site-search input[type="search"] {
    width: 100%;
    padding: 10px 32px 12px 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #111;
    font-size: 15px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.modal-site-search input[type="search"]:focus {
    box-shadow: none;
}
.modal-site-search input[type="search"]::placeholder {
    color: #bbb;
}
.modal-site-search input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}
.modal-site-search .search-clear-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: #bbb;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s;
}
.modal-site-search .search-clear-btn:hover {
    color: #666;
}
.modal-site-search .search-clear-btn[hidden] { display: none !important; }

/* Sonuçlar — sade liste */
.global-search-results {
    position: static;
    margin-top: 4px;
    flex: 1;
    min-height: 0;
    max-height: min(42vh, 360px);
    overflow-y: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}
.global-search-results::-webkit-scrollbar { width: 4px; }
.global-search-results::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}
.global-search-results[hidden] { display: none !important; }

.global-search-results .gsr-list { list-style: none; margin: 0; padding: 0; }
.global-search-results .gsr-list li {
    margin: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.global-search-results .gsr-list li:last-child { border-bottom: none; }
.global-search-results .gsr-section-label {
    margin: 0;
    padding: 10px 0 4px;
    border-bottom: none;
    list-style: none;
}
.global-search-results .gsr-section-label span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #bbb;
}
.global-search-results .gsr-list a {
    display: block;
    padding: 11px 0;
    text-decoration: none;
    color: #111;
    transition: opacity 0.15s;
}
.global-search-results .gsr-list a:hover {
    background: rgba(0, 0, 0, 0.03);
    opacity: 1;
}
.global-search-results .gsr-list a.gsr-active,
.global-search-results .gsr-list a:focus {
    background: rgba(0, 0, 0, 0.05);
    opacity: 1;
    outline: none;
}
.global-search-results .gsr-item-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.global-search-results .gsr-title {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    color: #111;
    line-height: 1.4;
}
.global-search-results .gsr-type {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 2px 7px;
    border-radius: 4px;
    line-height: 1.3;
}
.global-search-results .gsr-type[data-type="service"]   { color: #92400e; background: #fef3c7; }
.global-search-results .gsr-type[data-type="page"]      { color: #1d4ed8; background: #dbeafe; }
.global-search-results .gsr-type[data-type="news"]      { color: #b91c1c; background: #fee2e2; }
.global-search-results .gsr-type[data-type="portfolio"] { color: #6d28d9; background: #ede9fe; }
.global-search-results .gsr-type[data-type="faq"]       { color: #15803d; background: #dcfce7; }
.global-search-results .gsr-type[data-type="experience"] { color: #0f766e; background: #ccfbf1; }
.global-search-results .gsr-hl {
    background: none;
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(0, 0, 0, 0.2);
    text-underline-offset: 2px;
}
.global-search-results .gsr-desc {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #aaa;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.global-search-results .gsr-all,
.global-search-results .gsr-empty,
.global-search-results .gsr-meta {
    display: block;
    padding: 12px 0;
    font-size: 12px;
    text-align: left;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.global-search-results .gsr-all {
    color: #666;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}
.global-search-results .gsr-all:hover { color: #111; }
.global-search-results .gsr-empty {
    color: #aaa;
    border-top: none;
    padding: 24px 0;
    text-align: center;
    font-size: 13px;
}
.gsr-empty-hints {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}
.global-search-results .gsr-meta {
    font-size: 11px;
    color: #ccc;
    border-top: none;
    padding: 4px 0 8px;
}

/* Skeleton */
.gsr-skeleton { padding: 4px 0; }
.gsr-skeleton-row { padding: 12px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.04); }
.gsr-skeleton-line {
    display: block;
    height: 12px;
    width: 70%;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: gsrShimmer 1.2s ease-in-out infinite;
}
@keyframes gsrShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.global-search-results .gsr-meta {
    font-size: 11px;
    color: #aaa;
    border-top: none;
    padding: 6px 16px 10px;
}

.gsr-facets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0 10px;
}
.gsr-facet {
    font-size: 11px;
    color: #777;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 4px 10px;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.gsr-facet:hover {
    background: rgba(0, 0, 0, 0.07);
    color: #444;
}
.gsr-facet.is-active {
    color: #111;
    background: #fff;
    border-color: rgba(0, 0, 0, 0.12);
    font-weight: 600;
}
.gsr-facet em {
    font-style: normal;
    font-weight: 600;
    color: inherit;
    opacity: 0.75;
}
.gsr-retry {
    display: inline-block;
    margin-top: 8px;
    padding: 0;
    border: none;
    background: none;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}
.gsr-retry:hover { color: #111; }

/* Boş durum */
.site-search-idle[hidden] { display: none !important; }
.site-search-idle {
    padding: 8px 18px 16px;
}
.site-search-index-hint {
    margin: 0 0 12px;
    font-size: 11px;
    color: #ccc;
    line-height: 1.4;
}
.site-search-index-hint[hidden] { display: none !important; }
.site-search-recent-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}
.site-search-recent-wrap[hidden] { display: none !important; }
.site-search-clear-recent {
    border: none;
    background: none;
    color: #ccc;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 0;
    margin-left: auto;
}
.site-search-clear-recent:hover { color: #666; }
.site-search-clear-recent[hidden] { display: none !important; }
.site-search-section-label {
    flex-shrink: 0;
    font-size: 11px;
    color: #ccc;
    font-weight: 500;
    margin-right: 4px;
}
.site-search-popular,
.site-search-recent {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 0 0 10px;
}
.site-search-recent { margin-bottom: 0; }
.site-search-popular[hidden],
.site-search-recent[hidden] { display: none; }
.site-search-popular-chip {
    color: #888;
}
.site-search-popular-chip:hover { color: #333; }
.site-search-hint-chip {
    border: none;
    background: none;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 0;
    transition: color 0.15s;
}
.site-search-hint-chip:hover { color: #111; }

/* Klavye kısayolları */
.site-search-modal-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 18px 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.site-search-modal-footer .site-search-kbd-hint {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: #ccc;
}
.site-search-modal-footer kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: auto;
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    color: #bbb;
    box-shadow: none;
}

body.site-search-open { overflow: hidden; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ─── Tablet & mobil ─── */
@media (max-width: 991px) {
    .site-search-modal {
        padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    }
    .site-search-modal-panel {
        width: 100%;
        max-width: 560px;
        max-height: min(90dvh, 680px);
        border-radius: 18px;
        overflow: hidden;
        animation: siteSearchModalInMobile 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    }
    @keyframes siteSearchModalInMobile {
        from { opacity: 0; transform: scale(0.96) translateY(24px); }
        to   { opacity: 1; transform: scale(1) translateY(0); }
    }
    .site-search-modal-header {
        padding: 14px 16px 0;
    }
    .modal-site-search {
        padding: 10px 16px 0;
    }
    .modal-site-search input[type="search"] {
        font-size: 16px;
        padding: 10px 28px 12px 0;
    }
    .site-search-idle {
        padding: 6px 16px 14px;
    }
    .site-search-section-label {
        display: inline;
        width: auto;
        flex-shrink: 0;
        margin-bottom: 0;
        margin-right: 4px;
    }
    .site-search-popular,
    .site-search-recent {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        mask-image: linear-gradient(to right, #000 92%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, #000 92%, transparent 100%);
        padding-bottom: 4px;
    }
    .site-search-popular::-webkit-scrollbar,
    .site-search-recent::-webkit-scrollbar { display: none; }
    .site-search-hint-chip,
    .site-search-recent-chip {
        flex-shrink: 0;
    }
    .global-search-results {
        max-height: min(48dvh, 340px);
    }
    .global-search-results .gsr-list a {
        padding: 13px 0;
        min-height: 44px;
    }
    .global-search-results .gsr-title {
        font-size: 15px;
    }
    .site-search-modal-footer {
        gap: 10px;
        padding: 8px 18px 12px;
    }
}

@media (max-width: 576px) {
    .site-search-modal {
        padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
    }
    .site-search-modal-panel {
        max-height: calc(100dvh - 16px);
        border-radius: 16px;
    }
    .site-search-modal-header {
        padding: 12px 14px 0;
    }
    .modal-site-search {
        padding: 8px 14px 0;
    }
    .site-search-idle {
        padding: 4px 14px 12px;
    }
    .global-search-results {
        max-height: min(52dvh, 300px);
    }
    .global-search-results .gsr-list a {
        padding: 12px 0;
    }
    .site-search-modal-footer .site-search-kbd-hint:nth-child(2) {
        display: none;
    }
}

/* Dokunmatik cihazlarda klavye ipuçlarını gizle */
@media (hover: none) and (pointer: coarse) {
    .site-search-modal-footer {
        display: none;
    }
    .site-search-modal-panel {
        max-height: min(94dvh, 720px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-search-modal-backdrop,
    .site-search-modal-panel,
    .site-search-modal.is-closing .site-search-modal-backdrop,
    .site-search-modal.is-closing .site-search-modal-panel,
    .gsr-skeleton-badge,
    .gsr-skeleton-text {
        animation: none !important;
        transition: none !important;
    }
}
