@import "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap";

html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: transparent;
    font-family: "Inter", "Poppins", sans-serif;
    color: #e6e6e6;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    position: relative;
}

.search-shell {
    width: min(960px, 86vw);
    display: flex;
    flex-direction: column;
    gap: 18px;
    transform: translateY(6vh);
    position: relative;
    z-index: 1;
}

.bar-logo {
    width: min(280px, 60vw);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.6px;
}

.bar-logo img {
    height: 96px;
    width: auto;
    display: block;
    opacity: 0.9;
}

.search-suggestions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: min(720px, 70vw);
    margin: 0 auto;
}

.suggestion-card {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #070606e0;
    color: rgba(255, 255, 255, 0.8);
    padding: 16px 18px;
    border-radius: 18px;
    font-size: 18px;
    font-weight: 500;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.suggestion-card:hover {
    background: rgba(30, 30, 30, 0.45);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
}

.suggestion-sub {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 400;
}

.search-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 22px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #070606e0;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 6px 2px 12px;
}

.search-icon {
    color: rgba(255, 255, 255, 0.55);
    font-size: 18px;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: rgba(255, 255, 255, 0.88);
    font-size: 20px;
    font-weight: 400;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

.search-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.left-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    transform: translateY(-1px);
}

.ai-mode {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 500;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ai-mode i {
    font-size: 18px;
}

.ai-mode:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    transform: translateY(-1px);
}

.user-mode {
    color: rgba(255, 255, 255, 0.68);
}

.ai-mode.is-active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.ai-mode.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ai-answer {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(9, 9, 9, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 16px;
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    overflow: hidden;
    transition: max-height 0.45s ease, opacity 0.35s ease, transform 0.35s ease, padding 0.35s ease;
}

.ai-answer.is-open {
    max-height: 720px;
    opacity: 1;
    transform: translateY(0) scale(1);
    padding: 14px 16px 16px;
}

.ai-answer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ai-answer-label {
    font-size: 12px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.ai-answer-clear {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ai-answer-clear:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateY(-1px);
}

.ai-answer-body {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    white-space: pre-wrap;
}

.user-lookup {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(9, 9, 9, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 16px;
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    overflow: hidden;
    transition: max-height 0.45s ease, opacity 0.35s ease, transform 0.35s ease, padding 0.35s ease;
}

.user-lookup.is-open {
    max-height: 720px;
    opacity: 1;
    transform: translateY(0) scale(1);
    padding: 14px 16px 16px;
}

.user-lookup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.user-lookup-label {
    font-size: 12px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.user-lookup-clear {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.user-lookup-clear:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateY(-1px);
}

.user-lookup-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.user-result {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    border-radius: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.user-result:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

.user-result-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.user-result-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.user-result-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.user-result-name {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
}

.user-result-badges {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}

.user-result-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.user-result-bio {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.5;
}

.search-card.is-expanded {
    padding-bottom: 18px;
    gap: 12px;
}

.search-settings-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.98);
    width: min(860px, calc(100vw - 32px));
    padding: 28px 28px 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #070606e0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 20px;
    max-height: min(720px, calc(100vh - 48px));
    overflow-y: auto;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    z-index: 10001;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
}

.search-settings-menu.is-open {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.search-settings-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.search-settings-backdrop.is-open {
    display: block;
    opacity: 1;
}

.settings-title {
    font-size: 22px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

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

.settings-toggle {
    position: relative;
    width: 46px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.settings-toggle input {
    position: absolute;
    opacity: 0;
    width: 46px;
    height: 26px;
    margin: 0;
    cursor: pointer;
}

.settings-toggle-track {
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.settings-toggle-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, background 0.2s ease;
}

.settings-toggle input:checked+.settings-toggle-track {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.45);
}

.settings-toggle input:checked+.settings-toggle-track::after {
    transform: translateX(20px);
    background: #ffffff;
}

.settings-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.settings-inline input[type="number"] {
    width: 88px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 6px 10px;
    font-size: 14px;
}

.settings-suffix {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 720px) {
    .search-shell {
        width: min(92vw, 560px);
        transform: translateY(4vh);
    }

    .search-suggestions {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .search-controls {
        gap: 12px;
        flex-wrap: wrap;
    }

    .left-controls {
        width: 100%;
        justify-content: space-between;
    }

    .ai-mode {
        flex: 1;
        justify-content: center;
    }
}