@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --page: #f8f7ff;
    --surface: #ffffff;
    --surface-soft: #f1edff;
    --purple: #8b5cf6;
    --purple-dark: #7040df;
    --purple-light: #eee7ff;
    --yellow: #ffe600;
    --yellow-soft: #fff7ad;
    --mint: #a7f3d0;
    --lime: #d9f99d;
    --ink: #252238;
    --muted: #77738a;
    --line: #e9e5f5;
    --shadow: 0 14px 40px rgba(69, 45, 125, 0.08);
    --shadow-hover: 0 18px 42px rgba(69, 45, 125, 0.14);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-family: 'Nunito', 'Plus Jakarta Sans', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 15%, rgba(255, 230, 0, 0.13), transparent 19rem),
        radial-gradient(circle at 92% 24%, rgba(139, 92, 246, 0.10), transparent 23rem),
        var(--page);
}

/* Navigation */
.site-nav {
    width: 100%;
    min-height: 76px;
    padding: 15px max(6%, calc((100% - 1160px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid rgba(233, 229, 245, 0.9);
    backdrop-filter: blur(14px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 23px;
    font-weight: 900;
    letter-spacing: -1.2px;
}

.brand span {
    color: var(--purple);
}

.brand-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 12px;
    flex-shrink: 0;
}

.brand i {
    margin-left: 5px;
    color: #e9c900;
    font-size: 23px;
    font-style: normal;
    transform: rotate(7deg);
}

.brand-name {
    display: inline;
    margin: 0;
    padding: 0;
    letter-spacing: -1px;
}

.brand-accent {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--purple-dark);
    background: var(--purple-light);
    border: 1px solid #e4d9ff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    transition: 0.2s ease;
}

.site-nav a:hover {
    color: var(--ink);
    background: var(--yellow);
    border-color: var(--yellow);
    transform: translateY(-2px);
}

/* Main and hero */
main {
    width: min(1160px, 88%);
    margin: 0 auto;
    flex: 1;
}

.hero {
    position: relative;
    max-width: 850px;
    margin: 76px auto 58px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 20px;
    padding: 8px 14px;
    color: var(--purple-dark);
    background: var(--purple-light);
    border: 1px solid #e5dcff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.15px;
}

.hero-badge-bolt {
    color: #d8b900;
    font-size: 15px;
}

.hero h1 {
    position: relative;
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(38px, 6vw, 64px);
    font-weight: 900;
    line-height: 1.13;
    letter-spacing: -3px;
}

.hero h1 > span:first-of-type {
    color: var(--purple);
}

.hero-spark {
    display: inline-block;
    color: #e6c900;
    font-size: 0.52em;
    vertical-align: top;
    transform: translate(4px, -12px) rotate(12deg);
}

.hero-description {
    max-width: 560px;
    margin: 18px auto 28px;
    color: var(--muted);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.7;
}

/* Search */
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 8px;
    background: var(--surface);
    border: 1px solid #e6e0f5;
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(78, 54, 139, 0.10);
}

.search-container {
    position: relative;
}

.search-icon {
    padding-left: 13px;
    color: var(--purple);
    font-family: Arial, sans-serif;
    font-size: 28px;
    line-height: 1;
    transform: rotate(-20deg);
}

.search-box input {
    flex: 1;
    min-width: 0;
    padding: 15px 8px;
    color: var(--ink);
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
}

.search-box input::placeholder {
    color: #aaa5b8;
    font-weight: 600;
}

.search-box:focus-within {
    border-color: #c4adff;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.10), 0 14px 35px rgba(78, 54, 139, 0.11);
}

.search-box button {
    min-height: 48px;
    padding: 0 24px;
    color: #29230a;
    background: var(--yellow);
    border: 0;
    border-radius: 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 5px 0 #e4cd00;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-box button span {
    margin-left: 3px;
}

.search-box button:hover {
    background: #ffed45;
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #e4cd00;
}

.search-box button:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #e4cd00;
}

.search-box button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.hero-hint {
    margin-top: 16px;
    color: #9892a9;
    font-size: 12px;
    font-weight: 700;
}

.hero-hint span {
    color: #d8bd00;
}

/* Autocomplete */
.suggestions {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    z-index: 9999;
    display: none;
    width: 100%;
    max-height: 280px;
    overflow-y: auto;
    padding: 7px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(48, 35, 88, 0.16);
    text-align: left;
}

.suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    color: var(--ink);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    transition: background 0.15s ease;
}

.suggestion-item:hover {
    background: var(--purple-light);
}

.suggestion-item small {
    flex-shrink: 0;
    padding: 4px 8px;
    color: var(--purple-dark);
    background: #f4f0ff;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 800;
}

.suggestions::-webkit-scrollbar {
    width: 7px;
}

.suggestions::-webkit-scrollbar-thumb {
    background: #d5c8f7;
    border: 2px solid white;
    border-radius: 10px;
}

/* Results section */
.results-container {
    margin: 0 0 72px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    text-align: left;
}

.results-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.section-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--purple);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.5px;
}

.results-title {
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 23px;
    font-weight: 900;
    letter-spacing: -0.7px;
}

.results-title span {
    color: #e4c600;
    font-size: 17px;
}

.results-note {
    padding: 7px 11px;
    color: #5e806f;
    background: #e7fbf1;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

/* Filters */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-container input,
.filter-container select {
    min-width: 0;
    min-height: 43px;
    padding: 10px 13px;
    color: var(--ink);
    background: #fbfaff;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
}

.filter-container input {
    flex: 1 1 220px;
}

.filter-container input::placeholder {
    color: #aaa5b8;
}

.filter-container select {
    flex: 0 1 auto;
    cursor: pointer;
}

.filter-container input:focus,
.filter-container select:focus {
    border-color: #b99cff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.09);
}

/* Result cards generated by the existing script.js */
#resultList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.result-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 17px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.result-card:hover {
    border-color: #cbb8ff;
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.result-card > div {
    min-width: 0;
}

.result-card h4 {
    margin-bottom: 7px;
    overflow-wrap: anywhere;
    color: var(--purple-dark);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 900;
}

.result-card p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}

.result-card p:nth-of-type(2) {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    color: #554500;
    background: var(--yellow-soft);
    border-radius: 7px;
    font-weight: 900;
}

.result-card p:nth-of-type(3) {
    color: #579477;
}

.result-card button {
    flex-shrink: 0;
    align-self: center;
    padding: 9px 12px;
    color: var(--purple-dark);
    background: var(--purple-light);
    border: 0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.18s ease;
}

.result-card button:hover {
    color: #29230a;
    background: var(--yellow);
    transform: translateY(-2px);
}

.empty {
    grid-column: 1 / -1;
    padding: 32px 16px;
    color: var(--muted);
    background: #fbfaff;
    border: 1px dashed #dcd3f1;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

/* Footer */
footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    padding: 23px 6%;
    color: #918ba3;
    background: rgba(255, 255, 255, 0.68);
    border-top: 1px solid var(--line);
    font-size: 12px;
    font-weight: 800;
}

.footer-bolt {
    color: #d8bd00;
}

.footer-note {
    margin-left: 5px;
    color: #aaa5b8;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 700px) {
    .site-nav {
        min-height: 68px;
        padding: 13px 5%;
    }

    .brand {
        font-size: 20px;
    }

    .site-nav a {
        padding: 9px 12px;
        font-size: 11px;
    }

    main {
        width: 92%;
    }

    .hero {
        margin: 58px auto 42px;
    }

    .hero h1 {
        font-size: clamp(35px, 9vw, 48px);
        letter-spacing: -2px;
    }

    .hero-description {
        max-width: 440px;
        font-size: 14px;
    }

    .results-container {
        padding: 20px 16px;
        border-radius: 19px;
    }

    .results-heading {
        align-items: start;
    }

    .results-note {
        display: none;
    }

    #resultList {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .site-nav {
        gap: 8px;
    }

    .site-nav a {
        gap: 5px;
        padding: 8px 10px;
        font-size: 10px;
    }

    .hero {
        margin-top: 45px;
    }

    .hero-badge {
        font-size: 9px;
    }

    .hero-description {
        padding: 0 5px;
        font-size: 13px;
    }

    .search-box {
        display: grid;
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 4px;
        padding: 8px;
        border-radius: 16px;
    }

    .search-icon {
        padding-left: 5px;
    }

    .search-box input {
        padding: 12px 5px;
        font-size: 13px;
    }

    .search-box button {
        grid-column: 1 / -1;
        min-height: 44px;
        margin-top: 4px;
    }

    .filter-container {
        flex-direction: column;
    }

    .filter-container input,
    .filter-container select {
        width: 100%;
        flex: 1 1 auto;
    }

    .result-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .result-card button {
        align-self: stretch;
        padding: 11px;
    }

    footer {
        font-size: 11px;
    }

    .footer-note {
        width: 100%;
        margin-left: 0;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* SEARCH CONTAINER */
.search-container {
    position: relative;
}

.search-area {
    width: min(1080px, calc(100% - 40px));
    margin: 40px auto 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

/* SEARCH HISTORY */
#searchHistory {
    display: block !important;
    position: static !important;

    width: 100%;
    box-sizing: border-box;
    margin: 0;

    padding: 20px;
    background: #fff;
    border: 1px solid #e8e5f2;
    border-radius: 18px;

    box-shadow: 0 8px 25px rgba(37, 34, 56, 0.08);
    z-index: 1;
}

.search-history.show {
    display: block !important;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 10px;
    color: #252238;
    font-size: 13px;
    font-weight: 600;
}

#clearHistory {
    border: none;
    background: transparent;
    color: #8B5CF6;
    font-size: 12px;
    cursor: pointer;
}

#clearHistory:hover {
    color: #6D28D9;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.2s;
}

.history-item:hover {
    background: #F8F7FF;
}

.history-item-name {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #252238;
    font-size: 13px;
}

.history-item-name i {
    color: #9992AD;
}

.remove-history {
    border: none;
    background: transparent;
    color: #aaa5b8;
    cursor: pointer;
    font-size: 16px;
}

.remove-history:hover {
    color: #EF4444;
}

.history-empty {
    padding: 15px 8px;
    text-align: center;
    color: #9992AD;
    font-size: 12px;
}

#searchResults {
    scroll-margin-top: 25px;
}