/* ArtVerse — แชท และป้ายแจ้งเตือนบนไอคอน
   ไฟล์นี้เป็นส่วนหนึ่งของ css/parts/*.css โหลดตามลำดับเลขหน้าไฟล์ (ลำดับมีผล: ไฟล์หลังทับไฟล์ก่อน) */

/* ============================================================
   ป้ายแจ้งเตือนบนไอคอนหัวเว็บ + เมนูแจ้งเตือนแชท
   ============================================================ */
.icon-link em:empty{display:none}
.icon-link{line-height:0}
.icon-link .hdr-icon{display:block;flex-shrink:0}
.chat-notif-wrap{position:relative}
.chat-notif-trigger{cursor:pointer}
.chat-notif-panel{display:none;position:absolute;right:0;top:50px;width:320px;max-width:88vw;background:#ffffff;color:#1f2430;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);overflow:hidden;z-index:70}
.chat-notif-panel.show{display:block}
.chat-notif-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px 16px;border-bottom:1px solid #eef0f4}
.chat-notif-head strong{font-size:14px}
.chat-notif-head button{border:0;background:transparent;color:var(--orange2);font:inherit;font-size:11.5px;font-weight:800;cursor:pointer;padding:0}
.chat-notif-list{max-height:340px;overflow-y:auto}
.chat-notif-item{display:flex;align-items:center;gap:10px;padding:11px 16px;color:#1f2430;transition:.12s}
.chat-notif-item:hover{background:#f6f8fb}
.chat-notif-avatar{width:38px;height:38px;border-radius:50%;overflow:hidden;background:linear-gradient(135deg,#ffbc3a,#ec3b83);display:grid;place-items:center;font-size:16px;color:#fff;flex:0 0 auto}
.chat-notif-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.chat-notif-body{min-width:0;display:flex;flex-direction:column;gap:2px;flex:1}
.chat-notif-body strong{font-size:13px}
.chat-notif-body span{font-size:12px;color:#7b8492;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-notif-badge{min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--pink);color:#fff;font-size:10px;font-weight:900;display:grid;place-items:center;flex:0 0 auto}
.chat-notif-empty{padding:30px 16px;text-align:center;color:#8993a3;font-size:12.5px}
.chat-notif-footer{display:block;text-align:center;padding:12px;font-size:12.5px;font-weight:800;color:var(--orange2);border-top:1px solid #eef0f4}
/* ============================================================
   ห้องแชทลูกค้า-ศิลปิน (chatroom)
   ใช้โทเคนสีเดียวกับเว็บหน้าหลัก (--orange/--pink/--line/--text/--muted/--panel)
   ============================================================ */
.chatroom{display:grid;gap:0}
.chatroom-shell{
  display:flex;
  border:1px solid var(--line);
  border-radius:20px;
  overflow:hidden;
  background:var(--panel);
  box-shadow:var(--shadow);
  min-height:calc(100vh - 160px);
  max-height:calc(100vh - 120px);
}
/* ---- sidebar ---- */
.chatroom-sidebar{width:340px;min-width:340px;border-right:1px solid var(--line);display:flex;flex-direction:column;background:var(--panel)}
.chatroom-brand-bar{display:flex;align-items:center;gap:9px;padding:18px 20px 6px;flex:0 0 auto}
.chatroom-brand-mark{width:30px;height:30px;border-radius:9px;background:linear-gradient(135deg,var(--orange),var(--pink));color:#fff;display:grid;place-items:center;font-weight:900;font-size:15px;flex-shrink:0}
.chatroom-brand-name{font-weight:800;font-size:15px;color:var(--text);letter-spacing:.2px}
.chatroom-tabs{display:flex;gap:22px;padding:14px 20px 0 20px;flex:0 0 auto}
.chatroom-tab{font-size:13.5px;color:var(--muted);padding-bottom:12px;cursor:pointer;border-bottom:2px solid transparent;font-weight:600;transition:color .15s ease}
.chatroom-tab:hover{color:var(--text)}
.chatroom-tab.active{color:var(--orange2);border-bottom-color:var(--orange);font-weight:800;cursor:default}
.chatroom-sidebar-divider{border-bottom:1px solid var(--line);flex:0 0 auto;margin-top:2px}
.chatroom-unread-toggle{display:flex;align-items:center;gap:10px;padding:13px 20px;font-size:12.5px;font-weight:600;color:var(--text);border-bottom:1px solid var(--line);flex:0 0 auto;cursor:pointer}
.chatroom-switch{width:30px;height:17px;border-radius:999px;background:var(--panel2);position:relative;cursor:pointer;flex:0 0 auto;transition:background .18s ease}
.chatroom-switch input{position:absolute;opacity:0;width:1px;height:1px}
.chatroom-switch::after{content:"";position:absolute;top:2px;left:2px;width:13px;height:13px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:left .18s ease}
.chatroom-switch:has(input:checked){background:linear-gradient(135deg,var(--orange),var(--pink))}
.chatroom-switch:has(input:checked)::after{left:15px}
.chatroom-list{flex:1;overflow-y:auto;padding:8px 8px 12px;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.chatroom-list::-webkit-scrollbar{width:6px}
.chatroom-list::-webkit-scrollbar-thumb{background:var(--line);border-radius:99px}
.chatroom-room{display:flex;align-items:center;gap:12px;padding:11px 12px;cursor:pointer;border-radius:14px;position:relative;transition:background .15s ease}
.chatroom-room:hover{background:var(--panel2)}
.chatroom-room.active{background:linear-gradient(90deg,rgba(245,158,11,.12),rgba(223,75,131,.07))}
.chatroom-room.active::before{content:"";position:absolute;left:0;top:14px;bottom:14px;width:3px;border-radius:99px;background:linear-gradient(180deg,var(--orange),var(--pink))}
.chatroom-room.unread .chatroom-room-name{font-weight:800;color:var(--text)}
.chatroom-avatar,.chatroom-notif-avatar{position:relative;width:46px;height:46px;border-radius:50%;background:linear-gradient(135deg,var(--orange2),var(--pink));display:grid;place-items:center;color:#fff;font-size:19px;flex-shrink:0;overflow:hidden}
.chatroom-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.chatroom-room.active .chatroom-avatar{box-shadow:0 0 0 2px var(--panel),0 0 0 4px var(--orange)}
.chatroom-online-dot{position:absolute;bottom:0;right:0;width:10px;height:10px;border-radius:50%;background:var(--green);border:2px solid var(--panel)}
.chatroom-room-text{flex:1;min-width:0}
.chatroom-room-top{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.chatroom-room-name{font-size:13.5px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chatroom-room-top-right{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.chatroom-room-time{font-size:11px;color:var(--muted);white-space:nowrap}
.chatroom-room-badge{min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:linear-gradient(135deg,var(--orange),var(--pink));color:#fff;font-size:10px;font-weight:900;display:grid;place-items:center}
.chatroom-room-preview{font-size:12.5px;color:var(--muted);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chatroom-room.unread .chatroom-room-preview{color:var(--text);font-weight:600}
.chatroom-empty-list{padding:40px 22px;text-align:center;color:var(--muted);font-size:13px;line-height:1.8}
/* ---- main panel ---- */
.chatroom-main{flex:1;display:flex;flex-direction:column;min-width:0;background:var(--bg)}
.chatroom-header{display:flex;align-items:center;gap:12px;padding:14px 22px;border-bottom:1px solid var(--line);flex:0 0 auto;background:rgba(255,255,255,.85);backdrop-filter:blur(10px)}
.chatroom-header .chatroom-avatar{width:38px;height:38px;font-size:16px}
.chatroom-header-name{font-size:14px;font-weight:700;color:var(--text)}
.chatroom-more-wrap{margin-left:auto;position:relative}
.chatroom-header-menu{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;color:var(--muted);font-size:19px;cursor:pointer;letter-spacing:2px;line-height:1;transition:background .15s ease,color .15s ease}
.chatroom-header-menu:hover{background:var(--panel2);color:var(--text)}
.chatroom-more-panel{display:none;position:absolute;right:0;top:38px;min-width:200px;background:var(--panel);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:6px;z-index:20}
.chatroom-more-panel.show{display:block}
.chatroom-more-panel a{display:block;padding:10px 12px;border-radius:10px;color:var(--text);font-size:12.5px;font-weight:600;transition:background .15s ease,color .15s ease}
.chatroom-more-panel a:hover{background:var(--panel2);color:var(--orange2)}
.chatroom-more-empty{display:block;padding:10px 12px;color:var(--muted);font-size:12px}
.chatroom-body{flex:1;overflow-y:auto;padding:26px 24px 18px;display:flex;flex-direction:column;gap:4px;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.chatroom-body::-webkit-scrollbar{width:6px}
.chatroom-body::-webkit-scrollbar-thumb{background:var(--line);border-radius:99px}
.chatroom-safety-banner{align-self:center;max-width:520px;background:rgba(245,158,11,.08);border:1px solid rgba(245,158,11,.24);border-radius:12px;padding:11px 16px;display:flex;gap:10px;font-size:12.5px;line-height:1.6;color:#8a5a10;margin-bottom:22px}
.chatroom-safety-banner .icon{flex-shrink:0}
.chatroom-day-divider{display:flex;justify-content:center;margin:14px 0}
.chatroom-day-divider span{font-size:11px;font-weight:600;color:var(--muted);background:var(--panel2);border-radius:999px;padding:5px 14px}
.chatroom-msg-row{display:flex;align-items:flex-end;gap:8px;margin-bottom:12px;max-width:68%}
.chatroom-msg-row .chatroom-avatar{width:26px;height:26px;font-size:11px}
.chatroom-bubble{
  width:fit-content;max-width:100%;box-sizing:border-box;display:inline-block;
  background:var(--panel);border:1px solid var(--line);border-radius:4px 16px 16px 16px;
  padding:9px 14px;font-size:13.5px;color:var(--text);line-height:1.6;
  white-space:pre-wrap;word-break:break-word;
  box-shadow:0 1px 3px rgba(37,48,71,.06);
}
.chatroom-msg-meta{font-size:10.5px;color:var(--muted);margin-top:5px;margin-left:4px}
.chatroom-msg-row.outgoing{align-self:flex-end;flex-direction:row-reverse;max-width:68%;margin-left:auto}
.chatroom-msg-row.outgoing .chatroom-bubble{
  background:linear-gradient(135deg,var(--orange),var(--pink));
  color:#fff;border:0;border-radius:16px 4px 16px 16px;
  box-shadow:0 6px 16px rgba(223,75,131,.22);
}
.chatroom-msg-row.outgoing .chatroom-msg-meta{text-align:right;margin-left:0;margin-right:4px}
.chatroom-empty-thread,.chatroom-placeholder{margin:auto;text-align:center;color:var(--muted);padding:30px}
.chatroom-placeholder{display:flex;flex-direction:column;align-items:center;gap:10px}
.chatroom-placeholder span{font-size:46px;opacity:.5}
.chatroom-placeholder strong{color:var(--text);font-size:16px}
.chatroom-footer{display:flex;align-items:center;gap:9px;padding:14px 20px;border-top:1px solid var(--line);flex:0 0 auto;background:rgba(255,255,255,.9);backdrop-filter:blur(10px)}
.chatroom-icon-btn{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--muted);cursor:pointer;flex-shrink:0;font-size:16px;transition:background .15s ease,color .15s ease}
.chatroom-icon-btn:hover{background:var(--panel2);color:var(--orange2)}
.chatroom-input{flex:1;min-width:0;border:1px solid var(--line);background:var(--panel2);border-radius:20px;padding:10px 16px;font-size:13px;outline:none;font-family:inherit;color:var(--text);transition:border-color .15s ease,background .15s ease,box-shadow .15s ease}
.chatroom-input::placeholder{color:var(--muted)}
.chatroom-input:focus{border-color:rgba(245,158,11,.5);background:var(--panel);box-shadow:0 0 0 3px rgba(245,158,11,.12)}
.chatroom-send-btn{background:linear-gradient(135deg,var(--orange),var(--pink));color:#fff;box-shadow:0 6px 16px rgba(223,75,131,.24);transition:transform .15s ease,filter .15s ease}
.chatroom-send-btn:hover{transform:translateY(-1px);filter:brightness(1.05)}
.chatroom-emoji-wrap{position:relative;flex-shrink:0}
.chatroom-emoji-panel{display:none;position:absolute;right:0;bottom:48px;width:244px;background:var(--panel);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);padding:8px;grid-template-columns:repeat(6,1fr);gap:2px;z-index:20}
.chatroom-emoji-panel.show{display:grid}
.chatroom-emoji-panel button{border:0;background:transparent;font-size:19px;padding:6px;border-radius:9px;cursor:pointer;line-height:1;transition:background .15s ease}
.chatroom-emoji-panel button:hover{background:var(--panel2)}
/* ไฟล์แนบ (รูปภาพ/PDF) ในแชท */
.chatroom-attach-preview{display:flex;align-items:center;gap:10px;margin:10px 20px 0;padding:8px 10px;border:1px solid var(--line);border-radius:12px;background:var(--panel2);font-size:12.5px;color:var(--text)}
.chatroom-attach-preview[hidden]{display:none}
.chatroom-attach-preview img{width:36px;height:36px;border-radius:8px;object-fit:cover;flex:none}
.chatroom-attach-file-icon{width:36px;height:36px;border-radius:8px;background:var(--panel);display:grid;place-items:center;font-size:18px;flex:none}
.chatroom-attach-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chatroom-attach-preview button{flex:none;width:26px;height:26px;border-radius:50%;border:0;background:transparent;color:var(--muted);font-size:18px;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease}
.chatroom-attach-preview button:hover{background:var(--panel);color:#d92d20}
.chatroom-image-attach{display:block;margin-bottom:4px;border-radius:14px;overflow:hidden;max-width:240px}
.chatroom-image-attach img{display:block;width:100%;max-height:260px;object-fit:cover}
.chatroom-attach-file{display:inline-flex;align-items:center;gap:8px;padding:9px 14px;border-radius:14px;background:var(--panel);border:1px solid var(--line);color:var(--text);font-size:13px;font-weight:700;text-decoration:none;margin-bottom:4px}
.chatroom-attach-file span:first-child{font-size:17px}
.chatroom-msg-row.outgoing .chatroom-attach-file{background:rgba(255,255,255,.18);border-color:transparent;color:#fff}
@media(max-width:900px){.chatroom-shell{flex-direction:column;min-height:0;max-height:none}
.chatroom-sidebar{width:100%;min-width:0;max-height:280px;border-right:0;border-bottom:1px solid var(--line)}
.chatroom-main{min-height:460px;max-height:70vh}
.chatroom-msg-row,.chatroom-msg-row.outgoing{max-width:85%}}
/* accessibility & motion */
.chatroom-room:focus-visible,
.chatroom-tab:focus-visible,
.chatroom-icon-btn:focus-visible,
.chatroom-header-menu:focus-visible,
.chatroom-brand-bar:focus-visible{outline:2px solid var(--orange);outline-offset:2px}
@media(prefers-reduced-motion:reduce){.chatroom *{transition:none!important}}
/* ============================================================
   Chat page shell — เลย์เอาต์เต็มจอ ไม่มี footer ของเว็บ
   ใช้พื้นหลังไล่สีชุดเดียวกับหน้าหลัก (body{} ด้านบน)
   ============================================================ */
body[data-page="chat"]{
  display:flex;
  flex-direction:column;
  height:100vh;
  overflow:hidden;
}
body[data-page="chat"] .site-header{flex:0 0 auto;position:relative;top:0}
body[data-page="chat"] .footer{display:none!important}
body[data-page="chat"] .wrap.page{width:100%;max-width:none;margin:0;padding:16px 16px 0;flex:1;min-height:0;display:flex;flex-direction:column;box-sizing:border-box}
body[data-page="chat"] #chatApp{flex:1;min-height:0;display:flex;flex-direction:column;padding-bottom:16px}
body[data-page="chat"] .chatroom{flex:1;min-height:0;height:auto}
body[data-page="chat"] .chatroom-brand-bar{display:none}
