/*
Theme Name: PTK Theme (Plugin Ready)
Author: PUTTAKOM.COM
Version: 2.2
Description: Chat UI theme (Scoped & Stable)
Text Domain: youdream
*/

body {
    background: #000;
    color: #e5e7eb;
    margin: 0;
    overflow-x: hidden;
}

/* กัน element ล้นจอ */
* {
    box-sizing: border-box;
}

img, iframe {
    max-width: 100%;
}

/* 🔒 ล็อกทั้งหน้า */
.yd-chat-page {
    height: 100vh;
    overflow: hidden;
}

.theme-overlay .theme-screenshots {
    float: none;        
    width: 100%;        
    max-width: none;    
    margin: 0;          
    text-align: center;
}

.theme-overlay .screenshot img {
    height: auto;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
}

/* layout หลัก */
.yd-chat-page .yd-main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 900px;
    margin: auto;
}

/* container */
.yd-chat-page .chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}


/* 🔥 ตัวเลื่อนจริง */
#chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
	min-height: 0;
}


/* input ล่าง */
.chat-input {
    position: sticky;
    bottom: 0;
}
/* =========================
   HEADER
========================= */
.yd-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: rgba(10,10,15,0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    width: 100%;
}

body.admin-bar .yd-header {
    top: 32px;
}

/* LOGO */
.logo-center {
    text-align: center;
}

.logo {
    margin: 0;
    font-size: 28px;
    color: #ff1a1a;
    font-family: 'Anuphan', cursive;
}

.logo a {
    color: #fff;
    text-decoration: none;
}

/* LOGO IMAGE */
.custom-logo {
    max-height: 60px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(168,85,247,0.7));
    transition: 0.3s;
}

.custom-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 20px rgba(168,85,247,1));
}

/* EFFECT */
.glow {
    text-shadow: 0 0 10px red, 0 0 20px #ff0000;
}

/* =========================
   LAYOUT
========================= */
.yd-app {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.yd-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: auto;
}

/* =========================
   SIDEBAR
========================= */
.yd-sidebar {
    width: 260px;
    flex-shrink: 0;
    z-index: 9998;
}

/* =========================
   FOOTER
========================= */
.yd-footer {
    text-align: center;
    padding: 25px;
    background: #0f0f0f;
    color: #ffff;
	  border-top: 1px solid #300;
}

/* =========================
   🔮 CHAT (Scoped)
========================= */
.yd-chat-page .chat-container {
    flex: 1;
    padding: 20px;
    padding-bottom: 80px;
    max-width: 100%;
    box-sizing: border-box;
}

.yd-chat-page .message {
    padding: 12px;
    margin: 8px 0;
    border-radius: 10px;
    max-width: 100%;
    word-wrap: break-word;
}

.yd-chat-page .message.user {
    background: #1a1a1a;
    text-align: right;
    margin-left: auto;
}

.yd-chat-page .message.bot {
    background: #111;
    border-left: 3px solid red;
    text-align: left;
}

/* =========================
   📄 CONTENT PAGE
========================= */
.yd-content-page {
    max-width: 800px;
    margin: auto;
    padding: 20px;
}

.yd-content-page img {
    max-width: 100%;
    height: auto;
}

.yd-content-page p {
    line-height: 1.7;
}

.yd-content-page h1,
.yd-content-page h2,
.yd-content-page h3 {
    margin-top: 20px;
    color: #fff;
}

.yd-content-page a {
    color: #ff4d6d;
    text-decoration: none;
}

.yd-content-page a:hover {
    text-decoration: underline;
}

.yd-content-page ul {
    padding-left: 20px;
}

.yd-content-page li {
    margin-bottom: 8px;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {

    .yd-main {
        width: 100%;
    }

    .yd-chat-page .chat-input {
        width: 100%;
    }

}

/* ซ่อนบน desktop */
.mobile-logo-footer {
    display: none;
}

/* แสดงเฉพาะมือถือ */
@media (max-width: 768px) {

    .yd-header .logo-center {
        display: none;
    }

    .mobile-logo-footer {
        display: block;
        text-align: center;
        margin-bottom: 10px;
    }

    .mobile-logo-footer img {
        max-height: 50px;
        opacity: 0.9;
    }
}
