/* =========================================================
   CENCRAFT — BUNGEETRACK
   ========================================================= */


/* =========================================================
   GLOBAL
   ========================================================= */

.bt-dashboard,
.bt-connections,
.bungeetrack-search,
.bungeetrack-table,
.bt-player-panel {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    box-sizing: border-box;
}

.bt-dashboard *,
.bt-connections *,
.bungeetrack-table * {
    box-sizing: border-box;
}


/* =========================================================
   DASHBOARD
   ========================================================= */

.bt-dashboard {
    width: 100%;
    margin: 0 0 34px;
}


/* =========================================================
   DASHBOARD HEADER
   ========================================================= */

.bt-dashboard-header {
    margin: 0 0 22px;
}

.bt-dashboard-eyebrow {
    display: block !important;

    margin: 0 0 6px !important;
    padding: 0 !important;

    color: #22c5ff !important;

    font-size: 11px !important;
    font-weight: 700 !important;

    line-height: 1.4 !important;

    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
}

.bt-dashboard-title {
    margin: 0 !important;
    padding: 0 !important;

    color: #f8fafc !important;

    font-size: 26px !important;
    font-weight: 700 !important;

    line-height: 1.2 !important;

    letter-spacing: -0.025em !important;
}


/* =========================================================
   STAT GRID
   ========================================================= */

.bt-dashboard-stats {
    width: 100%;

    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;

    gap: 16px !important;

    margin: 0 !important;
    padding: 0 !important;
}


/* =========================================================
   STAT CARD
   ========================================================= */

.bt-dashboard-stat {
    position: relative !important;

    display: flex !important;
    flex-direction: column !important;

    min-width: 0 !important;
    min-height: 155px !important;

    margin: 0 !important;
    padding: 24px !important;

    background:
        radial-gradient(
            circle at top left,
            rgba(34, 197, 255, 0.08),
            transparent 45%
        ),
        #0b1118 !important;

    border: 1px solid #1e293b !important;
    border-radius: 14px !important;

    overflow: hidden !important;

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease !important;
}

.bt-dashboard-stat::before {
    content: "";

    position: absolute;

    top: 0;
    left: 24px;

    width: 48px;
    height: 2px;

    background: #22c5ff;

    box-shadow:
        0 0 12px rgba(34, 197, 255, 0.55);
}

.bt-dashboard-stat:hover {
    transform: translateY(-2px);

    border-color: rgba(34, 197, 255, 0.45) !important;

    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.2),
        0 0 22px rgba(34, 197, 255, 0.05) !important;
}


/* =========================================================
   STAT CONTENT
   ========================================================= */

.bt-dashboard-stat-label {
    display: block !important;

    margin: 0 0 12px !important;
    padding: 0 !important;

    color: #94a3b8 !important;

    font-size: 11px !important;
    font-weight: 700 !important;

    line-height: 1.4 !important;

    letter-spacing: 0.09em !important;
    text-transform: uppercase !important;
}

.bt-dashboard-stat-value {
    display: block !important;

    margin: 0 !important;
    padding: 0 !important;

    color: #f8fafc !important;

    font-size: 34px !important;
    font-weight: 700 !important;

    line-height: 1 !important;

    letter-spacing: -0.035em !important;
}

.bt-dashboard-stat-description {
    display: block !important;

    margin: auto 0 0 !important;
    padding: 16px 0 0 !important;

    color: #64748b !important;

    font-size: 12px !important;
    font-weight: 400 !important;

    line-height: 1.5 !important;
}


/* =========================================================
   CONNECTIONS
   ========================================================= */

.bt-connections {
    width: 100%;
}


/* =========================================================
   SEARCH
   ========================================================= */

.bungeetrack-search {
    width: 100%;

    display: flex !important;
    align-items: center !important;

    gap: 10px !important;

    margin: 0 0 18px !important;
    padding: 0 !important;
}


/* Search field wrapper */

.bt-search-field {
    position: relative;

    display: flex;
    align-items: center;

    flex: 1;

    min-width: 0;
}


/* Search icon */

.bt-search-icon {
    position: absolute;

    left: 15px;

    width: 18px !important;
    height: 18px !important;

    display: block !important;

    margin: 0 !important;
    padding: 0 !important;

    fill: none !important;

    stroke: #64748b !important;
    stroke-width: 2 !important;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;

    z-index: 2;
}


/* Search input */

.bungeetrack-search input[type="text"] {
    width: 100% !important;
    height: 46px !important;

    margin: 0 !important;
    padding: 0 16px 0 44px !important;

    background: #0b1118 !important;

    border: 1px solid #1e293b !important;
    border-radius: 10px !important;

    box-shadow: none !important;

    color: #f8fafc !important;

    font-family: inherit !important;
    font-size: 14px !important;

    line-height: normal !important;

    outline: none !important;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.bungeetrack-search input[type="text"]::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
}

.bungeetrack-search input[type="text"]:hover {
    border-color: #334155 !important;
}

.bungeetrack-search input[type="text"]:focus {
    background: #0d141c !important;

    border-color: #22c5ff !important;

    box-shadow:
        0 0 0 3px rgba(34, 197, 255, 0.08),
        0 0 18px rgba(34, 197, 255, 0.05) !important;
}

.bt-search-field:focus-within .bt-search-icon {
    stroke: #22c5ff !important;
}


/* =========================================================
   SEARCH BUTTON
   ========================================================= */

.bungeetrack-search button[type="submit"] {
    width: auto !important;
    min-width: 108px !important;
    height: 46px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    margin: 0 !important;
    padding: 0 22px !important;

    background: #22c5ff !important;

    border: 1px solid #22c5ff !important;
    border-radius: 10px !important;

    box-shadow: none !important;

    color: #050a10 !important;

    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 700 !important;

    line-height: 1 !important;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.bungeetrack-search button[type="submit"]:hover {
    background: #38d3ff !important;
    border-color: #38d3ff !important;

    color: #050a10 !important;

    transform: translateY(-1px);

    box-shadow:
        0 5px 18px rgba(34, 197, 255, 0.15) !important;
}

.bungeetrack-search button[type="submit"]:active {
    transform: translateY(0);

    box-shadow: none !important;
}


/* =========================================================
   PLAYER PANEL
   ========================================================= */

.bt-player-panel {
    width: 100%;

    background: #0b1118;

    border: 1px solid #1e293b;
    border-radius: 14px;

    overflow: hidden;
}


/* =========================================================
   PLAYER PANEL HEADER
   ========================================================= */

.bt-player-panel-header {
    min-height: 54px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 0 20px;

    background: #111827;

    border-bottom: 1px solid #1e293b;
}

.bt-player-panel-title {
    margin: 0 !important;

    color: #94a3b8 !important;

    font-size: 11px !important;
    font-weight: 700 !important;

    line-height: 1 !important;

    letter-spacing: 0.09em !important;
    text-transform: uppercase !important;
}

.bt-player-panel-total {
    margin: 0 !important;

    color: #64748b !important;

    font-size: 11px !important;
    font-weight: 700 !important;

    line-height: 1 !important;

    letter-spacing: 0.07em !important;
    text-transform: uppercase !important;
}


/* =========================================================
   PLAYER
   ========================================================= */

.bt-player {
    width: 100%;

    margin: 0 !important;
    padding: 0 !important;

    background: #0b1118;

    border-bottom: 1px solid rgba(30, 41, 59, 0.8);
}

.bt-player:last-child {
    border-bottom: 0;
}


/* =========================================================
   PLAYER ROW
   ========================================================= */

.bt-player-row {
    width: 100% !important;
    min-height: 62px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;

    gap: 20px !important;

    margin: 0 !important;
    padding: 0 20px !important;

    appearance: none !important;
    -webkit-appearance: none !important;

    background: #0b1118 !important;

    border: 0 !important;
    border-radius: 0 !important;

    box-shadow: none !important;

    color: #f8fafc !important;

    font-family: inherit !important;

    text-align: left !important;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.bt-player-row:hover {
    background: #111923 !important;
}

.bt-player-row:focus {
    outline: none !important;
}

.bt-player-row:focus-visible {
    position: relative;

    outline: 1px solid #22c5ff !important;
    outline-offset: -2px !important;

    z-index: 2;
}


/* =========================================================
   PLAYER MAIN
   ========================================================= */

.bt-player-main {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 12px;
}

.bt-player-name {
    overflow: hidden;

    color: #f8fafc !important;

    font-size: 14px !important;
    font-weight: 600 !important;

    line-height: 1.4 !important;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   CHEVRON
   ========================================================= */

.bt-chevron {
    width: 26px;
    height: 26px;

    flex: 0 0 26px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: rgba(148, 163, 184, 0.06);

    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 7px;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.bt-chevron svg {
    width: 14px !important;
    height: 14px !important;

    display: block !important;

    margin: 0 !important;
    padding: 0 !important;

    fill: none !important;

    stroke: #94a3b8 !important;
    stroke-width: 2 !important;
    stroke-linecap: round;
    stroke-linejoin: round;

    transition:
        transform 0.2s ease,
        stroke 0.15s ease;
}

.bt-player-row:hover .bt-chevron {
    background: rgba(34, 197, 255, 0.07);

    border-color: rgba(34, 197, 255, 0.18);
}

.bt-player-row:hover .bt-chevron svg {
    stroke: #22c5ff !important;
}


/* Rotate when open */

.bt-player.is-open .bt-chevron svg {
    transform: rotate(90deg);

    stroke: #22c5ff !important;
}

.bt-player.is-open .bt-chevron {
    background: rgba(34, 197, 255, 0.08);

    border-color: rgba(34, 197, 255, 0.2);
}


/* =========================================================
   CONNECTION BADGE
   ========================================================= */

.bt-connection-badge {
    flex-shrink: 0;

    display: inline-flex;
    align-items: center;

    gap: 5px;

    margin: 0 !important;
    padding: 6px 10px !important;

    background: #111827;

    border: 1px solid #1e293b;
    border-radius: 999px;

    line-height: 1 !important;
}

.bt-connection-number {
    color: #f8fafc !important;

    font-size: 12px !important;
    font-weight: 700 !important;
}

.bt-connection-label {
    color: #64748b !important;

    font-size: 11px !important;
    font-weight: 500 !important;
}


/* =========================================================
   OPEN PLAYER
   ========================================================= */

.bt-player.is-open > .bt-player-row {
    background: #0e1620 !important;
}

.bt-player.is-open .bt-player-name {
    color: #22c5ff !important;
}


/* =========================================================
   EXPANDED CONNECTIONS
   ========================================================= */

.bt-player-connections {
    width: 100%;

    margin: 0 !important;
    padding: 0 !important;

    background: #080e14;

    border-top: 1px solid rgba(30, 41, 59, 0.7);
}

.bt-player-connections[hidden] {
    display: none !important;
}


/* =========================================================
   CONNECTION TABLE
   ========================================================= */

.bt-connection-table {
    width: 100%;

    padding: 0 20px 14px 58px;
}


/* =========================================================
   CONNECTION HEADER
   ========================================================= */

.bt-connection-header {
    display: grid;

    grid-template-columns:
        minmax(180px, 0.8fr)
        minmax(240px, 1.4fr)
        minmax(210px, 0.8fr);

    gap: 20px;

    padding: 14px 12px 10px;

    color: #64748b;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}


/* =========================================================
   CONNECTION ROW
   ========================================================= */

.bt-connection-row {
    display: grid;

    grid-template-columns:
        minmax(180px, 0.8fr)
        minmax(240px, 1.4fr)
        minmax(210px, 0.8fr);

    gap: 20px;

    align-items: center;

    min-height: 48px;

    padding: 0 12px;

    border-top: 1px solid rgba(30, 41, 59, 0.55);

    transition: background 0.15s ease;
}

.bt-connection-row:hover {
    background: rgba(17, 24, 39, 0.55);
}


/* IP */

.bt-connection-ip {
    min-width: 0;

    overflow: hidden;

    color: #cbd5e1 !important;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace !important;

    font-size: 12px !important;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Virtual Host */

.bt-connection-host {
    min-width: 0;

    overflow: hidden;

    color: #22c5ff !important;

    font-size: 13px !important;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Time */

.bt-connection-time {
    min-width: 0;

    color: #64748b !important;

    font-size: 12px !important;

    white-space: nowrap;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.bt-empty-state {
    padding: 48px 24px;

    text-align: center;
}

.bt-empty-title {
    margin: 0 0 6px !important;

    color: #f8fafc !important;

    font-size: 14px !important;
    font-weight: 600 !important;
}

.bt-empty-description {
    margin: 0 !important;

    color: #64748b !important;

    font-size: 12px !important;
}


/* =========================================================
   LOCATIONS TABLE
   ========================================================= */

.bungeetrack-table {
    width: 100%;

    margin: 0 0 28px !important;

    border-collapse: separate !important;
    border-spacing: 0 !important;

    background: #0b1118 !important;

    border: 1px solid #1e293b !important;
    border-radius: 14px !important;

    overflow: hidden;

    color: #f8fafc !important;

    font-size: 14px;
}

.bungeetrack-table thead {
    background: #111827 !important;
}

.bungeetrack-table th {
    padding: 13px 16px !important;

    background: #111827 !important;

    border: 0 !important;
    border-bottom: 1px solid #1e293b !important;

    color: #94a3b8 !important;

    text-align: left !important;

    font-size: 11px !important;
    font-weight: 700 !important;

    letter-spacing: 0.07em !important;
    text-transform: uppercase !important;
}

.bungeetrack-table td {
    padding: 14px 16px !important;

    background: transparent;

    border: 0 !important;
    border-bottom: 1px solid rgba(30, 41, 59, 0.8) !important;

    color: #cbd5e1 !important;

    font-size: 14px;

    vertical-align: middle !important;
}

.bungeetrack-table tbody tr:last-child td {
    border-bottom: 0 !important;
}

.bungeetrack-table tbody tr {
    transition: background 0.15s ease;
}

.bungeetrack-table tbody tr:hover td {
    background: #111923 !important;
}

.bungeetrack-table td[colspan] {
    color: #64748b !important;
}


/* =========================================================
   TEXT SELECTION
   ========================================================= */

.bt-dashboard ::selection,
.bt-connections ::selection,
.bungeetrack-table ::selection {
    background: rgba(34, 197, 255, 0.25);

    color: #f8fafc;
}


/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 900px) {

    .bt-dashboard-stats {
        grid-template-columns: 1fr !important;
    }

    .bt-dashboard-stat {
        min-height: 135px !important;
    }

    .bt-connection-table {
        padding-left: 20px;
    }

    .bt-connection-header,
    .bt-connection-row {
        grid-template-columns:
            minmax(140px, 0.8fr)
            minmax(180px, 1.2fr)
            minmax(180px, 1fr);
    }

}


/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 700px) {

    /* Dashboard */

    .bt-dashboard-title {
        font-size: 22px !important;
    }

    .bt-dashboard-stat-value {
        font-size: 30px !important;
    }


    /* Search */

    .bungeetrack-search {
        flex-direction: column !important;

        align-items: stretch !important;
    }

    .bungeetrack-search button[type="submit"] {
        width: 100% !important;
    }


    /* Player panel */

    .bt-player-panel-header {
        min-height: 50px;

        padding: 0 16px;
    }

    .bt-player-row {
        min-height: 60px !important;

        padding: 0 16px !important;
    }

    .bt-player-name {
        font-size: 13px !important;
    }

    .bt-connection-label {
        display: none;
    }


    /* Expanded connections */

    .bt-connection-table {
        padding: 8px 16px 14px;
    }

    .bt-connection-header {
        display: none;
    }

    .bt-connection-row {
        display: block;

        min-height: 0;

        margin: 8px 0;
        padding: 12px 14px;

        background: #0b1118;

        border: 1px solid #1e293b;
        border-radius: 9px;
    }

    .bt-connection-row:hover {
        background: #0d141c;
    }

    .bt-connection-ip,
    .bt-connection-host,
    .bt-connection-time {
        position: relative;

        display: grid;

        grid-template-columns: 100px 1fr;

        gap: 12px;

        overflow: visible;

        padding: 5px 0;

        white-space: normal;
    }

    .bt-connection-ip::before,
    .bt-connection-host::before,
    .bt-connection-time::before {
        content: attr(data-label);

        color: #64748b;

        font-family:
            Inter,
            -apple-system,
            BlinkMacSystemFont,
            "Segoe UI",
            sans-serif;

        font-size: 9px;
        font-weight: 700;

        letter-spacing: 0.06em;
        text-transform: uppercase;
    }


    /* Location table */

    .bungeetrack-table {
        display: block;

        overflow-x: auto;

        white-space: nowrap;

        -webkit-overflow-scrolling: touch;
    }

}


/* =========================================================
   RESPONSIVE — SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .bt-dashboard-stat {
        min-height: 125px !important;

        padding: 20px !important;
    }

    .bt-dashboard-stat::before {
        left: 20px;
    }

    .bt-dashboard-stat-description {
        padding-top: 12px !important;
    }

    .bt-player-panel-total {
        font-size: 10px !important;
    }

    .bt-chevron {
        width: 24px;
        height: 24px;

        flex-basis: 24px;
    }

    .bt-connection-badge {
        padding: 5px 8px !important;
    }

}