/* khul2000.online — retro Y2K blue theme (CSS ธรรมดา ไม่พึ่ง framework) */

/*
 * ชุดฟอนต์สไตล์ Windows XP Thai Language Pack — เรียง "Cordia New" (ฟอนต์ไทยมาตรฐานที่มากับ
 * ชุดภาษาไทยของ Windows XP) ก่อน แล้วค่อย fallback ไปที่ Tahoma/MS Sans Serif (ฟอนต์ระบบของ XP
 * ที่รองรับไทยด้วย) แล้วจบที่ Angsana New (ฟอนต์ไทยอีกตัวที่มากับชุดภาษาเดียวกัน) ก่อนเป็น sans-serif ทั่วไป
 * เครื่อง Windows ส่วนใหญ่ยังมีฟอนต์ชุดนี้ติดมาด้วยเป็นค่าเริ่มต้น ส่วนเครื่องอื่นจะ fallback อัตโนมัติ
 */
:root {
    --font-thai-xp: "Cordia New", Tahoma, "MS Sans Serif", "Angsana New", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 18px 0 40px;
    /* เบราว์เซอร์เก่า (เช่น IE8 บน Windows XP) ไม่รู้จัก repeating-linear-gradient จึงใช้สีพื้นเรียบนี้แทน */
    background: #bcdcff;
    background-image:
        repeating-linear-gradient(135deg, rgba(255,255,255,0.35) 0px, rgba(255,255,255,0.35) 2px, transparent 2px, transparent 18px);
    /* เบราว์เซอร์เก่าไม่รู้จัก var() เลยจะข้ามบรรทัดนี้ไปทั้งหมด จึงใส่ชุดฟอนต์จริงซ้ำไว้ก่อนเป็น fallback */
    font-family: "Cordia New", Tahoma, "MS Sans Serif", "Angsana New", sans-serif;
    font-family: var(--font-thai-xp);
    font-size: 14px;
    color: #113355;
}

a { color: #0000EE; text-decoration: underline; }
a:visited { color: #551A8B; }
a:hover { color: #ff6600; }

.page-wrap {
    width: 780px;
    margin: 0 auto;
    background: #ffffff;
    border: 2px solid #3366cc;
    box-shadow: 3px 3px 0 #7fa8e0;
}

/* ---------- header ---------- */
.site-header {
    position: relative;
    /* เบราว์เซอร์เก่าไม่รู้จัก flex จะใช้ display:block + float ด้านล่างแทน (ดู .site-logo/.site-title) */
    display: block;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    /* สีพื้นเรียบสำหรับเบราว์เซอร์เก่าที่ไม่รู้จัก gradient */
    background: #2d5fc9;
    background: linear-gradient(to bottom, #6fa8ff 0%, #2d5fc9 55%, #1c3f91 100%);
    border-bottom: 2px solid #0f2a66;
    overflow: hidden; /* clearfix เผื่อ fallback แบบ float */
}

/* ประกายดาวกะพริบตกแต่งหัวเว็บ (ตกแต่งล้วน ๆ ไม่กระทบการใช้งาน เบราว์เซอร์เก่าจะเห็นเป็นดาวนิ่งแทน) */
.header-sparkle {
    position: absolute;
    color: #fff176;
    text-shadow: 0 0 4px #ffffff;
    font-size: 14px;
    line-height: 1;
    pointer-events: none;
    animation: khul-twinkle 1.6s ease-in-out infinite;
}
@keyframes khul-twinkle {
    0%, 100% { opacity: 0.25; transform: scale(0.75); }
    50%      { opacity: 1;    transform: scale(1.2); }
}
.site-logo {
    /* ใช้แทนตำแหน่งแบบ flex ตอน fallback เท่านั้น ไม่มีผลเมื่อ parent เป็น flex จริง */
    float: left;
    margin-right: 14px;
    height: 64px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}
.site-title { overflow: hidden; } /* กันไม่ให้ชนกับโลโก้ตอน fallback แบบ float */
.site-title h1 {
    margin: 0;
    font-size: 22px;
    color: #ffffff;
    text-shadow: 1px 1px 0 #0f2a66;
    letter-spacing: 1px;
}
.site-title .tagline {
    margin: 2px 0 0;
    font-size: 11px;
    color: #dceaff;
}

/* ---------- marquee-style banner (ใช้ CSS animation แทน <marquee> จริง) ---------- */
.marquee-bar {
    overflow: hidden;
    background: #002266;
    color: #ffff66;
    font-weight: bold;
    font-size: 12px;
    padding: 4px 0;
    border-bottom: 1px solid #99bbee;
    white-space: nowrap;
}
.marquee-track {
    display: inline-block;
    padding-left: 100%;
    color: #ffff66; /* fallback: เบราว์เซอร์เก่าไม่รู้จัก animation สีรุ้งจะเห็นสีเหลืองนิ่ง ๆ แบบเดิม */
    animation: khul-marquee 18s linear infinite, khul-rainbow-text 6s linear infinite;
}
@keyframes khul-marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}
@keyframes khul-rainbow-text {
    0%   { color: #ff6666; }
    16%  { color: #ffcc66; }
    33%  { color: #ffff66; }
    50%  { color: #66ff99; }
    66%  { color: #66ccff; }
    83%  { color: #cc99ff; }
    100% { color: #ff6666; }
}

/* ---------- icons (SVG วาดเองสไตล์ไอคอนเล็กยุค 2000) ---------- */
.icon {
    display: inline-block;
    vertical-align: -2px;
    margin-right: 3px;
}

/* ---------- nav ---------- */
.site-nav {
    /* เบราว์เซอร์เก่าไม่รู้จัก flex: ลิงก์ข้างในเป็น inline-block อยู่แล้วจึงขึ้นบรรทัดใหม่เองได้ตามปกติ */
    display: block;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 8px 10px;
    background: #d9ebff;
    border-bottom: 2px solid #8fb8ea;
}
.site-nav a,
.site-nav .link-button {
    display: inline-block;
    padding: 4px 10px;
    background: #eef6ff;
    border: 2px outset #a9c9f2;
    color: #113355;
    text-decoration: none;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}
.site-nav a:hover,
.site-nav .link-button:hover {
    background: #cfe3ff;
}
.site-nav .link-button:active {
    border-style: inset;
}
.logout-form { margin: 0; display: inline; }

.nav-search {
    margin-left: auto; /* เบราว์เซอร์เก่าไม่รู้จัก flex จะไม่ดันไปชิดขวา แต่ยังใช้งานได้ปกติ */
    display: inline-block;
    display: inline-flex;
    gap: 4px;
}
.nav-search input[type="text"] {
    font-family: inherit;
    font-size: 12px;
    padding: 3px 6px;
    border: 2px inset #a9c9f2;
    width: 140px;
}

/* ---------- main content ---------- */
.site-main { padding: 14px; }

.content-box {
    border: 2px solid #8fb8ea;
    background: #f5faff;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.content-box h2 {
    margin-top: 0;
    color: #1c3f91;
    border-bottom: 1px dashed #8fb8ea;
    padding-bottom: 6px;
}
.content-box h3 { color: #1c3f91; }
.muted { color: #6b7f99; font-size: 12px; }

/* ---------- forms ---------- */
.retro-form label { display: block; font-weight: bold; margin-bottom: 4px; }
.retro-form input[type="text"],
.retro-form input[type="email"],
.retro-form input[type="password"],
.retro-form textarea {
    width: 100%;
    max-width: 520px;
    font-family: "Cordia New", Tahoma, "MS Sans Serif", "Angsana New", sans-serif;
    font-family: var(--font-thai-xp);
    font-size: 12px;
    padding: 5px 6px;
    border: 2px inset #a9c9f2;
    background: #ffffff;
}
.retro-form textarea { font-family: "Courier New", monospace; resize: vertical; }

.captcha-img {
    display: block;
    margin-bottom: 6px;
    border: 2px inset #a9c9f2;
    background: #eef6ff;
}

.retro-btn {
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    padding: 6px 16px;
    background: #eef6ff;
    border: 2px outset #a9c9f2;
    color: #113355;
    cursor: pointer;
}
.retro-btn:hover { background: #cfe3ff; }
.retro-btn:active { border-style: inset; }
.retro-btn-primary {
    background: #3366cc;
    border-color: #a9c9f2;
    color: #ffffff;
}
.retro-btn-primary:hover { background: #1c3f91; }

.alert-error {
    background: #ffe0e0;
    border: 1px solid #cc3333;
    color: #990000;
    padding: 6px 10px;
    margin-bottom: 8px;
    font-size: 12px;
}
.alert-success {
    background: #e2ffe0;
    border: 1px solid #33aa33;
    color: #116611;
    padding: 6px 10px;
    margin-bottom: 8px;
    font-size: 12px;
}

/* ---------- profile ---------- */
.profile-head { text-align: center; }
.avatar-circle {
    display: inline-block;
    width: 64px;
    height: 64px;
    line-height: 64px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: #3366cc;
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
    text-transform: uppercase;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px #8fb8ea;
    text-align: center;
    object-fit: cover;
    vertical-align: middle;
}
.profile-frame {
    width: 100%;
    height: 420px;
    border: 2px inset #a9c9f2;
    background: #ffffff;
}
.blog-frame { height: 600px; }

.blog-list-item {
    border: 2px solid #8fb8ea;
    background: #f5faff;
    padding: 10px 14px;
    margin-bottom: 10px;
}
.blog-list-item h3 { margin: 0 0 4px; }

/* ---------- visitor counter ---------- */
.counter-box {
    text-align: center;
    font-size: 12px;
    color: #113355;
    margin-bottom: 10px;
}
.counter-digits {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 10px;
    background: #000000;
    color: #33ff33;
    font-family: "Courier New", monospace;
    font-size: 20px;
    letter-spacing: 4px;
    border: 2px inset #666666;
}

/* ---------- forum: board list ---------- */
.category-heading {
    margin: 14px 0 4px;
    padding: 4px 8px;
    background: #ffd454;
    background: linear-gradient(to bottom, #ffe9a8 0%, #ffd454 100%);
    border: 1px solid #cc9900;
    color: #553c00;
    font-size: 14px;
}
.category-heading:first-of-type { margin-top: 0; }

.board-list {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
    background: #ffffff;
    border: 2px solid #8fb8ea;
}
.board-list th, .board-list td {
    border: 1px solid #cfe0f5;
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
}
.board-list th {
    background: #3366cc;
    color: #ffffff;
}
.board-list .col-count { width: 70px; text-align: center; }
.board-name { font-weight: bold; }

.badge {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 6px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
}
.badge-pin { background: #ffcc00; color: #553c00; }
.badge-lock { background: #cc3333; color: #ffffff; }
.badge-admin { background: #3366cc; color: #ffffff; }
.badge-op { background: #33aa33; color: #ffffff; }
.badge-new { background: #ff6600; color: #ffffff; }

/* ---------- forum: thread / posts ---------- */
.admin-tools { margin-top: 8px; display: block; display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form { display: inline-block; margin: 0; }

.post-box {
    border: 2px solid #8fb8ea;
    background: #ffffff;
    margin-bottom: 10px;
}
.post-author {
    display: block;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #d9ebff;
    padding: 6px 10px;
    border-bottom: 1px solid #8fb8ea;
    font-size: 12px;
}
.avatar-small {
    width: 24px;
    height: 24px;
    line-height: 24px;
    font-size: 13px;
    border-width: 1px;
    box-shadow: none;
}
.post-body {
    padding: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.post-body img { max-width: 100%; }
.emoticon-img {
    height: 19px;
    width: auto;
    vertical-align: middle;
    margin: 0 1px;
}
.bb-quote {
    margin: 6px 0;
    padding: 6px 10px;
    background: #f0f6ff;
    border-left: 3px solid #3366cc;
    font-size: 12px;
}
.bb-quote cite { display: block; font-style: normal; font-weight: bold; color: #1c3f91; }
.bb-code {
    background: #eef1f5;
    border: 1px solid #c7d2de;
    padding: 6px;
    font-family: "Courier New", monospace;
    overflow-x: auto;
}
.post-meta {
    padding: 4px 10px 8px;
    font-size: 11px;
}
.link-button-inline {
    background: none;
    border: none;
    padding: 0;
    color: #0000EE;
    text-decoration: underline;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}
.link-button-inline:hover { color: #ff6600; }
.retro-btn-danger { background: #ffe0e0; border-color: #cc8888; color: #990000; }
.retro-btn-danger:hover { background: #ffc9c9; }

/* ---------- pagination ---------- */
.pagination {
    display: block;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 10px 0 16px;
    font-size: 12px;
}
.page-link {
    display: inline-block;
    padding: 3px 9px;
    background: #eef6ff;
    border: 2px outset #a9c9f2;
    color: #113355;
    text-decoration: none;
}
a.page-link:hover { background: #cfe3ff; }
.page-current {
    background: #3366cc;
    border-style: inset;
    color: #ffffff;
    font-weight: bold;
}
.page-disabled {
    color: #9ab0cc;
    border-style: inset;
    background: #eef1f5;
}
.page-ellipsis { padding: 0 4px; color: #6b7f99; }

.report-form { display: inline-block; display: inline-flex; align-items: center; gap: 4px; }
.report-reason-input {
    font-family: inherit;
    font-size: 11px;
    padding: 2px 4px;
    border: 1px solid #c7d2de;
    width: 140px;
}

/* ---------- footer ---------- */
.site-footer {
    text-align: center;
    font-size: 11px;
    color: #4a6690;
    padding: 10px;
    border-top: 2px solid #8fb8ea;
    background: #d9ebff;
}

/* ป้าย 88x31 สไตล์ webring/banner exchange ยุค 2000 */
.retro-buttons-row {
    display: block;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: #ffffff;
    border-top: 1px dashed #8fb8ea;
    border-bottom: 1px dashed #8fb8ea;
}
.retro-button-88 {
    display: block;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 31px;
    font-size: 9px;
    line-height: 1.15;
    font-weight: bold;
    text-align: center;
    color: #ffffff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.45);
    border: 1px solid #222;
    overflow: hidden;
    padding: 2px;
}
.retro-button-88.rb-blue   { background: #3366cc; }
.retro-button-88.rb-pink   { background: #cc3399; }
.retro-button-88.rb-green  { background: #339933; }
.retro-button-88.rb-orange { background: #cc6600; }
.retro-button-88.rb-purple { background: #663399; }

/* ---------- shoutbox (ไลฟ์แชทลอยข้างหน้าเว็บ) ---------- */
.shoutbox-widget {
    position: fixed;
    top: 110px;
    right: 14px;
    width: 230px;
    max-height: 70vh;
    /* เบราว์เซอร์เก่าไม่รู้จัก flex: ลูกข้างในเป็น block อยู่แล้ว (title/messages/form) จึงเรียงซ้อนกันเป็นแถวตามปกติ
       เหมือน flex-direction:column พอดี ไม่ต้องทำ fallback พิเศษเพิ่ม */
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 2px solid #3366cc;
    box-shadow: 3px 3px 0 #7fa8e0;
    z-index: 500;
}
.shoutbox-title {
    background: #2d5fc9;
    background: linear-gradient(to bottom, #6fa8ff 0%, #2d5fc9 55%, #1c3f91 100%);
    color: #ffffff;
    font-weight: bold;
    font-size: 12px;
    padding: 5px 8px;
    border-bottom: 2px solid #0f2a66;
}
.shoutbox-messages {
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px;
    font-size: 11px;
    background: #f5faff;
    min-height: 120px;
    max-height: 320px;
}
.shoutbox-msg { margin-bottom: 6px; word-wrap: break-word; }
.shoutbox-msg .sb-time { color: #6b7f99; font-size: 10px; }
.shoutbox-msg .sb-user { color: #1c3f91; font-weight: bold; }
.shoutbox-empty { color: #6b7f99; font-style: italic; }

.shoutbox-form {
    display: block; /* fallback: input/button เป็น inline โดยปริยายอยู่แล้ว เรียงติดกันได้โดยไม่ต้องใช้ flex */
    display: flex;
    border-top: 1px solid #a9c9f2;
}
.shoutbox-form input[type="text"] {
    width: 70%; /* fallback ความกว้างตอนไม่มี flex:1 ให้ใช้งานได้ */
    flex: 1;
    border: none;
    padding: 5px 6px;
    font-family: "Cordia New", Tahoma, "MS Sans Serif", "Angsana New", sans-serif;
    font-family: var(--font-thai-xp);
    font-size: 11px;
}
.shoutbox-form button {
    border: none;
    background: #3366cc;
    color: #fff;
    font-size: 11px;
    padding: 5px 10px;
    cursor: pointer;
}
.shoutbox-form button:hover { background: #1c3f91; }
.shoutbox-login-prompt {
    margin: 0;
    padding: 6px 8px;
    font-size: 11px;
    text-align: center;
    border-top: 1px solid #a9c9f2;
}

/* ไม่มีที่พอสำหรับกล่องลอยข้างๆ บนจอแคบ ซ่อนไว้กันทับเนื้อหาหลัก */
@media (max-width: 1150px) {
    .shoutbox-widget { display: none; }
}

/* ---------- ประกายดาวตามเมาส์ (ความคิดถึงยุคโฮมเพจ Geocities/Angelfire) ---------- */
.khul-sparkle {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    opacity: 1;
    animation: khul-sparkle-fade 0.7s ease-out forwards;
}
@keyframes khul-sparkle-fade {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) translateY(-18px); }
}

/* หน้าโปรไฟล์แบบเต็มจอสไตล์ MySpace — เนื้อหาของสมาชิกครอบคลุมทั้งหน้า เหลือแค่แถบเล็ก ๆ ของเว็บเอง */
body.profile-fullpage-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #000;
}

.profile-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: #113355;
    background: rgba(17, 51, 85, 0.88);
    color: #fff;
    font-family: "Cordia New", Tahoma, "MS Sans Serif", sans-serif;
    font-size: 12px;
    padding: 5px 10px;
    border-bottom: 2px solid #3399ff;
    white-space: nowrap;
    overflow-x: auto;
}
.profile-topbar a {
    color: #99ddff;
    text-decoration: none;
}
.profile-topbar a:hover {
    color: #fff;
    text-decoration: underline;
}
.profile-topbar-sep {
    color: #5588bb;
    margin: 0 6px;
}
.profile-topbar-toggle {
    background: #2266aa;
    color: #fff;
    border: 1px solid #99ddff;
    font-size: 11px;
    padding: 2px 8px;
    cursor: pointer;
    font-family: inherit;
}
.profile-topbar-toggle:hover {
    background: #3388cc;
}

.profile-info-panel {
    display: none;
    position: fixed;
    top: 27px;
    left: 0;
    right: 0;
    z-index: 9999;
    max-height: 60vh;
    overflow-y: auto;
    background: #eef6ff;
    border-bottom: 3px solid #3399ff;
}
.profile-info-panel.is-open {
    display: block;
}
.profile-info-inner {
    max-width: 700px;
    margin: 0 auto;
    padding: 16px;
    font-family: "Cordia New", Tahoma, "MS Sans Serif", sans-serif;
}

.profile-fullframe {
    position: fixed;
    top: 27px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(100% - 27px);
    border: 0;
    background: #fff;
}

/* แถบเครื่องมือ BBCode เหนือกล่องข้อความ ใช้คู่กับ bbcodeToolbarHtml() + assets/js/bbcode-toolbar.js */
.bbcode-toolbar {
    background: #eef6ff;
    border: 2px solid #a9c9f2;
    border-bottom: none;
    padding: 4px;
}
.bbcode-btn {
    font-family: inherit;
    font-size: 12px;
    padding: 3px 8px;
    margin: 2px 2px;
    background: #ffffff;
    border: 1px outset #a9c9f2;
    color: #113355;
    cursor: pointer;
}
.bbcode-btn:hover { background: #cfe3ff; }
.bbcode-btn:active { border-style: inset; }
.bbcode-toolbar-sep {
    display: inline-block;
    width: 1px;
    height: 16px;
    background: #a9c9f2;
    margin: 0 4px;
    vertical-align: middle;
}
.bbcode-emo-btn { font-size: 13px; }
.bbcode-toolbar + textarea {
    border-top: none;
    margin-top: 0;
}
