/* Fonts are loaded via <link> in each page's <head> (faster than @import). */

* {
    font-family: "Exo 2", sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow: hidden;
    background: #151617;
    color: #fff;
    height: 100%;
}

body {
    padding: 0;
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

::selection {
    background: #9d8140;
    color: #000;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #151617; }
::-webkit-scrollbar-thumb { background: #9d8140; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #b89750; }

main {
    margin-inline: auto;
    width: 100%;
    max-width: 850px;
    margin-top: 4rem;
    padding: 0 2rem;
    flex: 1;
}

.search-container {
    width: 100%;
    margin: 0 auto;
    padding: 2rem 0;
}

.search-title {
    font-size: 1.4rem;
    font-weight: 600;
    text-align: left;
    color: #fff;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-box {
    position: relative;
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.platform-placeholder {
    width: 48px;
    flex-shrink: 0;
    position: relative;
}

.platform-selector {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    padding: 0;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: flex-start;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
}

.platform-selector.expanded { height: auto; }

.platform-btn {
    width: 100%;
    height: 48px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #3a3a3a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.platform-btn:first-child { border-radius: 4px 4px 0 0; }
.platform-btn:last-child { border-radius: 0 0 4px 4px; border-bottom: none; }
.platform-btn:only-child { border-radius: 4px; border-bottom: none; }

.platform-btn.hidden {
    height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    border-bottom: none;
    visibility: hidden;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.platform-btn:hover { background: rgba(255, 255, 255, 0.05); }
.platform-btn img { width: 24px; height: 24px; object-fit: contain; filter: invert(1) brightness(1); transition: filter 0.2s ease; }
.platform-btn:hover img { filter: invert(1) brightness(1.1); }
.platform-btn.active { background: transparent; }
.platform-btn.active img { filter: invert(1) brightness(1); }

.search-input-wrapper { flex: 1; position: relative; }

.search-input {
    width: 100%;
    height: 48px;
    padding: 0 1rem;
    font-family: "Exo 2", sans-serif;
    font-size: 16px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #fff;
    border-radius: 4px;
    transition: all 0.15s ease;
    font-weight: 400;
}
.search-input::placeholder { color: #777; }
.search-input:focus { outline: none; border-color: #4a4a4a; background: #2a2a2a; }

.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: #242424;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.search-results.show { display: block; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.2rem;
    text-decoration: none;
    color: #fff;
    transition: background 0.15s ease;
    border-bottom: 1px solid #3a3a3a;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #2e2e2e; }

.search-result-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #151617;
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-result-avatar img { width: 100%; object-fit: cover; }
.search-result-avatar svg { width: 20px; height: 20px; color: #666; }

.search-result-level {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: hsl(37, 52%, 65%);
    color: #000;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.search-result-username { font-size: 0.95rem; font-weight: 500; color: #fff; flex: 1; min-width: 0; }

.search-result-actions { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }

.search-ban-badge {
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    background: rgba(239, 68, 68, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(239, 68, 68, 0.3);
    text-transform: uppercase;
}

.search-notadded-badge {
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    background: rgba(168, 138, 69, 0.12);
    color: #c9a84c;
    border: 1px solid rgba(168, 138, 69, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.search-result-notadded {
    opacity: 0.7;
}
.search-result-notadded:hover {
    opacity: 1;
}

.search-result-arrow {
    font-size: 1.3rem;
    color: #666;
    transition: all 0.15s ease;
}
.search-result-item:hover .search-result-arrow { color: #9d8140; transform: translateX(3px); }

.no-results { padding: 2.5rem; text-align: center; color: #999; font-size: 0.95rem; }
.no-results-hint { font-size: 0.8rem; opacity: 0.6; display: inline-block; margin-top: 0.4rem; }

.search-live-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    color: #888;
    font-size: 0.82rem;
    border-top: 1px solid #3a3a3a;
}

.search-live-loading .loader-spinner {
    width: 14px;
    height: 14px;
    border-width: 2px;
    flex-shrink: 0;
}

.recently-visited { margin-top: 0.75rem; }

.recently-visited-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.clear-recents-btn {
    font-size: 0.85rem;
    color: #999;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
    opacity: 0;
    pointer-events: none;
    font-weight: 400;
    white-space: nowrap;
}
.recently-visited:hover .clear-recents-btn { opacity: 1; pointer-events: auto; }
.clear-recents-btn:hover { color: #ff6b6b; }

.recently-visited-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.recent-profile-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.75rem;
    height: 30px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    text-decoration: none;
    color: #ccc;
    transition: all 0.15s ease;
    font-size: 0.65rem;
    box-sizing: border-box;
    vertical-align: middle;
}
.recent-profile-item:hover { background: #333; border-color: #4a4a4a; color: #fff; }

.recent-profile-platform {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    filter: invert(1) brightness(0.7);
    display: block;
    object-fit: contain;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    vertical-align: middle;
    align-self: center;
}
.recent-profile-username {
    font-weight: 500;
    font-size: 0.65rem;
    line-height: 1;
    white-space: nowrap;
    align-self: center;
    position: relative;
    top: 0;
}


@media (max-width: 768px) {
    html { overflow: auto; }
    main { padding: 0 1rem; }
    .search-title { font-size: 1.2rem; text-align: center; margin-bottom: 1rem; }
    .search-box { gap: 0.5rem; }
    .platform-placeholder { width: 48px; }
    .platform-selector { width: 48px; height: 48px; }
    .platform-btn { height: 48px; }
    .search-input-wrapper { flex: 1; }
    .recently-visited-list { flex-direction: column; }
    .recent-profile-item { font-size: 0.85rem; padding: 0.3rem 0.6rem; gap: 0.35rem; }
    .recent-profile-username { font-size: 0.85rem; }
    .recent-profile-platform { width: 11px; height: 11px; }
}