/* ============================================================
   SIMEX AI SEARCH — search.css v3
   Nền: style.css variables (--color-primary, --color-heading...)
   Font: Lexend + Be Vietnam Pro (đã load sẵn)
   ============================================================ */

   :root {
    /* Override/extend từ style.css */
    --navy:        #192335;         /* = --color-heading */
    --amber:       #fdd333;         /* = --color-primary */
    --amber-l:     #fef9dc;
    --green:       #10B981;
    --gray-50:     #F8FAFC;
    --gray-100:    #F1F5F9;
    --gray-300:    #CBD5E1;
    --gray-500:    #64748B;
    --gray-700:    #334155;
    --white:       #FFFFFF;
    --radius:      12px;
    --shadow:      0 4px 24px rgba(25,35,53,.08);
    --shadow-hover:0 12px 40px rgba(25,35,53,.16);

    /* AI accent */
    --ai-purple:   #6366F1;
    --ai-purple-l: #EEF2FF;
    --ai-green:    #10B981;
    --ai-green-l:  #F0FDF4;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.sx-search-hero {
    background: var(--navy);
    padding: 52px 0 68px;
    position: relative;
    overflow: visible;
}
.sx-search-hero::before,
.sx-search-hero::after {
    pointer-events: none;
    overflow: hidden;
}

/* Grid dot pattern — tech feel */
.sx-search-hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle, rgba(253,211,51,.12) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

/* Glow accent phải */
.sx-search-hero::after {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(99,102,241,.18) 0%, transparent 70%);
    pointer-events: none;
}

.sx-search-hero .container { position: relative; z-index: 1; }

/* Label pill */
.sx-hero-label {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(99,102,241,.15);
    color: #a5b4fc;
    font-size: 11px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    padding: 5px 16px; border-radius: 99px;
    border: 1px solid rgba(99,102,241,.3);
    margin-bottom: 16px;
}
.sx-hero-label::before {
    content: '';
    width: 6px; height: 6px; border-radius: 50%;
    background: #a5b4fc;
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .4; transform: scale(.7); }
}

.sx-hero-title {
    font-family: 'Lexend', sans-serif;
    font-size: clamp(20px, 3.5vw, 30px);
    font-weight: 700; color: var(--white);
    margin: 0 0 8px; line-height: 1.3;
}
.sx-hero-title span {
    color: var(--amber);
    position: relative;
}

.sx-hero-sub {
    color: rgba(255,255,255,.55);
    font-size: 14px; margin: 0 0 28px;
}

/* ============================================================
   SEARCH BOX
   ============================================================ */
.sx-search-wrap {
    max-width: 660px; margin: 0 auto;
    position: relative;
}
.sx-search-box {
    display: flex; align-items: center;
    background: rgba(255,255,255,.97);
    border-radius: 99px;
    box-shadow: 0 8px 48px rgba(0,0,0,.3), 0 0 0 1px rgba(253,211,51,.25);
    position: relative;
}
.sx-search-icon {
    padding: 0 14px 0 22px;
    color: var(--gray-500); flex-shrink: 0;
    display: flex; align-items: center;
}
.sx-search-input {
    flex: 1; border: none !important; outline: none;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 15px; color: var(--navy);
    padding: 15px 0;
    background: transparent;
}
.sx-search-input::placeholder { color: var(--gray-300); }

.sx-search-btn {
    background: var(--amber); color: var(--navy);
    border: none; cursor: pointer;
    font-family: 'Lexend', sans-serif;
    font-size: 13px; font-weight: 700;
    padding: 0 26px; height: 52px;
    border-radius: 0 99px 99px 0;
    transition: background .2s, transform .15s;
    flex-shrink: 0;
    display: flex; align-items: center; gap: 7px;
}
.sx-search-btn:hover  { background: #f5c800; }
.sx-search-btn:active { transform: scale(.97); }

/* ============================================================
   AUTOCOMPLETE DROPDOWN
   ============================================================ */
.sx-autocomplete {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(25,35,53,.2);
    border: 1px solid var(--gray-100);
    z-index: 99999; overflow: hidden;
    display: none;
}
.sx-autocomplete.open { display: block; animation: dropIn .15s ease; }
@keyframes dropIn {
    from { opacity:0; transform:translateY(-6px); }
    to   { opacity:1; transform:translateY(0); }
}
.sx-ac-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; cursor: pointer;
    transition: background .12s;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
}
.sx-ac-item:last-child { border-bottom: none; }
.sx-ac-item:hover, .sx-ac-item.active { background: var(--gray-50); }

.sx-ac-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 14px;
}
.sx-ac-icon.graduation { background: var(--ai-purple-l); }
.sx-ac-icon.book       { background: var(--ai-green-l); }
.sx-ac-icon.search     { background: var(--amber-l); }

.sx-ac-label { font-size: 13px; font-weight: 500; color: var(--navy); flex: 1; }
.sx-ac-type  {
    font-size: 10px; color: var(--gray-500);
    background: var(--gray-100);
    padding: 2px 8px; border-radius: 99px; white-space: nowrap;
}

/* ============================================================
   QUICK CHIPS
   ============================================================ */
.sx-chips {
    display: flex; flex-wrap: wrap; gap: 7px;
    margin-top: 16px; justify-content: center;
}
.sx-chip {
    background: rgba(255,255,255,.08); color: rgba(255,255,255,.7);
    border: 1px solid rgba(255,255,255,.15);
    font-size: 11px; font-weight: 500;
    padding: 5px 13px; border-radius: 99px;
    cursor: pointer; transition: all .2s; text-decoration: none;
}
.sx-chip:hover {
    background: var(--amber); color: var(--navy);
    border-color: var(--amber);
}

/* ============================================================
   AI BANNER
   ============================================================ */
.sx-ai-banner {
    background: linear-gradient(135deg, var(--ai-purple-l) 0%, var(--ai-green-l) 100%);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 32px;
    display: flex; align-items: flex-start; gap: 14px;
    animation: fadeSlideDown .35s ease;
    position: relative; overflow: hidden;
}

/* Stripe trang trí góc phải */
.sx-ai-banner::after {
    content: 'AI';
    position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
    font-family: 'Lexend', sans-serif;
    font-size: 64px; font-weight: 800;
    color: rgba(99,102,241,.06);
    pointer-events: none; line-height: 1;
}

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

.sx-ai-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--ai-purple), #7c3aed);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: white; font-size: 18px;
}

.sx-ai-body { flex: 1; }
.sx-ai-label {
    font-family: 'Lexend', sans-serif;
    font-size: 10px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--ai-purple); margin-bottom: 4px;
    display: flex; align-items: center; gap: 5px;
}
.sx-ai-label::before {
    content: '';
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--ai-purple);
    animation: pulse-dot 2s infinite;
}
.sx-ai-text {
    font-size: 13px; color: var(--gray-700);
    line-height: 1.6; margin: 0 0 10px;
}
.sx-ai-courses { display: flex; flex-wrap: wrap; gap: 7px; }
.sx-ai-course-link {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--white); color: var(--navy);
    border: 1px solid #c7d2fe; border-radius: 7px;
    padding: 5px 12px; font-size: 12px; font-weight: 600;
    text-decoration: none; transition: all .2s;
}
.sx-ai-course-link:hover {
    background: var(--navy); color: var(--white);
    border-color: var(--navy);
}

/* Skeleton */
.sx-ai-skeleton {
    background: linear-gradient(135deg, var(--ai-purple-l), var(--ai-green-l));
    border: 1px solid #c7d2fe;
    border-radius: var(--radius); padding: 18px 22px;
    margin-bottom: 32px; display: flex; gap: 14px;
}
.sx-skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #e0e7ff 25%, #c7d2fe 50%, #e0e7ff 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite; border-radius: 4px;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   STATS BAR
   ============================================================ */
.sx-stats-bar {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 12px 18px;
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: 10px; margin-bottom: 28px;
}
.sx-stat-item {
    display: flex; align-items: center; gap: 7px;
    font-size: 13px; color: var(--gray-700);
}
.sx-stat-dot { width: 7px; height: 7px; border-radius: 50%; }
.sx-stat-dot.blue  { background: var(--ai-purple); }
.sx-stat-dot.green { background: var(--ai-green); }
.sx-stat-dot.amber { background: var(--amber); }
.sx-stat-num { font-weight: 700; color: var(--navy); }

/* Divider dọc giữa các stat */
.sx-stat-item + .sx-stat-item {
    padding-left: 16px;
    border-left: 1px solid var(--gray-100);
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.sx-section-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 20px;
}
.sx-section-title {
    font-family: 'Lexend', sans-serif;
    font-size: 14px; font-weight: 800;
    color: var(--navy); margin: 0;
    letter-spacing: .06em;
    display: flex; align-items: center; gap: 8px;
}
/* Line accent kế tiêu đề */
.sx-section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--amber), transparent);
    min-width: 40px;
}
.sx-section-count {
    margin-left: auto; white-space: nowrap;
    font-size: 12px; color: var(--gray-500);
    background: var(--gray-100);
    padding: 2px 10px; border-radius: 99px;
}

/* ============================================================
   CARD: KHÓA HỌC
   ============================================================ */
.sx-course-card {
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
    transition: transform .25s, box-shadow .25s, border-color .25s;
    height: 100%; display: flex; flex-direction: column;
    border: 1px solid var(--gray-100);
}
.sx-course-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--amber);
}

.sx-course-img { position: relative; overflow: hidden; aspect-ratio: 16/9; }
.sx-course-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s; display: block; }
.sx-course-card:hover .sx-course-img img { transform: scale(1.06); }

.sx-course-badge {
    position: absolute; top: 10px; left: 10px;
    background: var(--amber); color: var(--navy);
    font-family: 'Lexend', sans-serif;
    font-size: 9px; font-weight: 800;
    letter-spacing: .08em; text-transform: uppercase;
    padding: 3px 9px; border-radius: 4px;
}

.sx-course-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.sx-course-title {
    font-family: 'Lexend', sans-serif;
    font-size: 15px; font-weight: 700;
    color: var(--navy); text-decoration: none;
    line-height: 1.4; margin-bottom: 8px; display: block;
}
.sx-course-title:hover { color: var(--ai-purple); }
.sx-course-desc {
    font-size: 12px; color: var(--gray-500);
    line-height: 1.6; flex: 1; margin-bottom: 14px;
}
.sx-course-cta {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--amber); color: var(--navy);
    font-family: 'Lexend', sans-serif;
    font-size: 11px; font-weight: 700;
    padding: 8px 16px; border-radius: 7px;
    text-decoration: none; transition: all .2s;
    align-self: flex-start; letter-spacing: .03em;
}
.sx-course-cta:hover { background: var(--navy); color: var(--white); }
.sx-course-cta svg { width: 13px; height: 13px; }

/* ============================================================
   CARD: TIN TỨC
   ============================================================ */
.sx-news-card {
    display: flex; gap: 14px;
    background: var(--white); border-radius: var(--radius);
    padding: 14px; box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s, border-color .2s;
    border: 1px solid var(--gray-100); text-decoration: none;
}
.sx-news-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(253,211,51,.4);
}
.sx-news-img {
    width: 88px; height: 66px;
    border-radius: 8px; overflow: hidden; flex-shrink: 0;
}
.sx-news-img img { width: 100%; height: 100%; object-fit: cover; }
.sx-news-body { flex: 1; }
.sx-news-title {
    font-family: 'Lexend', sans-serif;
    font-size: 13px; font-weight: 600;
    color: var(--navy); line-height: 1.4; margin-bottom: 5px;
}
.sx-news-desc {
    font-size: 12px; color: var(--gray-500); line-height: 1.5;
}

/* ============================================================
   CARD: HOẠT ĐỘNG
   ============================================================ */
.sx-activity-card {
    position: relative; overflow: hidden;
    border-radius: var(--radius);
    aspect-ratio: 4/3; cursor: pointer;
    box-shadow: var(--shadow);
}
.sx-activity-card img {
    width: 100%; height: 100%;
    object-fit: cover; transition: transform .45s; display: block;
}
.sx-activity-card:hover img { transform: scale(1.08); }
.sx-activity-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(25,35,53,.88) 0%, transparent 55%);
    display: flex; align-items: flex-end; padding: 12px;
    text-decoration: none;
}
.sx-activity-title {
    font-family: 'Lexend', sans-serif;
    font-size: 12px; font-weight: 600;
    color: var(--white); line-height: 1.3;
}

/* ============================================================
   AI INSIGHT — 3 ô: Là gì / Ai học / Làm ở đâu
   ============================================================ */
.sx-ai-insight {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 12px 0 14px;
}
@media (max-width: 767px) {
    .sx-ai-insight { grid-template-columns: 1fr; gap: 8px; }
}
.sx-ai-ins-item {
    display: flex; gap: 10px; align-items: flex-start;
    background: var(--white);
    border: 1px solid #e0e7ff;
    border-radius: 10px;
    padding: 11px 13px;
}
.sx-ai-ins-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.sx-ai-ins-label {
    font-family: 'Lexend', sans-serif;
    font-size: 10px; font-weight: 700;
    letter-spacing: .07em; text-transform: uppercase;
    color: var(--ai-purple); margin-bottom: 4px;
}
.sx-ai-ins-text { font-size: 12px; color: var(--gray-700); line-height: 1.55; }

/* ============================================================
   HIGHLIGHT
   ============================================================ */
mark.simex-hl {
    background: var(--amber-l); color: #7a5f00;
    padding: 0 2px; border-radius: 3px;
    font-weight: 700;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.sx-empty { text-align: center; padding: 70px 20px; }
.sx-empty-icon {
    width: 76px; height: 76px; border-radius: 50%;
    background: var(--gray-100); margin: 0 auto 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
}
.sx-empty-title {
    font-family: 'Lexend', sans-serif;
    font-size: 20px; font-weight: 700;
    color: var(--navy); margin-bottom: 8px;
}
.sx-empty-desc {
    font-size: 13px; color: var(--gray-500); margin-bottom: 24px; line-height: 1.7;
}
.sx-btn-home {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--navy); color: var(--white);
    font-family: 'Lexend', sans-serif;
    font-size: 13px; font-weight: 600;
    padding: 11px 24px; border-radius: 8px;
    text-decoration: none; transition: background .2s;
}
.sx-btn-home:hover { background: var(--ai-purple); color: var(--white); }

/* ============================================================
   SPACING / WRAPPER
   ============================================================ */
.sx-section { margin-bottom: 48px; }
.sx-results-wrap {
    padding: 44px 0;
    background: var(--gray-50);
    min-height: 60vh;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
    .sx-search-hero { padding: 36px 0 52px; }
    .sx-search-btn  { padding: 0 18px; font-size: 12px; }
    .sx-stats-bar   { gap: 10px; }
    .sx-stat-item + .sx-stat-item { padding-left: 10px; }
    .sx-news-img    { width: 72px; height: 54px; }
    .sx-ai-banner::after { display: none; }
}