/* 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;
    min-height: 100vh;
}

::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: 700;
    text-align: left;
    color: #fff;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

/* Single platform icon that pops the others out on click. The active icon is
   gold; hovering any icon turns it gold and pops it slightly. */
.platform-placeholder { width: 48px; flex-shrink: 0; }

.platform-selector {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.platform-btn {
    position: relative;
    width: 48px;
    height: 48px;
    background: #1b1b1d;
    border: 1px solid #2a2a2c;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.platform-btn.hidden { display: none; }
.platform-btn img {
    width: 23px;
    height: 23px;
    object-fit: contain;
    filter: invert(1) brightness(0.85);
    transition: filter 0.15s ease, transform 0.15s ease;
}
.platform-btn:hover { background: #212124; border-color: #3a3a40; }
.platform-btn:hover img {
    filter: brightness(0) saturate(100%) invert(78%) sepia(43%) saturate(560%) hue-rotate(1deg) brightness(92%) contrast(90%);
    transform: scale(1.15);
}
.platform-btn.active { background: #242427; border-color: #34343a; }
.platform-btn.active img {
    filter: brightness(0) saturate(100%) invert(78%) sepia(43%) saturate(560%) hue-rotate(1deg) brightness(92%) contrast(90%);
}

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

.search-input {
    width: 100%;
    height: 48px;
    padding: 0 2.8rem 0 1.1rem;
    font-family: "Exo 2", sans-serif;
    font-size: 16px;
    background: #1d1d1f;
    border: 1px solid #2a2a2c;
    color: #fff;
    border-radius: 8px;
    transition: background 0.15s ease, border-color 0.15s ease;
    font-weight: 400;
}
.search-input::placeholder { color: #777; }
.search-input:focus { outline: none; border-color: #3a3a40; background: #202022; }

.search-clear {
    position: absolute;
    top: 0;
    right: 0;
    height: 48px;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #8a8a90;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease;
}
.search-clear:hover { color: #fff; }

.search-results-header {
    padding: 0.6rem 1.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a8a90;
    border-bottom: 1px solid #303034;
}

.search-force-row {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem;
    border-top: 1px solid #303034;
}
.force-search-btn {
    background: none;
    border: none;
    font-family: "Exo 2", sans-serif;
    color: #c8a24e;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.4rem 1.1rem;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}
.force-search-btn:hover { background: rgba(200, 162, 78, 0.1); color: #d8b45e; }

.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: #1c1c1e;
    border: 1px solid #303034;
    border-radius: 8px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.search-results.show { display: block; }

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

.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-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 0.22rem 0.45rem;
    background: #b58f4f;
    color: #16130c;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    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; }
    .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; }
}
/* Recently added accounts (search page) */
.recently-added { margin-top: 2.25rem; }
.recently-added-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #d0d0d3;
    margin-bottom: 0.95rem;
}
.recently-added-title::before {
    content: "";
    width: 4px;
    height: 15px;
    background: #c8a24e;
    border-radius: 2px;
}
.recently-added-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
}
.ra-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 1rem;
    background: #1d1d1f;
    border: 1px solid #2c2c2f;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}
.ra-card:hover { background: #242427; border-color: #3a3a3f; transform: translateY(-2px); }
.ra-avatar {
    width: 48px;
    height: 48px;
    border-radius: 9px;
    overflow: hidden;
    flex-shrink: 0;
    background: #2a2a2e;
    border: 1px solid #363639;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ra-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ra-avatar-default { color: #6a6a70; }
.ra-avatar-default svg { width: 22px; height: 22px; }
.ra-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.ra-name-row { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.ra-name {
    font-size: 0.98rem;
    font-weight: 600;
    color: #ececef;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ra-plat { width: 15px; height: 15px; object-fit: contain; opacity: 0.85; flex-shrink: 0; }
.ra-sub { font-size: 0.75rem; color: #8a8a90; font-weight: 500; }
.ra-sub-ban { color: #ff6b6b; font-weight: 600; }
.ra-ban {
    font-size: 0.64rem;
    font-weight: 700;
    color: #ff6b6b;
    background: rgba(224, 82, 82, 0.12);
    border: 1px solid rgba(224, 82, 82, 0.3);
    border-radius: 4px;
    padding: 0.05rem 0.4rem;
    width: fit-content;
}
.ra-arrow { color: #6a6a70; font-size: 1rem; flex-shrink: 0; transition: color 0.14s ease, transform 0.14s ease; }
.ra-card:hover .ra-arrow { color: #c8a24e; transform: translateX(2px); }
@media (max-width: 640px) {
    .recently-added { margin-top: 1.75rem; }
    .recently-added-title { font-size: 0.82rem; margin-bottom: 0.75rem; }
    .recently-added-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .ra-card { padding: 0.5rem 0.6rem; gap: 0.55rem; border-radius: 9px; }
    .ra-avatar { width: 38px; height: 38px; border-radius: 7px; }
    .ra-name { font-size: 0.82rem; }
    .ra-plat { width: 13px; height: 13px; }
    .ra-sub { font-size: 0.68rem; }
}
@media (max-width: 640px) {
    .ra-info { gap: 0.05rem; }
    .ra-name { max-width: 100%; }
}
@media (max-width: 330px) {
    .recently-added-grid { grid-template-columns: 1fr; }
}
