/* กำหนดตัวแปรสีให้ดูทันสมัย (Dark Mode Theme) */
:root {
    --primary-color: #00d2ff;
    --secondary-color: #3a7bd5;
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

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

body {
    /* เรียกใช้ฟอนต์ K2D */
    font-family: 'K2D', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top right, #1e293b, #0f172a);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* กล่องเนื้อหาหลักแบบ Glassmorphism */
.container {
    text-align: center;
    padding: 50px 40px;
    max-width: 650px;
    width: 90%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* จัดเรียงไอคอนเฟืองให้อยู่ซ้อนและขบกัน */
.icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    margin-bottom: 35px;
}

/* ตั้งค่าสีและ Animation เฟืองตัวใหญ่ */
.gear-main {
    color: var(--primary-color);
    animation: spin 8s linear infinite;
    filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.4));
}

/* ตั้งค่าสีและ Animation เฟืองตัวเล็ก (หมุนกลับด้าน) */
.gear-sub {
    color: var(--secondary-color);
    animation: spin-reverse 5s linear infinite;
    margin-top: 25px;
    filter: drop-shadow(0 0 8px rgba(58, 123, 213, 0.4));
}

/* การตกแต่งหัวข้อ */
h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    /* ไล่สีตัวอักษร */
    background: -webkit-linear-gradient(left, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

/* การตกแต่งเนื้อหาย่อย */
p {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 40px;
}

/* แถบหลอดโหลด */
.loading-bar {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

/* อนิเมชันหลอดโหลดวิ่งไปมา */
.loading-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    animation: loading 2s ease-in-out infinite alternate;
    box-shadow: 0 0 10px var(--primary-color);
}

/* Keyframes สำหรับการหมุนและโหลด */
@keyframes spin {
    100% { transform: rotate(360deg); }
}

@keyframes spin-reverse {
    100% { transform: rotate(-360deg); }
}

@keyframes loading {
    0% { width: 15%; transform: translateX(-50%); }
    100% { width: 40%; transform: translateX(200%); }
}

/* รองรับการแสดงผลบนมือถือ (Responsive) */
@media (max-width: 480px) {
    h1 { font-size: 1.8rem; }
    p { font-size: 1rem; }
    .container { padding: 40px 20px; }
    .gear-main { width: 80px; height: 80px; }
    .gear-sub { width: 55px; height: 55px; }
}