/* ═══════════════════════════════════════════════
   KIAN SEARCH RESULTS PAGE (standalone file)
   Loaded only on search/filter pages
   Version: 1.0.0
   ═══════════════════════════════════════════════ */

.ksr-page {
    padding: 40px 0 80px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    min-height: 70vh;
}

/* ═══ Header ═══ */
.ksr-header {
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,.05);
    border: 1px solid #e2e8f0;
}
.ksr-header-inner {
    display: flex !important;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.ksr-header-ic {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0891B2, #0e7490);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(8,145,178,.25);
}
.ksr-title {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 4px;
    line-height: 1.3;
}
.ksr-subtitle {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}
.ksr-subtitle strong {
    color: #0891B2;
    font-weight: 800;
}

/* ═══ Search Form ═══ */
.ksr-form {
    margin-bottom: 16px;
}
.ksr-form-row {
    display: flex !important;
    gap: 10px;
    align-items: stretch;
}
.ksr-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    transition: all .2s;
    min-width: 0;
}
.ksr-input-wrap:focus-within {
    border-color: #0891B2;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(8,145,178,.1);
}
.ksr-input-ic {
    padding: 0 14px;
    font-size: 18px;
    color: #94a3b8;
}
.ksr-input-wrap input {
    flex: 1;
    padding: 13px 4px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    outline: none;
    min-width: 0;
}
.ksr-submit {
    padding: 0 28px;
    background: linear-gradient(135deg, #0891B2, #0e7490);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.ksr-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(8,145,178,.3);
}

/* ═══ Autocomplete ═══ */
.ksr-autocomplete {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.12);
    max-height: 380px;
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all .2s;
}
.ksr-autocomplete.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.ksr-auto-item {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #0f172a;
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
}
.ksr-auto-item:last-child { border-bottom: none; }
.ksr-auto-item:hover { background: #f0f9ff; }
.ksr-auto-ic {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f0f9ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.ksr-auto-text {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}
.ksr-auto-text small {
    color: #94a3b8;
    font-weight: 500;
    font-size: 12px;
    margin-right: 6px;
}
.ksr-auto-badge {
    padding: 3px 10px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}

/* ═══ Active filter chips ═══ */
.ksr-active-filters {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px dashed #e2e8f0;
}
.ksr-active-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    margin-left: 4px;
}
.ksr-chip-active {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f0f9ff;
    color: #0891B2;
    border: 1px solid #bae6fd;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all .15s;
}
.ksr-chip-active:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}
.ksr-chip-x {
    font-size: 16px;
    line-height: 1;
    font-weight: 900;
}
.ksr-chip-clear {
    padding: 6px 12px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    margin-right: auto;
}
.ksr-chip-clear:hover { background: #dc2626; color: #fff; }

/* ═══ Layout ═══ */
.ksr-layout {
    display: grid !important;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

/* ═══ Sidebar ═══ */
.ksr-sidebar {
    position: sticky;
    top: 100px;
}
.ksr-sidebar-toggle {
    display: none;
    width: 100%;
    padding: 12px;
    background: #0891B2;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 12px;
}
.ksr-filter-box {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0,0,0,.03);
}
.ksr-filter-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}
.ksr-filter-search {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    margin-bottom: 10px;
    outline: none;
    transition: border .15s;
}
.ksr-filter-search:focus { border-color: #0891B2; }
.ksr-filter-list {
    display: flex !important;
    flex-direction: column;
    gap: 3px;
}
.ksr-scroll {
    max-height: 320px;
    overflow-y: auto;
    padding-left: 4px;
}
.ksr-scroll::-webkit-scrollbar { width: 6px; }
.ksr-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
.ksr-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.ksr-filter-item {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 10px;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s;
}
.ksr-filter-item:hover {
    background: #f0f9ff;
    color: #0891B2;
}
.ksr-filter-item.active {
    background: linear-gradient(135deg, #0891B2, #0e7490);
    color: #fff;
}
.ksr-filter-count {
    background: rgba(0,0,0,.08);
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}
.ksr-filter-item.active .ksr-filter-count {
    background: rgba(255,255,255,.25);
    color: #fff;
}

/* ═══ Results Grid ═══ */
.ksr-main { min-width: 0; }
.ksr-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}
.ksr-card {
    position: relative;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all .2s;
    box-shadow: 0 2px 10px rgba(0,0,0,.03);
}
.ksr-card:hover {
    transform: translateY(-4px);
    border-color: #0891B2;
    box-shadow: 0 12px 30px rgba(8,145,178,.12);
}
.ksr-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 800;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(245,158,11,.3);
}
.ksr-card-badge-match {
    background: linear-gradient(135deg, #0891B2, #0e7490);
    box-shadow: 0 4px 10px rgba(8,145,178,.3);
}
.ksr-card-link {
    display: block;
    padding: 20px;
    color: #0f172a;
    text-decoration: none;
}
.ksr-card-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 12px;
    line-height: 1.4;
}
.ksr-card:hover .ksr-card-title { color: #0891B2; }
.ksr-card-meta {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.ksr-meta-item {
    font-size: 12px;
    padding: 3px 9px;
    background: #f1f5f9;
    border-radius: 50px;
    color: #475569;
    font-weight: 600;
    display: inline-block;
}
.ksr-meta-service {
    background: #f0f9ff;
    color: #0891B2;
}
.ksr-card-excerpt {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 12px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ksr-card-footer {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}
.ksr-card-rating {
    font-size: 13px;
    font-weight: 800;
    color: #f59e0b;
}
.ksr-card-cta {
    font-size: 13px;
    font-weight: 800;
    color: #0891B2;
}

/* ═══ Pagination ═══ */
.ksr-pagination {
    margin-top: 32px;
    display: flex !important;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.ksr-pagination .page-numbers {
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #475569;
    font-weight: 700;
    text-decoration: none;
    font-size: 14px;
    transition: all .15s;
}
.ksr-pagination .page-numbers:hover {
    background: #f0f9ff;
    color: #0891B2;
    border-color: #0891B2;
}
.ksr-pagination .page-numbers.current {
    background: linear-gradient(135deg, #0891B2, #0e7490);
    color: #fff;
    border-color: #0891B2;
}

/* ═══ Fuzzy notice ═══ */
.ksr-fuzzy-notice {
    padding: 14px 18px;
    background: #fef3c7;
    color: #78350f;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 18px;
    border-right: 4px solid #f59e0b;
}

/* ═══ Empty state ═══ */
.ksr-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 16px;
    border: 2px dashed #e2e8f0;
}
.ksr-empty-ic { font-size: 64px; margin-bottom: 16px; opacity: .6; }
.ksr-empty h2 {
    font-size: 22px;
    color: #0f172a;
    margin: 0 0 8px;
    font-weight: 800;
}
.ksr-empty p {
    color: #64748b;
    font-size: 15px;
    margin: 0 0 24px;
}
.ksr-empty-suggestions strong {
    display: block;
    color: #0f172a;
    margin-bottom: 12px;
    font-size: 14px;
}
.ksr-empty-chips {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.ksr-sug-chip {
    padding: 9px 16px;
    background: #f0f9ff;
    color: #0891B2;
    border: 1px solid #bae6fd;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all .15s;
}
.ksr-sug-chip:hover {
    background: #0891B2;
    color: #fff;
    transform: translateY(-2px);
}

/* ═══ Responsive ═══ */
@media (max-width: 900px) {
    .ksr-layout { grid-template-columns: 1fr !important; }
    .ksr-sidebar {
        position: static;
        margin-bottom: 16px;
    }
    .ksr-sidebar-toggle { display: block !important; }
    .ksr-sidebar-inner { display: none; }
    .ksr-sidebar-inner.open { display: block; }
}
@media (max-width: 600px) {
    .ksr-page { padding: 20px 0 60px; }
    .ksr-header { padding: 18px; border-radius: 16px; }
    .ksr-header-inner { gap: 12px; }
    .ksr-header-ic { width: 44px; height: 44px; font-size: 20px; }
    .ksr-form-row { flex-direction: column; }
    .ksr-submit { width: 100%; padding: 12px; }
    .ksr-grid { grid-template-columns: 1fr !important; }
}
