@import "../global.css";

/*Header*/
#header {
    background: url("../../images/header-background.jpg") no-repeat fixed center;
    min-width: 100%;
    min-height: 300px;
    background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    -webkit-background-size: cover;
    z-index: 0;
    display: flex;
    align-items: center;
}

#header .content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 100px 150px;
    width: 100%;
    text-align: center;
}

#header .content .info .title {
    color: var(--white-color);
    text-transform: uppercase;
    font-size: 45px;
    font-weight: 800;
    white-space: nowrap;
}

#header .content .info .title span {
    color: var(--main-color);
}

#header .content .description {
    color: var(--description-color);
    font-size: 18px;
    margin-top: 20px;
    max-width: 600px;
}

/*Server List*/
#server-list {
    padding: 20px 0 60px 0;
}

#server-list .content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.servers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.server-card {
    background: rgba(210, 208, 208, 0.05);
    border-radius: 12px;
    padding: 30px;
    min-height: 450px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.server-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--main-color), #4a85ff);
}

/* 服务器头部布局 */
.server-header {
    margin-bottom: 20px;
    text-align: center;
}

.server-info {
    width: 100%;
}

.server-title {
    color: var(--white-color);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
}

.server-version {
    color: var(--description-color);
    font-size: 14px;
    background: rgba(57, 190, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 500;
}

.server-stats-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.server-stats-compact .stat-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.server-stats-compact .stat-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.server-stats-compact .stat-item i {
    font-size: 20px;
    color: var(--main-color);
    width: 32px;
    height: 32px;
    background: rgba(57, 190, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.server-stats-compact .stat-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.server-stats-compact .stat-label {
    color: var(--description-color);
    font-size: 12px;
    margin-bottom: 2px;
}

.server-stats-compact .stat-value {
    color: var(--white-color);
    font-size: 16px;
    font-weight: 600;
}

/* 服务器详细信息 */
.server-details {
    margin-bottom: 20px;
}

.server-ips {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    border-left: 3px solid var(--main-color);
}

.ip-item {
    color: var(--description-color);
    font-size: 14px;
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ip-item i {
    color: var(--main-color);
    font-size: 14px;
    width: 16px;
}

.server-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}

/* 统一按钮样式 - QQ群按钮格式 */
.server-actions .download-button,
.server-actions .qq-button,
.server-actions .wiki-button {
    font-family: inherit;
    font-size: 14px;
    background-color: #242a35;
    border: solid 1px #e8e8e82d;
    color: white;
    padding: 0.7em 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    flex: 1;
    min-height: 40px;
}

.server-actions .download-button span,
.server-actions .qq-button span,
.server-actions .wiki-button span {
    display: block;
    margin-left: 0.3em;
    transition: all 0.3s ease-in-out;
}

.server-actions .download-button svg,
.server-actions .qq-button svg,
.server-actions .wiki-button svg {
    display: block;
    transform-origin: center center;
    transition: transform 0.3s ease-in-out;
}

.server-actions .download-button:hover .svg-wrapper,
.server-actions .qq-button:hover .svg-wrapper,
.server-actions .wiki-button:hover .svg-wrapper {
    animation: fly-1 0.6s ease-in-out infinite alternate;
}

.server-actions .download-button:hover svg,
.server-actions .qq-button:hover svg,
.server-actions .wiki-button:hover svg {
    transform: translateX(1.2em) rotate(45deg) scale(1.1);
}

.server-actions .download-button:hover span,
.server-actions .qq-button:hover span,
.server-actions .wiki-button:hover span {
    transform: translateX(5em);
}

.server-actions .download-button:active,
.server-actions .qq-button:active,
.server-actions .wiki-button:active {
    transform: scale(0.95);
}

@keyframes fly-1 {
    from {
        transform: translateY(0.1em);
    }
    to {
        transform: translateY(-0.1em);
    }
}





/* 动画样式 */
.animated-title {
    position: relative;
    animation: fadeInUp 0.8s ease-out;
}

.animated-title:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--main-color);
    animation: lineExpand 1.5s forwards 0.5s;
}

@keyframes lineExpand {
    to { width: 100px; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.server-info-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    padding-bottom: 30px;
}

.server-image-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.3);
    height: auto;
    min-height: 350px;
    position: relative;
    margin-bottom: 10px;
    border-radius: 0;
}

.server-image {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    transition: opacity 0.8s ease;
    opacity: 0.3;
    padding: 10px;
}

.image-error {
    color: #ff6b6b;
    text-align: center;
    padding: 20px;
    font-weight: 500;
}

.server-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 0 30px;
}

/* 诗意描述和特性样式 */
.poetic-desc {
    font-style: italic;
    line-height: 1.8;
    color: var(--white-color);
    margin-bottom: 20px;
    position: relative;
    padding-left: 20px;
    border-left: 3px solid var(--main-color);
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.server-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
    animation: slideUp 0.8s ease-out 0.3s both;
}

.feature-item {
    background: rgba(57, 190, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(57, 190, 255, 0.2);
    background: rgba(57, 190, 255, 0.15);
}

.feature-item i {
    font-size: 24px;
    color: var(--main-color);
    margin-bottom: 10px;
}

.feature-label {
    font-size: 14px;
    color: var(--description-color);
    margin-bottom: 5px;
}

.feature-value {
    font-weight: bold;
    color: var(--white-color);
}

.gameplay-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    animation: slideUp 0.8s ease-out 0.6s both;
}

.tag {
    background: rgba(210, 208, 208, 0.1);
    color: var(--description-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    transition: all 0.3s ease;
    cursor: default;
}

.tag:hover {
    background: var(--main-color);
    color: var(--white-color);
    transform: scale(1.05);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 连接信息样式 */
.server-connect-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.connect-box {
    background: rgba(210, 208, 208, 0.05);
    border-radius: 8px;
    padding: 25px;
    transition: all 0.3s ease;
    animation: fadeIn 1s ease-out 0.8s both;
}

.connect-box:hover {
    background: rgba(210, 208, 208, 0.08);
    transform: translateY(-3px);
}

.connect-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.connect-header i {
    color: var(--main-color);
    font-size: 22px;
}

.connect-header h3 {
    color: var(--white-color);
    font-size: 18px;
    font-weight: 600;
}

.qq-number {
    color: var(--description-color);
    margin: 12px 0;
    font-size: 16px;
}

.qq-number span {
    color: var(--white-color);
    font-weight: 600;
    background: rgba(57, 190, 255, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 5px;
}

.ip-info {
    margin-bottom: 15px;
}

.ip {
    color: var(--description-color);
    margin: 8px 0;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ip i {
    color: var(--main-color);
    font-size: 14px;
}

.server-status {
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid rgba(210, 208, 208, 0.1);
    border-bottom: 1px solid rgba(210, 208, 208, 0.1);
}

.server-status p {
    color: var(--description-color);
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.server-status p i {
    color: var(--main-color);
    font-size: 14px;
}

.status-indicator {
    transition: color 0.3s ease;
}

.status-indicator.online {
    color: #4aff6b;
}

.status-indicator.offline {
    color: #ff6b6b;
}

.player-count {
    color: var(--white-color);
    font-weight: 500;
}

.join-button {
    display: inline-block;
    background: var(--main-color);
    color: var(--white-color);
    border: none;
    border-radius: 4px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.join-button:hover {
    background: rgba(57, 190, 255, 0.85);
    transform: translateY(-2px);
}

.join-qq-button {
    background: #12b7f5;
}

.join-qq-button:hover {
    background: rgba(18, 183, 245, 0.85);
}

/* 响应式调整 */
@media screen and (max-width: 1100px) {
    .servers-grid {
        gap: 20px;
    }
}

@media screen and (max-width: 768px) {
    .servers-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    #header .content {
        padding: 80px 30px;
    }

    #header .content .info .title {
        font-size: 36px;
        white-space: normal;
        word-break: keep-all;
    }

    .server-card {
        padding: 25px;
        min-height: 400px;
    }

    .server-title {
        font-size: 20px;
    }

    .server-actions {
        flex-direction: column;
        gap: 10px;
    }

    .server-actions .download-button,
    .server-actions .qq-button,
    .server-actions .wiki-button {
        font-size: 13px;
        padding: 0.6em 0.9em;
        min-height: 36px;
    }
}

@media screen and (max-width: 480px) {
    .server-card {
        padding: 20px;
        min-height: 350px;
    }

    #header .content .info .title {
        font-size: 30px;
        line-height: 1.2;
    }

    #header .content .description {
        font-size: 16px;
    }

    .server-title {
        font-size: 18px;
    }

    .server-actions {
        flex-direction: column;
        gap: 8px;
    }

    .server-actions .download-button,
    .server-actions .qq-button,
    .server-actions .wiki-button {
        font-size: 12px;
        padding: 0.5em 0.8em;
        min-height: 32px;
    }
}

/* 新的服务器数据UI样式 */
.server-data-ui {
    width: 100%;
    margin-bottom: 30px;
}

.server-status-panel {
    background: rgba(36, 39, 43, 0.6);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    animation: fadeIn 0.8s ease-out;
}

.server-status-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.server-status-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.server-icon {
    width: 64px;
    height: 64px;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(57, 190, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid rgba(57, 190, 255, 0.3);
    animation: pulse 2s infinite;
}

.server-icon img {
    max-width: 85%;
    height: auto;
}

.server-basic-info {
    flex: 1;
}

.server-basic-info h3 {
    color: var(--white-color);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.server-basic-info .server-version {
    color: var(--description-color);
    font-size: 14px;
    background: rgba(57, 190, 255, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 500;
}

.server-status-badge {
    padding: 8px 15px;
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ffc107; /* 默认为黄色（加载中） */
    animation: blink 1.5s infinite;
}

.status-dot.online {
    background-color: #4aff6b;
    animation: none;
}

.status-dot.offline {
    background-color: #ff6b6b;
    animation: none;
}

.status-text {
    color: var(--white-color);
    font-size: 14px;
    font-weight: 600;
}

.server-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
}

.stat-item i {
    font-size: 24px;
    color: var(--main-color);
    width: 40px;
    height: 40px;
    background: rgba(57, 190, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: var(--description-color);
    font-size: 13px;
    margin-bottom: 4px;
}

.stat-value {
    color: var(--white-color);
    font-size: 18px;
    font-weight: 600;
}

.server-motd {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--main-color);
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    color: var(--description-color);
    font-style: italic;
    margin-bottom: 25px;
    line-height: 1.5;
}

.player-list-container {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
}

.player-list-header {
    background: rgba(57, 190, 255, 0.1);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.player-list-header h4 {
    color: var(--white-color);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-list-header h4 i {
    color: var(--main-color);
}

.player-list-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-btn {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--description-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white-color);
}

.toggle-btn i {
    transition: transform 0.3s ease;
}

.player-list {
    padding: 15px 20px;
    max-height: 200px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.player-list.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

.player-list .loading-message {
    color: var(--description-color);
    text-align: center;
    padding: 10px;
    grid-column: span 2;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.2s ease;
    min-width: 0;
}

.player-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.player-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-name {
    color: var(--white-color);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 新增占位符样式 */
.no-players {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    grid-column: span 2;
}

.player-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.6;
    margin: 10px 0;
    width: 100%;
}

.sample-player {
    background: rgba(57, 190, 255, 0.1);
    border: 1px dashed rgba(57, 190, 255, 0.3);
    justify-content: center;
    width: 80%;
    padding: 12px;
}

.placeholder-note {
    font-size: 12px;
    color: var(--description-color);
    font-style: italic;
    margin-top: 8px;
}

/* 动画效果 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(57, 190, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(57, 190, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(57, 190, 255, 0);
    }
}

@keyframes blink {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .server-status-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .server-icon {
        margin: 0 auto;
    }
    
    .server-basic-info {
        text-align: center;
        width: 100%;
    }
    
    .server-status-badge {
        margin: 0 auto;
    }
    
    .server-stats {
        grid-template-columns: 1fr;
    }
}

/* 服务器状态和玩家列表水平布局 */
.server-stats-and-players {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.server-stats {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(32, 34, 37, 0.3);
    border-radius: 8px;
    padding: 15px;
    min-width: 180px;
    width: 30%;
}

.player-list-container {
    flex: 0 0 auto;
    width: 60%;
    background: rgba(32, 34, 37, 0.3);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

@media screen and (max-width: 768px) {
    .server-stats-and-players {
        flex-direction: column;
        gap: 15px;
    }
    
    .server-stats, .player-list-container {
        width: 100%;
    }
}

.refresh-btn {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--description-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white-color);
    transform: rotate(180deg);
}

/* 服务器延迟样式 */
.ping-good {
    color: #4aff6b !important; /* 绿色 - 良好的延迟 */
}

.ping-average {
    color: #ffc107 !important; /* 黄色 - 中等延迟 */
}

.ping-bad {
    color: #ff6b6b !important; /* 红色 - 较高延迟 */
}

.ping-unknown {
    color: #7f8c8d !important; /* 灰色 - 未知状态 */
}

