/* ==========================================================================
   STATIC AJAX SEARCH SYSTEM
   This stylesheet styles ONLY the static search feature.
   Namespaced under "satv-search-" to prevent conflicts.
   ========================================================================== */

/* Search Wrapper (Header placement) */
.search-bar {
    position: absolute;
    left: 190px;
    bottom: 2px;
    z-index: 999999;
    display: flex;
    align-items: center;
}

.satv-search-static-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 220px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.satv-search-static-wrapper:focus-within {
    width: 280px;
}

/* Static Input Box */
.satv-search-input {
    width: 100%;
    height: 38px;
    padding: 0 35px 0 14px;
    border-radius: 20px;
    border: 1.5px solid #d1d5db;
    background: #ffffff;
    font-size: 0.92rem;
    color: #1a1a1a;
    outline: none;
    font-family: var(--main-font), system-ui, sans-serif;
    transition: all 0.25s ease;
}

.satv-search-input:focus {
    border-color: #ab8b08;
    box-shadow: 0 0 0 3px rgba(171, 139, 8, 0.12),
                0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Clear Input button */
.satv-search-clear {
    position: absolute;
    right: 32px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.satv-search-clear:hover {
    color: #475569;
    background: #f1f5f9;
}

/* Submit Icon Button inside input */
.satv-search-submit-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    color: #1a1a1a;
    transition: all 0.2s ease;
}

.satv-search-submit-btn:hover {
    color: #ab8b08;
    background-color: rgba(0, 0, 0, 0.04);
}

.satv-search-submit-btn svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* Results Dropdown Container */
.satv-search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 380px;
    max-height: 420px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 
                0 8px 10px -6px rgba(0, 0, 0, 0.05),
                0 0 1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    overflow-y: auto;
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    padding: 6px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* Dropdown list custom scrollbar */
.satv-search-results-dropdown::-webkit-scrollbar {
    width: 5px;
}

.satv-search-results-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.satv-search-results-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.satv-search-results-dropdown::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Dropdown Result Item Card */
.satv-search-item {
    display: flex;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.satv-search-item:last-child {
    border-bottom: none;
}

.satv-search-item:hover {
    background: #f8fafc;
    transform: translateX(2px);
}

.satv-search-item-image-wrapper {
    width: 72px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    background: #e2e8f0;
    flex-shrink: 0;
}

.satv-search-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.satv-search-item:hover .satv-search-item-image {
    transform: scale(1.06);
}

.satv-search-item-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    gap: 4px;
    min-width: 0; /* Allow text truncation */
}

.satv-search-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    color: #1e293b;
    margin: 0;
    font-family: var(--main-font), system-ui, sans-serif;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s ease;
}

.satv-search-item:hover .satv-search-item-title {
    color: #ab8b08;
}

.satv-search-item-meta {
    font-size: 0.78rem;
    color: #64748b;
    font-family: var(--main-font), system-ui, sans-serif;
    font-weight: 500;
}

/* Status state displays (Loading, Empty, Errors) */
.satv-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 12px;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: var(--main-font), system-ui, sans-serif;
}

.satv-search-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid #f1f5f9;
    border-top: 2px solid #ab8b08;
    border-radius: 50%;
    animation: satv-spin 0.7s linear infinite;
}

.satv-search-status-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    text-align: center;
    gap: 8px;
}

.satv-search-status-icon {
    font-size: 1.6rem;
}

.satv-search-status-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    font-family: var(--main-font), system-ui, sans-serif;
}

.satv-search-status-text {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0;
    font-family: var(--main-font), system-ui, sans-serif;
}

@keyframes satv-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   RESPONSIVE DESIGN OVERRIDES
   ========================================================================== */
@media (max-width: 1024px) {
    .satv-search-static-wrapper {
        width: 170px;
    }
    .satv-search-static-wrapper:focus-within {
        width: 200px;
    }
    .satv-search-results-dropdown {
        width: 320px;
    }
}

@media (max-width: 768px) {
    .search-bar {
        left: 105px;
    }
    .satv-search-static-wrapper {
        width: 140px;
    }
    .satv-search-static-wrapper:focus-within {
        width: 170px;
    }
}

@media (max-width: 640px) {
    .search-bar {
        left: 15px;
        bottom: 2px;
    }
    .satv-search-static-wrapper {
        width: 120px;
    }
    .satv-search-static-wrapper:focus-within {
        width: 150px;
    }
    .satv-search-results-dropdown {
        width: 280px;
    }
}

@media (max-width: 480px) {
    .search-bar {
        position: static;
        order: 2;
        margin: 5px auto 0;
    }
    .satv-search-static-wrapper {
        width: 100%;
        max-width: 300px;
    }
    .satv-search-static-wrapper:focus-within {
        width: 100%;
        max-width: 300px;
    }
    .satv-search-results-dropdown {
        width: 100%;
        left: 0;
        right: 0;
    }
    .header-top {
        flex-wrap: wrap;
        padding-bottom: 8px;
    }
}
