@import url('https://fonts.googleapis.com/css2?family=Mulish:wght@400;700&display=swap');

:root {
    --bg-color: #0a0a0a;
    --wrapper-bg: #111111;
    --header-bg: #151515;
    --input-bg: #1b1b1b;
    --icon-bg: #1a1a1a;
    --icon-hover: #2a0b12;
    --icon-active: #3a1019;
    --table-odd: #121212;
    --text-color: #ffffff;
    --text-secondary: #b3b3b3;
    --border-color: #2a2a2a;
    --accent-color: #ff003c;
    --accent-color-soft: #ff1f57;
}

.light-theme {
    --bg-color: #f0f0f0;
    --wrapper-bg: #ffffff;
    --header-bg: #e0e0e0;
    --input-bg: #f5f5f5;
    --icon-bg: #e0e0e0;
    --icon-hover: #d0d0d0;
    --icon-active: #c0c0c0;
    --table-odd: #f5f5f5;
    --text-color: #333333;
    --text-secondary: #666666;
    --border-color: #dddddd;
}

.light-theme .icon img {
    filter: invert(0.8);
}

body {
    margin: 0 !important;
    padding: 0 !important;
    background: var(--bg-color);
    display: block;
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    font-family: 'Mulish', sans-serif;
}

#wrapper {
    width: 100%;
    max-width: 100%;
    background: var(--wrapper-bg);
    min-height: 100vh;
    position: relative;
    transition: background-color 0.3s;
}

header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    background: linear-gradient(90deg, #111111 0%, #1a1a1a 65%, #2a0b12 100%);
    border-bottom: 1px solid rgba(255, 0, 60, 0.18);
    transition: background-color 0.3s;
}

#server-icon {
    width: 68px;
    height: 68px;
    object-fit: contain;
    border-radius: 14px;
    background: #0f0f0f;
    padding: 8px;
    box-shadow: 0 0 0 1px rgba(255, 0, 60, 0.18);
}

#server-name {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

#server-players {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 0, 60, 0.12);
    border: 1px solid rgba(255, 0, 60, 0.25);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

#title {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 28px;
    font-size: 28px;
    flex-grow: 1;
}

header img {
    width: 64px;
}

#server-id,
#server-id-button {
	display: none !important;
}

input {
    width: 168px;
    height: 42px;
    background: #181818;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    text-align: center;
    font-size: 15px;
    outline: 0;
    color: var(--text-color);
    font-family: 'Mulish', sans-serif;
    padding: 4px 14px;
    transition: all 0.25s ease;
}

#server {
    display: none !important;
    gap: 1rem;
    padding: 24px;
}

.icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    background: var(--icon-bg);
    gap: 12px;
    transition: all 0.25s ease;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.icon img {
    width: 20px;
}

.icon:hover {
    background: rgba(255, 0, 60, 0.12);
    border-color: rgba(255, 0, 60, 0.28);
    cursor: pointer;
}

.icon:active {
    background: rgba(255, 0, 60, 0.2);
}

section {
    background: #121212;
    display: flex;
    gap: 16px;
    padding: 18px 28px 24px 28px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.controls-wrapper {
    display: flex;
    gap: 16px;
    flex-grow: 1;
    align-items: center;
}

#search {
    text-align: left;
    flex-grow: 1;
}

#search:focus {
    border-color: rgba(255, 0, 60, 0.35);
    box-shadow: 0 0 0 3px rgba(255, 0, 60, 0.08);
}

.refresh-icon {
    height: 100%;
    width: 64px;
    text-align: right;
    position: relative;
}

.utility-icons {
    display: flex;
    gap: 8px;
}

table {
    font-size: 16px;
    border-spacing: 0;
    width: 100%;
    border-radius: 4px;
}

th {
    width: 100%;
    text-align: left;
}

tr {
    display: flex;
    padding: 16px 28px;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

#table-header,
#favorites-table-header {
    background: #161616 !important;
}

td {
    font-weight: 400;
}

table tr:nth-child(odd) {
    background: #121212;
}

table tr:nth-child(even) {
    background: #0f0f0f;
}

.table-favorite {
    width: 20%;
}

.table-favorite img:hover {
    cursor: pointer;
    opacity: 0.5;
}

.table-favorite img:active {
    opacity: 0.25;
}

.table-no {
    width: 15%;
    color: var(--text-secondary);
}

.table-id {
    width: 15%;
}

.table-name {
    width: 40%;
    word-break: break-all;
}

.table-socials {
    width: 15%;
    display: flex;
    gap: 12px;
    align-items: center;
}

.table-ping {
    width: 15%;
}

.table-socials img:hover {
    cursor: pointer;
    opacity: 0.5;
}

.table-socials img:active {
    opacity: 0.25;
}

.table-footer {
    display: flex;
    justify-content: center;
    text-align: center;
}

.table-footer a {
    text-decoration: underline;
    color: var(--text-color);
}

/* Loading animation */
.loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    justify-content: center;
    align-items: center;
}

.loader-spinner {
    border: 5px solid var(--icon-bg);
    border-top: 5px solid var(--accent-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Favorites dropdown */
#favorites-button {
    position: relative;
}

#favorites-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    background: var(--wrapper-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    border-radius: 4px;
    padding: 8px 0;
}

#favorites-menu.show {
    display: block;
}

.favorites-section {
    padding: 8px;
}

.favorites-section h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: var(--text-color);
    padding: 0 8px;
}

.favorites-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.favorites-section li {
    margin-bottom: 4px;
    width: 100%;
}

.favorite-item {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-color);
    padding: 8px 12px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: 'Mulish', sans-serif;
    font-size: 14px;
    transition: background 0.2s ease;
}

.favorite-item:hover {
    background: var(--icon-hover);
}

.favorite-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.server-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    flex-shrink: 0;
}

.favorite-player {
    padding: 4px 8px;
    display: block;
}

.no-favorites {
    padding: 16px;
    color: var(--text-secondary);
    text-align: center;
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.notification {
    background: var(--header-bg);
    color: var(--text-color);
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    max-width: 400px;
}

.notification.success {
    border-left: 4px solid #4CAF50;
}

.notification.error {
    border-left: 4px solid #F44336;
}

.notification.info {
    border-left: 4px solid #2196F3;
}

.notification.warning {
    border-left: 4px solid #FF9800;
}

.close-notification {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    margin-left: 10px;
    opacity: 0.5;
}

.close-notification:hover {
    opacity: 1;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    #wrapper {
        width: 100%;
    }

    header {
        gap: 12px;
        align-items: flex-start;
        flex-direction: column;
    }

    #title {
        padding: 24px 24px 0 24px;
    }

    #server {
        padding: 0 24px 24px 24px;
    }

    tr {
        padding: 16px;
    }

    .table-container {
        width: 100%;
        overflow-x: auto;
        border-radius: 16px;
        background: #111111;
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    table {
        font-size: 15px;
        border-spacing: 0;
        width: 100%;
        border-radius: 16px;
    }
}

@media (max-width: 600px) {
    #title {
        flex-direction: column;
        align-items: flex-start;
    }

    section {
        flex-direction: column;
    }

    .controls-wrapper {
        width: 100%;
    }

    #search {
        width: calc(100% - 24px);
        /* Account for padding */
    }

    .utility-icons {
        justify-content: center;
        width: 100%;
    }

    .icon {
        flex: 1;
    }
}

a {
    text-decoration: none;
}

/* Server history list */
#history-menu {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 100;
    background: var(--wrapper-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    border-radius: 4px;
    padding: 8px 0;
}

#history-menu.show {
    display: block;
}

/* Tabs for statistics */
.tabs {
    display: flex;
    margin: 0 28px;
    border-bottom: 1px solid var(--border-color);
}

.tab {
    padding: 14px 24px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-weight: 700;
    transition: all 0.2s ease;
}

.tab:hover {
    color: #ffffff;
}

.tab.active {
    border-bottom: 2px solid var(--accent-color);
    color: #ffffff;
    font-weight: 800;
}

.tab-content {
    padding: 24px;
    display: none;
}

.tab-content.active {
    display: block;
}

.chart-container {
    width: 100%;
    height: 300px;
    margin-bottom: 24px;
}


.table-ping{
    display: flex;
    align-items: center;
    gap: 4px;
}