/**
 * 🚀 SOSYALVADI SEARCH PAGE 2026
 * Pro UI - Bento + Kart Dili + Filtre
 * REV-SEARCH-04
 * 
 * @version 2026.2.10
 */

/* ============================================
   SEARCH PAGE CONTAINER
   ============================================ */
.sv-search-page {
    max-width: var(--sv-detail-max, 1120px);
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .sv-search-page {
        padding: 0 12px;
    }
}

/* ============================================
   SEARCH HERO SECTION
   ============================================ */
.sv-search-hero {
    text-align: center;
    padding: 3rem 0 2rem;
    margin-bottom: 3rem;
}

.sv-search-hero h1 {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
    color: hsl(var(--sv-text));
}

.sv-search-hero p {
    font-size: clamp(14px, 1.6vw, 16px);
    color: hsl(var(--sv-muted));
    margin: 0 0 2rem;
    line-height: 1.6;
}

.sv-search-input-wrapper {
    max-width: 584px; /* REV-SEARCH-13: Anasayfa ile aynı */
    margin: 0 auto;
    position: relative;
    width: 100%;
}

.sv-search-input {
    width: 100%;
    height: 56px;
    min-height: 56px;
    padding: 0 52px 0 52px; /* REV-SEARCH-13: Anasayfa ile aynı (0 20px yerine clear butonu için 52px) */
    font-size: 16px; /* REV-SEARCH-13: Anasayfa ile aynı */
    border: 2px solid color-mix(in hsl, hsl(var(--sv-border)) 65%, transparent);
    border-radius: 28px; /* REV-SEARCH-13: Anasayfa ile aynı */
    background: color-mix(in hsl, hsl(var(--sv-panel)) 92%, transparent);
    color: hsl(var(--sv-text));
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px color-mix(in hsl, hsl(var(--sv-shadow)) 12%, transparent);
    display: flex;
    align-items: center;
}

.sv-search-input:not(:placeholder-shown) {
    padding-right: 52px; /* Clear butonu için yer */
}

.sv-search-input::placeholder {
    color: color-mix(in hsl, hsl(var(--sv-muted)) 70%, transparent);
}

.sv-search-input:focus {
    outline: none; /* REV-SEARCH-05: Nicer focus */
    border-color: hsl(var(--sv-accent));
    box-shadow: 0 0 0 4px color-mix(in hsl, hsl(var(--sv-accent)) 18%, transparent),
                0 8px 24px color-mix(in hsl, hsl(var(--sv-shadow)) 16%, transparent);
}

.sv-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.sv-search-input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: hsl(var(--sv-muted));
    pointer-events: none;
    z-index: 1;
}

.sv-search-input:focus ~ .sv-search-input-icon {
    color: hsl(var(--sv-accent));
}

.sv-search-clear {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: hsl(var(--sv-muted));
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 1;
}

.sv-search-clear:hover {
    background: color-mix(in hsl, hsl(var(--sv-accent)) 10%, transparent);
    color: hsl(var(--sv-accent));
}

.sv-search-hero-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Son aramalar */
.sv-son-aramalar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}
.sv-son-aramalar-label {
    color: hsl(var(--sv-muted));
}
.sv-son-arama-pill {
    padding: 4px 12px;
    background: color-mix(in hsl, hsl(var(--sv-accent)) 12%, transparent);
    border: 1px solid color-mix(in hsl, hsl(var(--sv-accent)) 25%, transparent);
    border-radius: 20px;
    color: hsl(var(--sv-accent));
    text-decoration: none;
    transition: all 0.2s;
}
.sv-son-arama-pill:hover {
    background: color-mix(in hsl, hsl(var(--sv-accent)) 20%, transparent);
}
.sv-son-arama-temizle {
    padding: 4px 10px;
    font-size: 0.75rem;
    background: transparent;
    border: none;
    color: hsl(var(--sv-muted));
    cursor: pointer;
    text-decoration: underline;
}
.sv-son-arama-temizle:hover { color: hsl(var(--sv-text)); }

/* Modül sekmeleri */
.sv-search-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid color-mix(in hsl, hsl(var(--sv-border)) 60%, transparent);
}
.sv-search-tab {
    padding: 8px 16px;
    border: 1px solid color-mix(in hsl, hsl(var(--sv-border)) 80%, transparent);
    border-radius: var(--radius-2, 10px);
    background: transparent;
    color: hsl(var(--sv-text));
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.sv-search-tab:hover {
    background: color-mix(in hsl, hsl(var(--sv-accent)) 8%, transparent);
    border-color: hsl(var(--sv-accent));
}
.sv-search-tab.active {
    background: hsl(var(--sv-accent));
    color: #fff;
    border-color: hsl(var(--sv-accent));
}

/* ============================================
   SEARCH GROUPS CONTAINER
   ============================================ */
.sv-search-groups {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

@media (max-width: 768px) {
    .sv-search-groups {
        gap: 2rem;
    }
}

/* ============================================
   SEARCH GROUP
   ============================================ */
.sv-search-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ============================================
   SEARCH GROUP HEADER
   ============================================ */
.sv-search-group-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid color-mix(in hsl, hsl(var(--sv-border)) 45%, transparent);
}

@media (max-width: 768px) {
    .sv-search-group-head {
        flex-direction: column;
        align-items: stretch;
    }
}

.sv-search-group-head h2 {
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 700;
    margin: 0;
    color: hsl(var(--sv-text));
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sv-search-group-head .count {
    font-size: 0.7em;
    font-weight: 500;
    color: hsl(var(--sv-muted));
}

.sv-search-group-head .sub {
    font-size: 14px;
    color: hsl(var(--sv-muted));
    margin: 0.25rem 0 0;
    font-weight: 400;
}

.sv-search-group-head .sv-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.sv-btn-ghost {
    background: transparent;
    border-color: color-mix(in hsl, hsl(var(--sv-border)) 65%, transparent);
    color: hsl(var(--sv-text));
}

.sv-btn-ghost:hover {
    background: color-mix(in hsl, hsl(var(--sv-accent)) 10%, transparent);
    border-color: hsl(var(--sv-accent));
    color: hsl(var(--sv-accent));
}

@media (max-width: 768px) {
    .sv-search-group-head .sv-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   SEARCH GRID (2 columns desktop, 1 mobile)
   ============================================ */
.sv-search-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    perspective: 900px; /* REV-SEARCH-05: 3D perspective */
}

@media (max-width: 768px) {
    .sv-search-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        perspective: none; /* Mobilde 3D kaldır */
    }
}

/* ============================================
   RESULT CARD
   ============================================ */
.sv-result-card {
    display: block;
    padding: 1.5rem;
    background: color-mix(in hsl, hsl(var(--sv-panel)) 92%, transparent);
    border: 1px solid color-mix(in hsl, hsl(var(--sv-border)) 65%, transparent);
    border-radius: var(--sv-r-3, 18px);
    box-shadow: 0 4px 16px color-mix(in hsl, hsl(var(--sv-shadow)) 12%, transparent);
    text-decoration: none;
    color: inherit;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d; /* REV-SEARCH-05: 3D transform */
    will-change: transform; /* Performance hint */
}

.sv-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: hsl(var(--sv-accent));
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* REV-SEARCH-05: Subtle 3D premium hover */
@media (hover: hover) {
    .sv-result-card:hover {
        transform: translateY(-3px) rotateX(1.2deg) rotateY(-1.2deg);
        border-color: color-mix(in hsl, hsl(var(--sv-accent)) 45%, hsl(var(--sv-border)));
        box-shadow: 0 16px 40px color-mix(in hsl, hsl(var(--sv-shadow)) 22%, transparent),
                    0 0 0 1px color-mix(in hsl, hsl(var(--sv-accent)) 15%, transparent);
    }
}

.sv-result-card:hover::before {
    opacity: 1;
}

/* Touch devices için basit hover */
@media (hover: none) {
    .sv-result-card:active {
        transform: translateY(-2px);
        border-color: color-mix(in hsl, hsl(var(--sv-accent)) 45%, hsl(var(--sv-border)));
        box-shadow: 0 12px 32px color-mix(in hsl, hsl(var(--sv-shadow)) 18%, transparent);
    }
}

/* ============================================
   RESULT TITLE
   ============================================ */
.sv-result-title {
    font-size: clamp(16px, 1.8vw, 18px);
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 0.75rem;
    color: hsl(var(--sv-text));
}

.sv-result-card:hover .sv-result-title {
    color: hsl(var(--sv-accent));
}

/* ============================================
   RESULT DESCRIPTION
   ============================================ */
.sv-result-desc {
    font-size: 14px;
    line-height: 1.6;
    color: hsl(var(--sv-muted));
    margin: 0 0 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   RESULT META (chips)
   ============================================ */
.sv-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.sv-result-meta .sv-chip {
    font-size: 11px;
    padding: 4px 10px;
    background: color-mix(in hsl, hsl(var(--sv-accent)) 12%, transparent);
    color: hsl(var(--sv-accent));
    border-color: color-mix(in hsl, hsl(var(--sv-accent)) 25%, transparent);
}

/* ============================================
   RESULT CTA
   ============================================ */
.sv-result-cta {
    font-size: 13px;
    font-weight: 600;
    color: hsl(var(--sv-accent));
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.2s ease;
}

.sv-result-card:hover .sv-result-cta {
    gap: 0.5rem;
}

/* ============================================
   QUERY HIGHLIGHT (mark tag)
   ============================================ */
.sv-result-card mark {
    background: hsl(var(--sv-accent));
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 1px 3px color-mix(in hsl, hsl(var(--sv-accent)) 40%, transparent);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.sv-search-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: color-mix(in hsl, hsl(var(--sv-panel)) 92%, transparent);
    border: 1px solid color-mix(in hsl, hsl(var(--sv-border)) 65%, transparent);
    border-radius: var(--sv-r-3, 18px);
    box-shadow: 0 4px 16px color-mix(in hsl, hsl(var(--sv-shadow)) 12%, transparent);
}
.sv-search-empty::before {
    content: '🔍';
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.sv-search-empty h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 1rem;
    color: hsl(var(--sv-text));
}

.sv-search-empty p {
    font-size: 16px;
    color: hsl(var(--sv-muted));
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

.sv-search-empty .suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.sv-search-empty .suggestions a {
    padding: 8px 16px;
    background: color-mix(in hsl, hsl(var(--sv-panel)) 92%, transparent);
    border: 1px solid color-mix(in hsl, hsl(var(--sv-border)) 65%, transparent);
    border-radius: 20px;
    color: hsl(var(--sv-text));
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.sv-search-empty .suggestions a:hover {
    background: hsl(var(--sv-accent));
    color: white;
    border-color: hsl(var(--sv-accent));
    transform: translateY(-1px);
}

.sv-search-empty-popular {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid color-mix(in hsl, hsl(var(--sv-border)) 65%, transparent);
}
.sv-search-empty-popular-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: hsl(var(--sv-muted));
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}
.sv-search-empty-popular a {
    display: inline-block;
    margin: 0 0.5rem 0.5rem 0;
    padding: 6px 14px;
    background: color-mix(in hsl, hsl(var(--sv-accent)) 12%, transparent);
    color: hsl(var(--sv-accent));
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.sv-search-empty-popular a:hover {
    background: hsl(var(--sv-accent));
    color: white;
}

/* ============================================
   MIN CHARACTER MESSAGE
   ============================================ */
.sv-search-min-char {
    text-align: center;
    padding: 3rem 2rem;
    background: color-mix(in hsl, hsl(var(--sv-panel)) 92%, transparent);
    border: 1px solid color-mix(in hsl, hsl(var(--sv-border)) 65%, transparent);
    border-radius: var(--sv-r-3, 18px);
    box-shadow: 0 4px 16px color-mix(in hsl, hsl(var(--sv-shadow)) 12%, transparent);
}

.sv-search-min-char p {
    font-size: 16px;
    color: hsl(var(--sv-muted));
    margin: 0;
    line-height: 1.6;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
[data-theme="dark"] .sv-result-card {
    background: color-mix(in hsl, hsl(var(--sv-panel)) 88%, transparent);
    border-color: color-mix(in hsl, hsl(var(--sv-border)) 55%, transparent);
}

[data-theme="dark"] .sv-result-card:hover {
    border-color: color-mix(in hsl, hsl(var(--sv-accent)) 50%, hsl(var(--sv-border)));
}

[data-theme="dark"] .sv-search-input {
    background: color-mix(in hsl, hsl(var(--sv-panel)) 88%, transparent);
    border-color: color-mix(in hsl, hsl(var(--sv-border)) 55%, transparent);
}

[data-theme="dark"] .sv-search-empty,
[data-theme="dark"] .sv-search-min-char {
    background: color-mix(in hsl, hsl(var(--sv-panel)) 88%, transparent);
    border-color: color-mix(in hsl, hsl(var(--sv-border)) 55%, transparent);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 480px) {
    .sv-search-hero {
        padding: 2rem 0 1.5rem;
    }
    
    .sv-search-hero h1 {
        font-size: 28px;
    }
    
    .sv-result-card {
        padding: 1.25rem;
    }
    
    .sv-search-grid {
        gap: 0.875rem;
    }
}

/* ============================================
   REV-SEARCH-09: INLINE TOP RESULTS PANEL
   ============================================ */
.sv-inline-results {
    max-width: var(--sv-detail-max, 1120px);
    margin: 14px auto 0;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    background: rgba(10, 14, 25, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    padding: 12px;
    box-sizing: border-box;
}

[data-theme="dark"] .sv-inline-results {
    background: rgba(15, 18, 26, 0.75);
    border-color: rgba(255, 255, 255, 0.15);
}

.sv-inline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 10px;
}

.sv-inline-head div {
    font-size: 14px;
    color: hsl(var(--sv-text));
}

.sv-inline-head strong {
    color: hsl(var(--sv-accent));
    font-weight: 700;
}

.sv-inline-jump {
    font-size: 13px;
    color: hsl(var(--sv-accent));
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.sv-inline-jump:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.sv-inline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 820px) {
    .sv-inline-grid {
        grid-template-columns: 1fr;
    }
    
    .sv-inline-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ============================================
   REV-SEARCH-10: SUGGEST DROPDOWN (ortak stil)
   ============================================ */
.sv-search-input-wrapper {
    position: relative; /* Dropdown için gerekli */
}

.sv-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    z-index: 800; /* REV-SEARCH-14: Normalized (1000000 → 800) */
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 14, 25, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
    width: 100%;
    pointer-events: auto;
}

[data-theme="dark"] .sv-suggest {
    background: rgba(15, 18, 26, 0.98);
    border-color: rgba(255, 255, 255, 0.15);
}

.sv-suggest-group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sv-suggest-group:last-child {
    border-bottom: none;
}

.sv-suggest-group-title {
    padding: 8px 12px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.03);
}

.sv-suggest a,
.sv-suggest-item {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.sv-suggest a:last-child,
.sv-suggest-item:last-child {
    border-bottom: none;
}

.sv-suggest a:hover,
.sv-suggest-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.sv-suggest .t {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    line-height: 1.4;
}

.sv-suggest .d {
    opacity: 0.82;
    font-size: 12px;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.4;
}

/* ============================================
   REV-SEARCH-14: FORCE SUGGEST DROPDOWN VISIBLE + ABOVE (normalized z-index)
   ============================================ */
.sv-search-input-wrapper {
    position: relative !important; /* Kritik: positioning */
    overflow: visible !important; /* Kritik: dropdown görünürlüğü */
    z-index: 700; /* REV-SEARCH-14: Normalized (1000000 → 700) */
}

#svGlobalSuggest.sv-suggest {
    position: absolute !important; /* Kritik: positioning */
    left: 0 !important; /* Kritik: positioning */
    right: 0 !important; /* Kritik: positioning */
    top: calc(100% + 10px) !important; /* Kritik: positioning */
    z-index: 800; /* REV-SEARCH-14: Normalized (1000001 → 800) */
    display: none; /* JS açacak */
    max-height: 360px;
    overflow: auto;
    color: #fff;
}

#svGlobalSuggest.sv-suggest.is-open {
    display: block !important; /* Kritik: görünürlük kontrolü */
}

/* REV-SEARCH-14: No result state */
.sv-suggest-no-result {
    padding: 12px;
    text-align: center;
}

.sv-suggest-no-result-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

/* ============================================
   REV-SEARCH-15: Keyboard navigation + Recent searches
   ============================================ */
/* Keyboard active item */
.sv-suggest [data-sv-suggest-item].is-active {
    outline: 2px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

.sv-suggest-view-all {
    font-weight: 600;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 4px;
    padding-top: 12px;
}

/* Recent searches chips */
.sv-suggest-recent {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
}

.sv-suggest-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    cursor: pointer;
    transition: background 0.15s ease;
}

.sv-suggest-chip:hover {
    background: rgba(255, 255, 255, 0.09);
}

.sv-suggest-chip-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.sv-suggest-chip-x {
    opacity: 0.7;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.7);
    transition: opacity 0.15s ease;
}

.sv-suggest-chip-x:hover {
    opacity: 1;
}
