/* Coin Wiki site search — floating button + full-screen overlay (v1.5.4) */

/* Floating action button: visible on every page */
#cwl-search-fab {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 99990;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #C9A227;
    color: #10151f;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
#cwl-search-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
#cwl-search-fab:active {
    transform: translateY(0);
}
#cwl-search-fab svg {
    width: 26px;
    height: 26px;
}
#cwl-search-fab:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

/* Overlay */
#cwl-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 18px 18px;
}
#cwl-search-overlay[hidden] {
    display: none;
}
.cwl-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 20, 0.82);
    backdrop-filter: blur(3px);
}
.cwl-search-panel {
    position: relative;
    width: 100%;
    max-width: 620px;
    background: #10151f;
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-radius: 18px;
    padding: 34px 28px 30px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
    color: #f2f4f8;
}
.cwl-search-close {
    position: absolute;
    top: 10px;
    right: 14px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #9aa4b5;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}
.cwl-search-close:hover {
    color: #ffffff;
}
.cwl-search-kicker {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: 0.22em;
    color: #C9A227;
    font-weight: 700;
}
.cwl-search-title {
    margin: 0 0 6px;
    font-size: 30px;
    line-height: 1.15;
    color: #ffffff;
}
.cwl-search-sub {
    margin: 0 0 20px;
    font-size: 15px;
    color: #9aa4b5;
}
.cwl-search-form {
    display: flex;
    gap: 10px;
}
#cwl-search-input {
    flex: 1;
    min-width: 0;
    height: 58px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #1a2231;
    color: #ffffff;
    font-size: 18px;
    padding: 0 16px;
}
#cwl-search-input::placeholder {
    color: #6b7688;
}
#cwl-search-input:focus {
    outline: none;
    border-color: #C9A227;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.25);
}
.cwl-search-go {
    height: 58px;
    padding: 0 26px;
    border: none;
    border-radius: 12px;
    background: #C9A227;
    color: #10151f;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.cwl-search-go:hover {
    background: #d9b545;
}
.cwl-search-go:focus-visible,
#cwl-search-input:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}
.cwl-search-popular-label {
    margin: 22px 0 10px;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6b7688;
}
.cwl-search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.cwl-search-chip {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: transparent;
    color: #dfe4ec;
    font-size: 15px;
    cursor: pointer;
}
.cwl-search-chip:hover {
    border-color: #C9A227;
    color: #ffffff;
}

/* Small screens: stack the form, keep targets big */
@media (max-width: 520px) {
    #cwl-search-overlay {
        padding: 8vh 14px 14px;
    }
    .cwl-search-panel {
        padding: 28px 20px 24px;
    }
    .cwl-search-form {
        flex-direction: column;
    }
    .cwl-search-go {
        width: 100%;
    }
}

/* Live suggestions */
.cwl-search-suggest {
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    background: #0d1420;
    max-height: 340px;
    overflow-y: auto;
}
.cwl-search-suggest[hidden] {
    display: none;
}
.cwl-suggest-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 60px;
}
.cwl-suggest-row:last-child {
    border-bottom: none;
}
.cwl-suggest-row:hover,
.cwl-suggest-row.cwl-suggest-active {
    background: rgba(201, 162, 39, 0.1);
}
.cwl-suggest-face {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
    background: #17181c;
    border: 1px solid rgba(201, 162, 39, 0.35);
}
.cwl-suggest-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cwl-suggest-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.cwl-suggest-title {
    font-size: 15px;
    font-weight: 600;
    color: #f2f4f8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cwl-suggest-country {
    font-size: 12px;
    color: #6b7688;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Header nav search button: desktop only (FAB covers mobile) */
.cwl-nav-search-item {
    display: none;
}
@media (min-width: 782px) {
    .cwl-nav-search-item {
        display: flex;
        align-items: center;
    }
}
.cwl-nav-search-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0.85;
}
.cwl-nav-search-btn:hover {
    opacity: 1;
    color: #C9A227;
}
.cwl-nav-search-btn svg {
    width: 22px;
    height: 22px;
}
