/* ==========================================================================
   SIAMDIY.com - Global Main Stylesheet (Cleaned Version)
   ========================================================================== */

:root {
    --primary-dark: #0f172a;    /* Slate-900 */
    --secondary-dark: #1e293b;  /* Slate-800 */
    --accent-orange: #f97316;   /* Orange-500 Accent */
    --text-white: #f8fafc;      /* Slate-50 */
    --sub-text: #94a3b8;        /* Slate-400 */
    --line: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Mitr', sans-serif;
}

body {
    background-color: var(--primary-dark);
    color: var(--text-white);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top center, #1e293b 0%, #0f172a 80%);
    overflow-x: hidden;
    position: relative;
}

/* Background Pattern (Circuit Board) */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url('https://www.transparenttextures.com/patterns/circuit-board.png');
    opacity: 0.05;
    z-index: 0;
    pointer-events: none;
}

/* Background Glow Effect */
.glow {
    position: absolute;
    width: 450px; height: 450px;
    background: var(--accent-orange);
    filter: blur(130px);
    opacity: 0.08;
    z-index: 0;
    top: 200px; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ==========================================================================
   Header & Navbar (จัดความกว้าง 800px ขนานเท่ากับกล่องเนื้อหา)
   ========================================================================== */
.site-header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;

    /* จัดให้อยู่ตรงกลาง และจำกัดขนาดไม่ให้เกินกล่องเนื้อหา */
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-white);
    font-weight: 500;
    font-size: 1.1rem;
    white-space: nowrap;
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.02);
}

.header-logo span {
    color: var(--accent-orange);
    font-weight: 600;
    display: inline !important; /* แสดงผลข้อความ SIAMDIY ทุกหน้าจอ */
}

.header-logo img {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    border-radius: 50% !important;
    margin-right: 10px !important;
    border: 2px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.35) !important;
    object-fit: cover !important;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.header-logo:hover img {
    transform: rotate(4deg) scale(1.05);
    box-shadow: 0 0 18px rgba(249, 115, 22, 0.6) !important;
}

.nav-link {
    color: var(--sub-text);
    text-decoration: none;
    margin-left: 15px;
    transition: 0.3s;
    font-size: 0.9rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-orange);
}

.nav-link i {
    margin-right: 5px;
}

/* ==========================================================================
   Badges (แท็กหมวดหมู่)
   ========================================================================== */
.badge-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    color: var(--text-white);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    background: rgba(249, 115, 22, 0.08);
    transform: translateY(-2px);
}

/* ==========================================================================
   Social Icons & Legal Footer
   ========================================================================== */
.social-container {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-item {
    color: var(--sub-text);
    font-size: 1.4rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

.social-item:hover {
    color: var(--accent-orange);
    transform: translateY(-4px) scale(1.15);
}

.legal-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 0.75rem;
    color: var(--sub-text);
    font-weight: 300;
    width: 100%;
    padding: 25px 20px;
    border-top: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.85);
    margin-top: auto;
}

.footer-links { margin-bottom: 12px; }
.footer-links a { color: var(--sub-text); text-decoration: none; transition: color 0.3s ease; padding: 0 5px; }
.footer-links a:hover { color: var(--accent-orange); }
.separator { opacity: 0.3; margin: 0 5px; }
.copyright { opacity: 0.5; letter-spacing: 0.5px; }
.copyright a { color: var(--text-white); text-decoration: none; transition: 0.3s; }
.copyright a:hover { color: var(--accent-orange); text-decoration: underline; }

/* ==========================================================================
   Mobile Responsive Styles (สำหรับมือถือ)
   ========================================================================== */
@media (max-width: 560px) {
    .site-header {
        padding: 10px 12px;
    }
    .header-logo {
        font-size: 0.95rem;
    }
    .nav-link {
        margin-left: 10px;
        font-size: 0.85rem;
    }
    .nav-link i {
        margin-right: 3px;
    }
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .separator {
        display: none;
    }
}
