/* =====================================================================
   news.css — ระบบข่าวสาร Solaris RO (หน้าอ่านข่าว + แผงจัดการข่าวของแอดมิน)
   ===================================================================== */

/* ให้ Bootstrap modal / SweetAlert อยู่เหนือเมนูลอย (royal menu z 99999) */
.modal { z-index: 100050 !important; }
.modal-backdrop { z-index: 100040 !important; }
.swal2-container { z-index: 100200 !important; }

/* ---------- รายการข่าวหน้าแรก ---------- */
.news-item { cursor: pointer; }
.news-item .news-pin { color: #fbbf24; margin-right: 4px; font-size: .8rem; text-shadow: 0 0 6px rgba(251,191,36,.6); }
.news-item .news-ext { color: #a78bfa; font-size: .7rem; margin-left: 6px; opacity: .8; }
.news-cat.promo, .news-cat.promotion { background: #e67e22; color: #fff; }
.news-loading { text-align: center; color: #a78bfa; padding: 24px 0; letter-spacing: 1px; }
.news-loading i { margin-right: 6px; }

/* ---------- หน้าต่างอ่านข่าว ---------- */
#roNewsModal .ro-modal-window { max-width: 860px; width: 94%; display: flex; flex-direction: column; max-height: 90vh; }
#roNewsModal .news-read-head { padding: 22px 26px 14px; border-bottom: 1px solid rgba(251,191,36,.25); text-align: left; }
#roNewsModal .news-read-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
#roNewsModal .news-read-date { color: #c4b5fd; font-size: .85rem; }
#roNewsModal .news-read-title { color: #fef08a; font-family: 'Kanit', sans-serif; font-weight: 600; font-size: 1.45rem; line-height: 1.35; margin: 0; text-shadow: 0 0 10px rgba(245,158,11,.35); }
#roNewsModal .news-read-desc { color: #d8b4fe; font-size: .92rem; margin: 6px 0 0; }
#roNewsModal .news-read-body { overflow-y: auto; padding: 0; flex: 1; -webkit-overflow-scrolling: touch; }
#roNewsModal .news-read-body .ql-container.ql-snow { border: none; font-family: 'Kanit', sans-serif; font-size: 1rem; }
#roNewsModal .news-read-body .ql-editor { color: #ede9fe; padding: 20px 26px 28px; line-height: 1.75; min-height: 0; height: auto; overflow: visible; }
#roNewsModal .news-read-body .ql-editor a { color: #fbbf24; }
#roNewsModal .news-read-body .ql-editor img { max-width: 100%; height: auto; border-radius: 8px; }
#roNewsModal .news-read-body .ql-editor iframe.ql-video { width: 100%; aspect-ratio: 16/9; height: auto; border-radius: 8px; }
#roNewsModal .news-read-body .ql-editor h1, #roNewsModal .news-read-body .ql-editor h2, #roNewsModal .news-read-body .ql-editor h3 { color: #fde68a; }
#roNewsModal .news-read-body .ql-editor blockquote { border-left: 4px solid #f59e0b; color: #e9d5ff; background: rgba(245,158,11,.06); padding: 8px 14px; }
#roNewsModal .news-read-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid rgba(251,191,36,.2); flex-wrap: wrap; }
#roNewsModal .news-read-foot .btn-news-link,
#roNewsModal .news-read-foot .btn-news-copy { border: 1px solid #fbbf24; color: #fef08a; background: rgba(245,158,11,.1); border-radius: 8px; padding: 7px 14px; font-size: .85rem; text-decoration: none; cursor: pointer; font-family: 'Kanit', sans-serif; }
#roNewsModal .news-read-foot .btn-news-link:hover,
#roNewsModal .news-read-foot .btn-news-copy:hover { background: rgba(245,158,11,.25); }
#roNewsModal .news-read-body, #roNewsModal .news-read-body * { -webkit-user-select: text; user-select: text; }
#roNewsModal .news-read-body img { pointer-events: auto; }
@media (max-width: 576px) {
  #roNewsModal .news-read-head { padding: 18px 16px 12px; }
  #roNewsModal .news-read-title { font-size: 1.15rem; }
  #roNewsModal .news-read-body .ql-editor { padding: 16px 16px 22px; }
}

/* ---------- ปุ่มแอดมินในกล่องโปรไฟล์ ---------- */
.btn-rpg-admin {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 600;
  color: #1e0b36 !important; background: linear-gradient(180deg, #fde68a 0%, #f59e0b 100%);
  border: 1px solid #fef08a; box-shadow: 0 0 14px rgba(245,158,11,.45); transition: .2s;
}
.btn-rpg-admin:hover { box-shadow: 0 0 22px rgba(245,158,11,.75); transform: translateY(-1px); }

/* ---------- แผงจัดการข่าว (แอดมิน) ---------- */
#newsAdminModal, #newsAdminModal * { -webkit-user-select: text; user-select: text; }
#newsAdminModal img { pointer-events: auto; }
#newsAdminModal .modal-dialog { max-width: 1100px; }
#newsAdminModal .modal-body { padding: 18px 22px 24px; }
#newsAdminModal .na-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
#newsAdminModal .na-stat { background: rgba(15,6,31,.75); border: 1px solid rgba(245,158,11,.25); border-radius: 10px; padding: 10px 12px; text-align: center; }
#newsAdminModal .na-stat .v { font-size: 1.5rem; font-weight: 700; color: #fef08a; line-height: 1.1; }
#newsAdminModal .na-stat .l { font-size: .75rem; color: #c4b5fd; letter-spacing: .5px; }
#newsAdminModal .na-stat.update .v { color: #38bdf8; }
#newsAdminModal .na-stat.event .v { color: #c084fc; }
#newsAdminModal .na-stat.promo .v { color: #fb923c; }
#newsAdminModal .na-stat.hidden .v { color: #94a3b8; }

#newsAdminModal .na-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
#newsAdminModal .na-tab { background: rgba(91,33,182,.25); border: 1px solid rgba(167,139,250,.4); color: #e9d5ff; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: .88rem; }
#newsAdminModal .na-tab.active { background: linear-gradient(180deg, #7c3aed, #5b21b6); border-color: #fbbf24; color: #fef08a; }
#newsAdminModal .na-search { flex: 1; min-width: 160px; background: rgba(10,3,20,.8); border: 1px solid rgba(167,139,250,.35); color: #fff; border-radius: 8px; padding: 7px 12px; font-size: .88rem; }
#newsAdminModal .na-btn { border: 1px solid #fbbf24; background: linear-gradient(180deg, #fde68a, #f59e0b); color: #1e0b36; font-weight: 700; padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: .88rem; white-space: nowrap; }
#newsAdminModal .na-btn:hover { box-shadow: 0 0 14px rgba(245,158,11,.6); }
#newsAdminModal .na-btn.ghost { background: rgba(255,255,255,.06); color: #e9d5ff; border-color: rgba(167,139,250,.5); font-weight: 500; }
#newsAdminModal .na-btn.danger { background: rgba(239,68,68,.12); color: #fca5a5; border-color: rgba(239,68,68,.6); font-weight: 500; }

#newsAdminModal .na-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid rgba(245,158,11,.2); background: rgba(10,3,20,.6); }
#newsAdminModal table.na-table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: .88rem; }
#newsAdminModal .na-table th { background: rgba(91,33,182,.35); color: #fde68a; font-weight: 600; padding: 10px; text-align: left; white-space: nowrap; }
#newsAdminModal .na-table td { padding: 10px; border-top: 1px solid rgba(255,255,255,.05); color: #ede9fe; vertical-align: middle; }
#newsAdminModal .na-table tr.is-hidden td { opacity: .5; }
#newsAdminModal .na-table .t-title { font-weight: 600; color: #fff; }
#newsAdminModal .na-table .t-sub { font-size: .78rem; color: #a78bfa; margin-top: 2px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#newsAdminModal .na-table .t-id { color: #c084fc; font-family: monospace; font-weight: 700; }
#newsAdminModal .na-table .t-date { white-space: nowrap; color: #cbd5e1; font-size: .82rem; }
#newsAdminModal .na-tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; color: #fff; white-space: nowrap; }
#newsAdminModal .na-tag.update { background: #0284c7; }
#newsAdminModal .na-tag.event { background: #9333ea; }
#newsAdminModal .na-tag.promo { background: #ea580c; }
#newsAdminModal .na-tag.sched { background: #475569; margin-left: 4px; }
#newsAdminModal .na-actions { display: flex; gap: 6px; flex-wrap: nowrap; }
#newsAdminModal .na-mini { font-size: .78rem; padding: 4px 10px; border-radius: 6px; cursor: pointer; border: 1px solid; background: transparent; white-space: nowrap; }
#newsAdminModal .na-mini.edit { color: #67e8f9; border-color: rgba(103,232,249,.5); }
#newsAdminModal .na-mini.del { color: #fca5a5; border-color: rgba(252,165,165,.5); }
#newsAdminModal .na-mini.ok { color: #86efac; border-color: rgba(134,239,172,.5); }
#newsAdminModal .na-mini:hover { background: rgba(255,255,255,.08); }
#newsAdminModal .na-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: .78rem; color: #c4b5fd; white-space: nowrap; }
#newsAdminModal .na-switch input { accent-color: #f59e0b; width: 16px; height: 16px; cursor: pointer; }
#newsAdminModal .na-empty { text-align: center; padding: 34px; color: #94a3b8; }

/* ฟอร์มแก้ไข */
#newsAdminModal .na-form .row { --bs-gutter-y: 12px; }
#newsAdminModal .na-form label { color: #fde68a; font-size: .85rem; margin-bottom: 4px; display: block; font-weight: 500; }
#newsAdminModal .na-form label small { color: #a78bfa; font-weight: 400; }
#newsAdminModal .na-form input[type=text],
#newsAdminModal .na-form input[type=url],
#newsAdminModal .na-form input[type=datetime-local],
#newsAdminModal .na-form select { width: 100%; background: rgba(10,3,20,.85); border: 1px solid rgba(167,139,250,.4); color: #fff; border-radius: 8px; padding: 8px 12px; font-size: .92rem; }
#newsAdminModal .na-form input:focus, #newsAdminModal .na-form select:focus { outline: none; border-color: #fbbf24; box-shadow: 0 0 0 2px rgba(251,191,36,.2); }
#newsAdminModal .na-form input[type=datetime-local]::-webkit-calendar-picker-indicator { filter: invert(1); }
#newsAdminModal .na-checks { display: flex; gap: 18px; flex-wrap: wrap; padding-top: 6px; }
#newsAdminModal .na-editor-wrap { background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid rgba(245,158,11,.5); }
#newsAdminModal .na-editor-wrap .ql-toolbar.ql-snow { border: none; border-bottom: 1px solid #e5e7eb; background: #f8f5ff; }
#newsAdminModal .na-editor-wrap .ql-container.ql-snow { border: none; font-family: 'Kanit', sans-serif; font-size: 1rem; }
#newsAdminModal .na-editor-wrap .ql-editor { min-height: 300px; max-height: 55vh; overflow-y: auto; color: #1f1235; }
#newsAdminModal .na-editor-wrap .ql-editor img { max-width: 100%; }
#newsAdminModal .na-form-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
#newsAdminModal .na-hint { font-size: .78rem; color: #a78bfa; margin-top: 6px; }
#newsAdminModal .na-uploading { position: absolute; inset: 0; background: rgba(15,6,31,.55); display: none; align-items: center; justify-content: center; color: #fef08a; font-size: .9rem; z-index: 5; }
#newsAdminModal .na-editor-outer { position: relative; }

@media (max-width: 768px) {
  #newsAdminModal .na-stats { grid-template-columns: repeat(3, 1fr); }
  #newsAdminModal .modal-body { padding: 14px; }
}

/* หน้าต่างอ่านข่าวต้องอยู่เหนือแผงแอดมิน (ใช้ตอนกด "ดูตัวอย่าง") */
#roNewsModal { z-index: 100100; }

/* ---------- ปุ่มระบบเสริมในกล่องโปรไฟล์ (FB Share / Rune / Mastery Skill) ---------- */
.sys-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sys-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 4px; border-radius: 10px; text-decoration: none; text-align: center;
  font-size: .78rem; font-weight: 600; line-height: 1.2; color: #fef3c7 !important;
  background: rgba(30, 11, 54, .85); border: 1px solid rgba(251, 191, 36, .45);
  box-shadow: inset 0 0 10px rgba(126, 34, 206, .35); transition: .2s;
}
.sys-btn i { font-size: 1.15rem; }
.sys-btn:hover { transform: translateY(-2px); border-color: #fbbf24; box-shadow: 0 0 14px rgba(245, 158, 11, .45), inset 0 0 10px rgba(126, 34, 206, .45); }
.sys-fb i { color: #60a5fa; }
.sys-rune i { color: #e879f9; }
.sys-skill i { color: #fbbf24; }
