/* ═══════════════════════════════════════════════
   Simfotix Training Search  –  Styles
   ═══════════════════════════════════════════════ */

/* Google Fonts – Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ── Variables ────────────────────────────── */
:root {
    --sts-primary:       #E3135C;
    --sts-primary-hover: #C90E50;
    --sts-bg:            #ffffff;
    --sts-text:          #2D2D2D;
    --sts-text-muted:    #7A7A7A;
    --sts-border:        #E8E8E8;
    --sts-shadow:        0 8px 32px rgba(0, 0, 0, 0.12);
    --sts-shadow-hover:  0 12px 40px rgba(0, 0, 0, 0.18);
    --sts-radius:        60px;
    --sts-radius-dropdown: 16px;
    --sts-font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --sts-transition:    all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Wrapper ──────────────────────────────── */
.sts-search-wrapper {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    position: relative;
    z-index: 999;
    font-family: var(--sts-font);
}

/* ── Auto-injected container (between hero & content) ── */
.sts-auto-injected {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 12px;
    box-sizing: border-box;
}

/* ── Form ─────────────────────────────────── */
.sts-search-form {
    position: relative;
    margin: 0;
    padding: 0;
}

.sts-search-inner {
    display: flex;
    align-items: center;
    background: var(--sts-bg);
    border-radius: var(--sts-radius);
    box-shadow: var(--sts-shadow);
    padding: 6px 6px 6px 24px;
    transition: var(--sts-transition);
    position: relative;
}

.sts-search-inner:focus-within {
    box-shadow: var(--sts-shadow-hover);
}

/* ── Keyword field ────────────────────────── */
.sts-field--keyword {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.sts-icon-search-input {
    width: 20px;
    height: 20px;
    color: var(--sts-text-muted);
    flex-shrink: 0;
    margin-right: 10px;
}

.sts-input {
    width: 100%;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 15px;
    font-family: var(--sts-font);
    color: var(--sts-text);
    padding: 12px 0 !important;
    line-height: 1.4;
}

.sts-input:focus,
.sts-input:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.sts-input::placeholder {
    color: var(--sts-text-muted);
    font-weight: 400;
}

/* ── Divider ──────────────────────────────── */
.sts-divider {
    width: 1px;
    height: 32px;
    background: var(--sts-border);
    flex-shrink: 0;
    margin: 0 8px;
}

/* ── Category select ──────────────────────── */
.sts-field--category {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sts-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 15px;
    font-family: var(--sts-font);
    font-weight: 500;
    color: var(--sts-text);
    padding: 12px 30px 12px 12px;
    cursor: pointer;
    min-width: 155px;
}

.sts-select:focus,
.sts-select:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.sts-icon-chevron {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--sts-text-muted);
    pointer-events: none;
}

/* ── Search button ────────────────────────── */
.sts-btn-search {
    width: 50px;
    height: 50px;
    border-radius: 50% !important;
    border: none !important;
    background: var(--sts-primary) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--sts-transition);
    box-shadow: 0 4px 14px rgba(227, 19, 92, 0.35) !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    min-width: 50px !important;
}

.sts-btn-search:hover {
    background: var(--sts-primary-hover) !important;
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(227, 19, 92, 0.45) !important;
}

.sts-btn-search:active {
    transform: scale(0.97);
}

.sts-btn-search svg {
    width: 22px;
    height: 22px;
    color: #fff !important;
    stroke: #fff !important;
}

/* ═══════════════════════════════════════════════
   Instant Results Dropdown
   ═══════════════════════════════════════════════ */
.sts-instant-results {
    position: absolute;
    top: calc(100% + 14px);
    left: -24px;
    right: 0;
    width: calc(100% + 24px);
    min-width: 360px;
    background: var(--sts-bg);
    border-radius: var(--sts-radius-dropdown);
    box-shadow: var(--sts-shadow-hover);
    display: none;
    overflow: hidden;
    z-index: 1000;
    animation: stsSlideDown 0.2s ease-out;
}

.sts-instant-results.sts-visible {
    display: block;
}

@keyframes stsSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Single result item ───────────────────── */
.sts-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--sts-text);
    transition: background 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.sts-result-item:last-child {
    border-bottom: none;
}

.sts-result-item:hover {
    background: #f8f9fc;
}

.sts-result-thumb {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}

.sts-result-info {
    flex: 1;
    min-width: 0;
}

.sts-result-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--sts-text);
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sts-result-cat {
    font-size: 12px;
    font-weight: 500;
    color: var(--sts-primary);
    margin: 0;
    display: inline-block;
    background: rgba(227, 19, 92, 0.08);
    padding: 2px 8px;
    border-radius: 20px;
}

/* ── View All link ────────────────────────── */
.sts-view-all {
    display: block;
    text-align: center;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sts-primary);
    text-decoration: none;
    border-top: 1px solid #f0f0f0;
    transition: background 0.15s ease;
}

.sts-view-all:hover {
    background: rgba(227, 19, 92, 0.04);
    color: var(--sts-primary-hover);
}

/* ── No results ───────────────────────────── */
.sts-no-results {
    padding: 24px 18px;
    text-align: center;
    color: var(--sts-text-muted);
    font-size: 14px;
}

.sts-no-results svg {
    width: 36px;
    height: 36px;
    color: var(--sts-border);
    margin-bottom: 8px;
}

/* ── Loading spinner ──────────────────────── */
.sts-loading {
    padding: 20px 18px;
    text-align: center;
}

.sts-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #f0f0f0;
    border-top-color: var(--sts-primary);
    border-radius: 50%;
    animation: stsSpin 0.6s linear infinite;
}

@keyframes stsSpin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════
   Responsive Styles
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .sts-search-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .sts-search-form {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .sts-search-inner {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        border-radius: 50px !important;
        padding: 4px 6px 4px 12px !important;
        gap: 4px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .sts-field--keyword {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        width: auto !important;
        overflow: hidden !important;
    }

    .sts-icon-search-input {
        width: 15px !important;
        height: 15px !important;
        margin-right: 5px !important;
        flex-shrink: 0 !important;
    }

    .sts-input {
        font-size: 12.5px !important;
        padding: 6px 0 !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .sts-input::placeholder {
        font-size: 12px !important;
    }

    .sts-divider {
        display: block !important;
        width: 1px !important;
        height: 20px !important;
        margin: 0 3px !important;
        background: var(--sts-border) !important;
        flex-shrink: 0 !important;
    }

    .sts-field--category {
        flex: 0 0 34% !important;
        max-width: 36% !important;
        min-width: 0 !important;
        width: auto !important;
        position: relative !important;
        overflow: hidden !important;
    }

    .sts-select {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        font-size: 11.5px !important;
        padding: 6px 16px 6px 2px !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .sts-icon-chevron {
        right: 2px !important;
        width: 12px !important;
        height: 12px !important;
    }

    .sts-btn-search {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
        border-radius: 50% !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        padding: 0 !important;
    }

    .sts-btn-search svg {
        width: 16px !important;
        height: 16px !important;
    }

    .sts-instant-results {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
        top: calc(100% + 8px);
        border-radius: 14px;
        box-sizing: border-box !important;
    }
}

@media (max-width: 420px) {
    .sts-search-inner {
        padding: 3px 4px 3px 8px !important;
        gap: 2px !important;
    }

    .sts-field--keyword {
        flex: 1 1 0% !important;
    }

    .sts-icon-search-input {
        width: 14px !important;
        height: 14px !important;
        margin-right: 3px !important;
    }

    .sts-input {
        font-size: 11.5px !important;
        padding: 5px 0 !important;
    }

    .sts-input::placeholder {
        font-size: 11px !important;
    }

    .sts-field--category {
        flex: 0 0 33% !important;
        max-width: 35% !important;
    }

    .sts-select {
        font-size: 11px !important;
        padding: 5px 14px 5px 1px !important;
    }

    .sts-icon-chevron {
        right: 1px !important;
        width: 11px !important;
        height: 11px !important;
    }

    .sts-btn-search {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
    }

    .sts-btn-search svg {
        width: 15px !important;
        height: 15px !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sts-search-wrapper {
        max-width: 90%;
    }
}


