@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes sponsorBorderPulse {
    0%, 100% { 
        border-color: rgba(251, 191, 36, 0.3); 
        box-shadow: 0 0 10px rgba(251, 191, 36, 0.05), var(--shadow-sm); 
    }
    50% { 
        border-color: rgba(251, 191, 36, 0.7); 
        box-shadow: 0 0 15px rgba(251, 191, 36, 0.15), var(--shadow-md); 
    }
}

@keyframes goldShineText {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.server-row {
    display: grid;
    grid-template-columns: 200px 1fr 56px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    align-items: stretch;
    padding: 0;
    transition: all var(--transition-normal);
    margin-bottom: 16px;
    position: relative;
    height: 140px;
    overflow: visible;
    z-index: 1;
    box-shadow: var(--shadow-sm);
    animation: slideUpFade 0.5s ease-out forwards;
}

.server-row:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-neon), var(--shadow-md);
    z-index: 100;
}

.rank-box {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.85);
    color: var(--primary);
    font-weight: 800;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 180, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-num {
    font-family: var(--font-display);
    font-weight: 700;
}

.trophy-icon {
    font-size: 1.1rem;
}

.trophy-1 {
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.5));
}

.server-icon {
    width: 100%;
    height: 100%;
    background: var(--bg-body);
    display: block;
    position: relative;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    overflow: hidden;
}

.server-icon a {
    width: 100%;
    height: 100%;
    display: block;
}

.server-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.9;
    transition: all var(--transition-slow);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.server-row:hover .server-icon img {
    opacity: 1;
    transform: scale(1.05);
}

.server-icon::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60px;
    background: linear-gradient(to right, transparent, var(--bg-card));
    z-index: 2;
    pointer-events: none;
}

.server-details {
    padding: 16px 20px 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    z-index: 3;
    overflow: visible;
    height: 100%;
}

.server-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.server-name-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.server-name-wrap h3 {
    font-size: 1.25rem;
    margin: 0;
    line-height: 1.3;
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 6px;
}

.server-name-wrap h3 a {
    color: var(--text-bright);
    text-decoration: none;
    transition: color var(--transition-fast);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
}

.server-name-wrap h3 a:hover {
    color: var(--primary);
}

.server-name-wrap h3 i {
    flex-shrink: 0;
}

.verified-badge {
    color: var(--primary);
    font-size: 0.9em;
}

.server-status-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    gap: 4px;
}

.status-online {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--success);
    letter-spacing: 0.5px;
}

.status-online::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success-glow);
    animation: pulse-dot 2s infinite;
}

.server-desc {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.7em;
    white-space: normal;
}

.server-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    height: 36px;
    flex-shrink: 0;
}

.server-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow: hidden;
    align-items: flex-end;
    flex: 1;
    min-width: 0;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.tag:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.tag-country { background: rgba(0, 180, 255, 0.1); color: var(--primary-light); border-color: rgba(0, 180, 255, 0.15); }
.tag-survival { background: rgba(0, 230, 118, 0.1); color: #00e676; border-color: rgba(0, 230, 118, 0.15); }
.tag-pvp { background: rgba(255, 23, 68, 0.1); color: #ff1744; border-color: rgba(255, 23, 68, 0.15); }
.tag-creative { background: rgba(123, 97, 255, 0.1); color: #7b61ff; border-color: rgba(123, 97, 255, 0.15); }
.tag-minigames { background: rgba(255, 171, 0, 0.1); color: #ffab00; border-color: rgba(255, 171, 0, 0.15); }
.tag-skyblock { background: rgba(0, 229, 255, 0.1); color: var(--neon-cyan); border-color: rgba(0, 229, 255, 0.15); }
.tag-factions { background: rgba(255, 109, 0, 0.1); color: #ff6d00; border-color: rgba(255, 109, 0, 0.15); }
.tag-modded { background: rgba(213, 0, 249, 0.1); color: #d500f9; border-color: rgba(213, 0, 249, 0.15); }
.tag-hardcore { background: rgba(255, 23, 68, 0.15); color: #ff1744; border-color: rgba(255, 23, 68, 0.2); }
.tag-roleplay { background: rgba(255, 214, 0, 0.1); color: #ffd600; border-color: rgba(255, 214, 0, 0.15); }
.tag-bedwars { background: rgba(233, 30, 99, 0.1); color: #e91e63; border-color: rgba(233, 30, 99, 0.15); }
.tag-economy { background: rgba(76, 175, 80, 0.1); color: #4caf50; border-color: rgba(76, 175, 80, 0.15); }
.tag-votes { 
    background: rgba(0, 180, 255, 0.08); 
    color: var(--primary); 
    border-color: rgba(0, 180, 255, 0.2); 
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.server-ip-wrap-modern {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 4px 6px 4px 14px;
    transition: all var(--transition-normal);
    height: 34px;
    flex-shrink: 0;
}

.server-ip-wrap-modern:hover {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 15px rgba(0, 180, 255, 0.2);
}

.ip-text-modern {
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 10px;
    letter-spacing: 0.3px;
    user-select: all;
    white-space: nowrap;
}

.btn-copy-modern {
    background: var(--primary);
    border: none;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.8rem;
}

.btn-copy-modern:hover {
    background: var(--primary-light);
    transform: scale(1.1);
}

.server-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 180, 255, 0.05);
    border-left: 1px solid var(--border-color);
    text-decoration: none;
    transition: all var(--transition-normal);
    cursor: pointer;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.server-stats:hover {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.action-text { display: none !important; }

.action-icon {
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.server-stats:hover .action-icon {
    color: white;
    transform: translateX(3px);
}

.server-row.rank-first {
    border-color: rgba(0, 229, 255, 0.2);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.08);
}

.server-row.sponsored {
    background: linear-gradient(135deg, var(--bg-card) 60%, rgba(251, 191, 36, 0.03) 100%);
    animation: sponsorBorderPulse 3s infinite ease-in-out;
}

.server-row.sponsored:hover {
    border-color: rgba(251, 191, 36, 0.9) !important;
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.2), var(--shadow-md) !important;
}

.neon-blue-anim {
    text-shadow: 0 0 10px rgba(0, 180, 255, 0.3);
    color: var(--neon-cyan) !important;
}

.gold-anim {
    background: linear-gradient(to right, #bf953f, #fcf6ba, #b38728, #fbf5b7, #bf953f);
    background-size: 200% auto;
    color: #bf953f !important;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: goldShineText 3s linear infinite;
    display: inline-block;
}

@media (max-width: 768px) {
    .server-row {
        grid-template-columns: 80px 1fr 40px !important;
        height: auto !important;
        min-height: 100px;
        margin-bottom: 12px;
    }

    .server-icon { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
    .server-icon::after { display: none; }
    .server-icon img { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }

    .server-details { padding: 10px 12px; gap: 8px; }
    .server-name-wrap h3 { font-size: 1.05rem; }
    .server-desc { font-size: 0.8rem; -webkit-line-clamp: 2; }

    .server-footer-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        height: auto;
    }

    .server-tags {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
        mask-image: linear-gradient(to right, black 90%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
        scrollbar-width: none;
    }
    
    .server-tags::-webkit-scrollbar { display: none; }

    .server-ip-wrap-modern {
        width: 100%;
        justify-content: space-between;
        height: 30px;
    }

    .server-stats { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
    .action-icon { font-size: 1rem; }
    
    .rank-box { 
        top: 8px; 
        left: 8px; 
        font-size: 0.75rem; 
        padding: 4px 8px; 
    }
}