/* ================= CONFIG ================= */
:root {
    --bg-color: #0f111a;
    --text-color: #c0caf5;
    --primary: #7aa2f7;
    --secondary: #9ece6a;
    --accent: #f7768e;
    --card-bg: #1a1b26;
    --card-hover: #24283b;
    --scroll-thumb: #414868;
    --border-line: rgba(255, 255, 255, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    display: flex; flex-direction: column; min-height: 100vh;
}

/* ================= Utils ================= */
img {
    -webkit-user-drag: none; user-drag: none;
    -webkit-user-select: none; user-select: none;
    pointer-events: none; 
}

a { text-decoration: none; color: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ================= AOS ANIMATION STYLE ================= */
.aos-item {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: opacity, transform;
}
.aos-item.aos-active {
    opacity: 1;
    transform: translateY(0);
}

/* ================= NAV ================= */
nav {
    position: fixed; top: 0; width: 100%;
    padding: 15px 50px;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 1000;
    background: rgba(15, 17, 26, 0.95);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.logo { font-size: 1.6rem; font-weight: 700; color: var(--primary); letter-spacing: 1px; }

.nav-links a {
    color: var(--text-color); margin-left: 30px;
    transition: 0.3s; font-size: 1.05rem; font-weight: 500;
    position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-links a::after {
    content: ''; position: absolute; bottom: -5px; left: 0; width: 0%; height: 2px;
    background: var(--primary); transition: 0.3s;
}
.nav-links a:hover::after { width: 100%; }

.hamburger { display: none; cursor: pointer; font-size: 1.5rem; color: var(--text-color); }
.close-menu { display: none; position: absolute; top: 25px; right: 25px; font-size: 1.8rem; cursor: pointer; color: var(--text-color); }

/* ================= SECTIONS & LAYOUT ================= */
section {
    width: 100%; min-height: 100vh;
    display: flex; flex-direction: column;
    padding: 85px 20px 40px 20px;
    position: relative;
    overflow: hidden;
    justify-content: center;
}

#server-section {
    padding-top: 120px; /* ดันลงมาหน่อยเพราะ Navbar */
    min-height: 80vh; 
    justify-content: flex-start;
}

.section-header { text-align: center; margin-bottom: 30px; flex-shrink: 0; }
.section-header h2 { font-size: 3rem; color: #fff; font-weight: 700; letter-spacing: 1px; margin-bottom: 10px; }
.section-header h2 span { color: var(--primary); }
.section-header p { opacity: 0.7; font-size: 1.1rem; }

/* Container หลักของหน้า Server List */
.content-scroll-container {
    width: 100%;
    max-width: 1400px; /* ขยายให้กว้างเพื่อให้ 4 ช่องไม่อึดอัด */
    margin: 0 auto;
    flex-grow: 1; 
    padding: 10px 20px;
}

/* ================= SERVER GRID & CARDS ================= */
.server-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 40px;
    width: 100%;
}

.server-card {
    background: var(--card-bg);
    border: 1px solid var(--border-line);
    border-radius: 16px;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.server-card:hover {
    transform: translateY(-7px) scale(1.02);
    background: var(--card-hover);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    border-color: rgba(122, 162, 247, 0.5);
}

/* Effect แสงวาบเมื่อชี้ */
.server-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: 0.5s;
}
.server-card:hover::before { left: 100%; }

.server-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.1);
    background: #0b0c13;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: 0.3s;
}
.server-card:hover .server-img {
    border-color: var(--primary);
    transform: rotate(5deg);
}

.server-info { flex: 1; min-width: 0; }

.server-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: 0.2s;
}
.server-card:hover .server-name { color: var(--primary); }

.server-meta {
    font-size: 0.85rem;
    color: #8a91b3;
    display: flex;
    align-items: center;
    gap: 6px;
}
.server-meta i { color: var(--secondary); font-size: 0.85rem; }

/* ================= PAGINATION ================= */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding-bottom: 30px;
}

.page-btn {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-line);
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
    display: flex; align-items: center; gap: 8px;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #0f111a;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(122, 162, 247, 0.4);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.page-info {
    font-weight: 600;
    color: #fff;
    background: rgba(255,255,255,0.05);
    padding: 8px 20px;
    border-radius: 50px;
}

/* ================= FOOTER ================= */
footer {
    background: linear-gradient(to top, #05060a, #0b0c13);
    border-top: 1px solid rgba(255,255,255,0.03); padding: 60px 20px 20px 20px;
    margin-top: auto; font-size: 0.95rem;
}
.footer-container { max-width: 1100px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 50px; margin-bottom: 40px; }
.footer-col h3 { color: #fff; font-size: 1.1rem; margin-bottom: 20px; font-weight: 600; }

.footer-logo { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; font-weight: 700; color: var(--primary); margin-bottom: 15px; }
.footer-logo img { width: 40px; height: 40px; border-radius: 50%; }
.footer-desc { color: #8a91b3; line-height: 1.6; margin-bottom: 20px; }

.footer-links, .footer-features { list-style: none; }
.footer-links li, .footer-features li { margin-bottom: 12px; }
.footer-links a { color: #8a91b3; transition: 0.2s; display: flex; align-items: center; gap: 8px; }
.footer-links a:hover { color: var(--primary); padding-left: 5px; }
.footer-features li { color: #8a91b3; display: flex; align-items: center; gap: 10px; }
.footer-features i { color: var(--secondary); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.05); padding-top: 20px;
    display: flex; justify-content: space-between; align-items: center; color: #565d75;
}
.social-links a { color: #8a91b3; font-size: 1.2rem; margin-left: 15px; transition: 0.2s; }
.social-links a:hover { color: #fff; }

/* ================= RESPONSIVE ================= */
@media (max-width: 1400px) { .server-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 992px) { .server-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
    h1.hero-title { font-size: 3.5rem; letter-spacing: 3px; }
    nav { padding: 15px 20px; }
    .hamburger, .close-menu { display: block; }
    .hamburger { z-index: 2000; }
    
    .nav-links {
        display: flex; position: fixed; right: -100%; top: 0;
        height: 100vh; width: 80%; background: rgba(15, 17, 26, 0.98);
        backdrop-filter: blur(20px); flex-direction: column;
        align-items: center; justify-content: center; gap: 35px;
        transition: 0.5s cubic-bezier(0.77, 0, 0.175, 1); z-index: 1500;
        box-shadow: -10px 0 30px rgba(0,0,0,0.7);
    }
    .nav-links.active { right: 0; }
    .nav-links a { font-size: 1.4rem; margin-left: 0; }
    section { padding-top: 80px; padding-bottom: 20px; }
    
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .footer-bottom { flex-direction: column; gap: 15px; text-align: center; }
}
@media (max-width: 576px) { .server-grid { grid-template-columns: 1fr; } }