/* 1. Import Google Fonts (Inter, Kanit, JetBrains Mono, Merriweather) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Kanit:wght@600;700;800;900&family=JetBrains+Mono:wght@400;700&family=Merriweather:wght@700;900&display=swap');

/* 2. Global CSS Variables (From base.html) */
:root {
    --bg-app: #f8fafc;
    --bg-panel: #ffffff;
    --bg-terminal: #000000;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

.dark {
    --bg-app: #050505;
    --bg-panel: #0d1117;
    --bg-terminal: #000000;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #1e293b;
}

html {
    scroll-behavior: smooth;
}

/* Heading font: Kanit gives a modern, tech-forward feel for the quantum theme */
h1, h2, h3, h4 {
    font-family: 'Kanit', sans-serif;
}

/* 3. Smooth transitions for everything */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, fill 0.3s ease, stroke 0.3s ease !important;
}

/* 4. Thai Language Line Height */
.lang-th {
    line-height: 1.7 !important;
}

/* 5. Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar { 
    width: 6px; 
    height: 6px; 
}
.custom-scrollbar::-webkit-scrollbar-thumb { 
    background: #cbd5e1; 
    border-radius: 10px; 
}
.custom-scrollbar::-webkit-scrollbar-track { 
    background: transparent; 
}
/* Dark mode scrollbar */
.dark .custom-scrollbar::-webkit-scrollbar-thumb { 
    background: #334155; 
}

/* 6. Hide Scrollbar Utilities */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* 7. Global Animations */
.animate-fade-in { 
    animation: fadeIn 0.6s ease-out forwards; 
    opacity: 0;
}
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(15px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* Scroll Reveal Effect */
.reveal { opacity: 0; transition: opacity 0.8s ease-out; }
.reveal.active { opacity: 1; }

/* 8. Mobile Workspace & Terminal Fixes */
@media (max-width: 767px) {
    #view-workspace {
        flex-direction: column !important;
    }
    /* ให้แถบ Sidebar อยู่ครึ่งบนจอในโหมดมือถือ */
    [id^="side-"] {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: 50% !important; 
        border-right: none !important;
        border-bottom: 1px solid var(--border);
    }
    /* ให้ Terminal อยู่ครึ่งล่างจอ */
    #terminal-container {
        height: 100% !important;
    }
}

@media (min-width: 768px) {
    [id^="side-"] {
        width: 33.333333% !important;
        min-width: 400px !important;
        max-width: 650px !important;
        height: 100% !important;
    }
}

/* ป้องกันข้อความโค้ดยาวๆ โดนปุ่มด้านขวาบัง และบังคับให้ตัดขึ้นบรรทัดใหม่ */
.relative.group > .font-mono.shadow-inner {
    padding-right: 6.5rem !important; 
    word-break: break-word !important; 
    white-space: pre-wrap !important;
}