/* ===== KRUCOMPUTER - Yellow & Black Theme ===== */
:root {
  --yellow: #f0b400;
  --yellow-light: #ffd54f;
  --yellow-dark: #c68a00;
  --black: #1a1a1a;
  --dark: #2d2d2d;
  --gray-dark: #444;
  --gray: #777;
  --gray-light: #eee;
  --white: #fff;
  --bg: #f5f5f5;
  --blue: #2196F3;
  --green: #4CAF50;
  --orange: #FF9800;
  --purple: #9C27B0;
  --red: #F44336;
  --shadow: 0 2px 15px rgba(0,0,0,0.1);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.2);
  --radius: 8px;
  --transition: all 0.3s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Sarabun', sans-serif; background: var(--bg); color: var(--dark); font-size: 16px; line-height: 1.7; }
a { color: var(--yellow-dark); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--yellow); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ===== TOP BAR ===== */
.top-bar { background: var(--black); color: #aaa; font-size: 13px; padding: 6px 0; border-bottom: 2px solid var(--yellow); }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar-left span { margin-right: 20px; }
.top-bar-left i, .top-bar-right i { color: var(--yellow); margin-right: 5px; }
.top-bar-right a { color: #ccc; margin-left: 15px; font-size: 13px; }
.top-bar-right a:hover { color: var(--yellow); }

/* ===== HEADER ===== */
.site-header { background: var(--black); padding: 15px 0; box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.header-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.logo a { display: flex; align-items: center; gap: 15px; text-decoration: none; }
.logo-icon { width: 55px; height: 55px; background: var(--yellow); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--black); flex-shrink: 0; }
.logo-main { display: block; font-size: 26px; font-weight: 800; color: var(--yellow); line-height: 1.2; }
.logo-sub { display: block; font-size: 11px; color: #888; letter-spacing: 2px; }
.header-search { flex: 1; max-width: 500px; }
.header-search form { display: flex; background: #333; border-radius: 30px; overflow: hidden; border: 2px solid #444; transition: var(--transition); }
.header-search form:focus-within { border-color: var(--yellow); }
.header-search input { flex: 1; background: none; border: none; padding: 10px 18px; color: var(--white); font-size: 15px; font-family: 'Sarabun', sans-serif; outline: none; }
.header-search input::placeholder { color: #888; }
.header-search button { background: var(--yellow); border: none; padding: 10px 20px; cursor: pointer; color: var(--black); font-size: 16px; transition: var(--transition); }
.header-search button:hover { background: var(--yellow-light); }
.header-cta { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--yellow); color: var(--black); padding: 10px 22px; border-radius: 30px; font-weight: 700; font-size: 15px; white-space: nowrap; transition: var(--transition); }
.header-cta:hover { background: var(--yellow-light); color: var(--black); transform: translateY(-1px); }
.hamburger { display: none; background: none; border: 2px solid var(--yellow); color: var(--yellow); padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 18px; margin-left: auto; }

/* ===== NAVIGATION ===== */
.main-nav { background: var(--dark); border-bottom: 3px solid var(--yellow); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.nav-menu { display: flex; align-items: center; flex-wrap: wrap; }
.nav-menu > li > a { display: block; color: var(--white); padding: 14px 18px; font-size: 15px; font-weight: 500; transition: var(--transition); position: relative; white-space: nowrap; }
.nav-menu > li > a i { margin-right: 6px; font-size: 13px; }
.nav-menu > li:hover > a, .nav-menu > li > a.active { color: var(--yellow); background: rgba(240,180,0,0.1); }
.nav-menu > li > a::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 0; height: 3px; background: var(--yellow); transition: var(--transition); }
.nav-menu > li:hover > a::after { width: 100%; }
.has-dropdown { position: relative; }
.dropdown { display: none; position: absolute; top: 100%; left: 0; background: var(--dark); border: 1px solid #444; border-top: 3px solid var(--yellow); border-radius: 0 0 8px 8px; min-width: 220px; z-index: 200; box-shadow: var(--shadow-hover); }
.has-dropdown:hover .dropdown { display: block; animation: fadeDown 0.2s ease; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.dropdown li a { display: block; padding: 10px 18px; color: #ccc; font-size: 14px; border-bottom: 1px solid #3a3a3a; }
.dropdown li a:hover { color: var(--yellow); background: rgba(240,180,0,0.08); padding-left: 25px; }
.dropdown li a i { margin-right: 8px; width: 16px; }

/* ===== NEWS TICKER ===== */
.news-ticker { background: var(--yellow); padding: 8px 0; overflow: hidden; }
.ticker-wrap { display: flex; align-items: center; }
.ticker-label { background: var(--black); color: var(--yellow); padding: 4px 15px; border-radius: 3px; font-weight: 700; font-size: 13px; white-space: nowrap; margin-right: 15px; flex-shrink: 0; }
.ticker-content { flex: 1; overflow: hidden; }
.ticker-items { display: flex; animation: ticker 40s linear infinite; white-space: nowrap; }
.ticker-items:hover { animation-play-state: paused; }
.ticker-item { margin-right: 60px; font-size: 14px; font-weight: 500; }
.ticker-item a { color: var(--black); }
.ticker-item a:hover { color: #fff; text-decoration: underline; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ===== MAIN LAYOUT ===== */
.site-main { padding: 25px 0 40px; }
.content-wrapper { display: grid; grid-template-columns: 1fr 320px; gap: 25px; }
.main-content { min-width: 0; }
.sidebar { }

/* ===== SECTION TITLES ===== */
.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 3px solid var(--yellow); }
.section-title .title-icon { background: var(--yellow); color: var(--black); width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.section-title h2 { font-size: 20px; font-weight: 700; color: var(--black); }
.section-title h2 span { color: var(--yellow-dark); }
.section-title .view-all { margin-left: auto; font-size: 13px; color: var(--gray); background: var(--gray-light); padding: 5px 12px; border-radius: 20px; white-space: nowrap; }
.section-title .view-all:hover { background: var(--yellow); color: var(--black); }

/* ===== HERO / FEATURED SLIDER ===== */
.hero-section { margin-bottom: 30px; }
.featured-slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--black); }
.slider-track { display: flex; transition: transform 0.5s ease; }
.slide { min-width: 100%; position: relative; height: 420px; overflow: hidden; }
.slide img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.slide-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.9)); padding: 40px 30px 25px; }
.slide-cat { display: inline-block; background: var(--yellow); color: var(--black); padding: 3px 12px; border-radius: 3px; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.slide-title { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 8px; line-height: 1.4; }
.slide-meta { font-size: 13px; color: #bbb; }
.slider-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(240,180,0,0.9); color: var(--black); border: none; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; transition: var(--transition); z-index: 10; }
.slider-btn:hover { background: var(--yellow); }
.slider-prev { left: 12px; }
.slider-next { right: 12px; }
.slider-dots { position: absolute; bottom: 12px; right: 20px; display: flex; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; transition: var(--transition); border: none; }
.dot.active { background: var(--yellow); transform: scale(1.3); }
.no-featured { background: linear-gradient(135deg, var(--black) 0%, var(--dark) 100%); height: 300px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.no-featured .nf-inner { text-align: center; color: #555; }
.no-featured .nf-inner i { font-size: 60px; color: var(--yellow); opacity: 0.3; display: block; margin-bottom: 15px; }

/* ===== ARTICLE CARDS ===== */
.articles-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.articles-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.articles-grid.cols-1 { grid-template-columns: 1fr; }

.article-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: var(--transition); display: flex; flex-direction: column; border: 1px solid var(--gray-light); }
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--yellow); }
.card-thumb { position: relative; overflow: hidden; height: 200px; background: var(--gray-light); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.article-card:hover .card-thumb img { transform: scale(1.05); }
.card-thumb .no-image { display: flex; align-items: center; justify-content: center; height: 100%; color: #bbb; font-size: 48px; background: linear-gradient(135deg, #f9f9f9, #eeeeee); }
.card-cat { position: absolute; top: 10px; left: 10px; background: var(--yellow); color: var(--black); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 3px; }
.card-featured-badge { position: absolute; top: 10px; right: 10px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 3px; }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 15px; font-weight: 700; color: var(--black); line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title:hover { color: var(--yellow-dark); }
.card-excerpt { font-size: 13px; color: var(--gray); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gray-light); font-size: 12px; color: var(--gray); flex-wrap: wrap; }
.card-meta i { color: var(--yellow); }
.card-meta .views { margin-left: auto; }

/* ===== LIST ARTICLE (Sidebar style) ===== */
.article-list-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--gray-light); }
.article-list-item:last-child { border-bottom: none; }
.list-thumb { width: 75px; height: 60px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: var(--gray-light); }
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-thumb .no-img { display: flex; align-items: center; justify-content: center; height: 100%; color: #ccc; font-size: 22px; }
.list-body { flex: 1; min-width: 0; }
.list-title { font-size: 14px; font-weight: 600; color: var(--dark); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
.list-title:hover { color: var(--yellow-dark); }
.list-meta { font-size: 12px; color: var(--gray); }

/* ===== CATEGORY BOXES ===== */
.cat-boxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 30px; }
.cat-box { background: var(--white); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); transition: var(--transition); border-top: 4px solid transparent; cursor: pointer; }
.cat-box:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.cat-box i { font-size: 32px; margin-bottom: 10px; display: block; }
.cat-box strong { font-size: 14px; color: var(--dark); display: block; }
.cat-box small { font-size: 12px; color: var(--gray); }

/* ===== CATEGORY SECTIONS ===== */
.category-section { background: var(--white); border-radius: var(--radius); padding: 20px; margin-bottom: 25px; box-shadow: var(--shadow); border-left: 5px solid var(--yellow); }

/* ===== SIDEBAR WIDGETS ===== */
.sidebar-widget { background: var(--white); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.widget-title { font-size: 16px; font-weight: 700; color: var(--black); margin-bottom: 15px; padding-bottom: 10px; border-bottom: 3px solid var(--yellow); display: flex; align-items: center; gap: 8px; }
.widget-title i { color: var(--yellow); }

/* ===== SINGLE ARTICLE ===== */
.article-single { background: var(--white); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.article-header { margin-bottom: 25px; }
.article-header .cat-badge { display: inline-block; background: var(--yellow); color: var(--black); padding: 4px 14px; border-radius: 4px; font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.article-header h1 { font-size: 28px; font-weight: 800; color: var(--black); line-height: 1.4; margin-bottom: 15px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 15px; font-size: 13px; color: var(--gray); padding: 12px 0; border-top: 1px solid var(--gray-light); border-bottom: 1px solid var(--gray-light); margin-bottom: 20px; }
.article-meta i { color: var(--yellow); margin-right: 5px; }
.article-featured-img { width: 100%; border-radius: var(--radius); margin-bottom: 25px; max-height: 450px; object-fit: cover; }
.article-content { font-size: 16px; line-height: 1.9; color: #333; }
.article-content h2 { font-size: 22px; font-weight: 700; color: var(--black); margin: 25px 0 12px; padding-left: 15px; border-left: 4px solid var(--yellow); }
.article-content h3 { font-size: 18px; font-weight: 700; margin: 20px 0 10px; }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin: 12px 0 16px 25px; }
.article-content li { margin-bottom: 6px; }
.article-content img { border-radius: var(--radius); box-shadow: var(--shadow); margin: 15px auto; }
.article-content blockquote { background: #fffbea; border-left: 5px solid var(--yellow); padding: 15px 20px; margin: 20px 0; border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; }
.article-content pre, .article-content code { background: #2d2d2d; color: #f8f8f2; border-radius: 6px; }
.article-content code { padding: 2px 8px; font-size: 14px; }
.article-content pre { padding: 20px; overflow-x: auto; margin: 15px 0; }
.article-content pre code { padding: 0; background: none; }
.article-content a { color: var(--yellow-dark); text-decoration: underline; }
.article-content table { width: 100%; border-collapse: collapse; margin: 15px 0; }
.article-content th { background: var(--black); color: var(--yellow); padding: 10px 14px; }
.article-content td { padding: 9px 14px; border-bottom: 1px solid var(--gray-light); }
.article-content tr:hover td { background: #fffbea; }
.article-tags { margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--gray-light); }
.article-tags span { font-weight: 600; margin-right: 10px; }
.tag-badge { display: inline-block; background: var(--gray-light); color: var(--dark); padding: 4px 12px; border-radius: 20px; font-size: 13px; margin: 3px; transition: var(--transition); }
.tag-badge:hover { background: var(--yellow); color: var(--black); }
.share-section { background: var(--bg); border-radius: var(--radius); padding: 20px; margin: 25px 0; }
.share-title { font-weight: 600; margin-bottom: 12px; }
.share-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; border-radius: 6px; color: #fff; font-size: 14px; font-weight: 600; transition: var(--transition); }
.share-btn:hover { opacity: 0.85; transform: translateY(-2px); color: #fff; }
.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.line { background: #00b900; }
.share-btn.copy { background: var(--dark); }

/* ===== COMMENTS ===== */
.comments-section { background: var(--white); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); margin-top: 20px; }
.comment-item { display: flex; gap: 15px; padding: 20px 0; border-bottom: 1px solid var(--gray-light); }
.comment-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--yellow); color: var(--black); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex-shrink: 0; }
.comment-body { flex: 1; }
.comment-author { font-weight: 700; color: var(--black); }
.comment-date { font-size: 12px; color: var(--gray); margin-left: 10px; }
.comment-text { margin-top: 6px; font-size: 15px; color: #333; }
.comment-form textarea { width: 100%; padding: 12px; border: 2px solid var(--gray-light); border-radius: var(--radius); font-family: 'Sarabun', sans-serif; font-size: 15px; resize: vertical; min-height: 100px; transition: var(--transition); }
.comment-form textarea:focus { outline: none; border-color: var(--yellow); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 600; color: var(--dark); margin-bottom: 7px; font-size: 15px; }
.form-control { width: 100%; padding: 11px 15px; border: 2px solid var(--gray-light); border-radius: var(--radius); font-family: 'Sarabun', sans-serif; font-size: 15px; color: var(--dark); background: var(--white); transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(240,180,0,0.15); }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--gray); }
.input-icon .form-control { padding-left: 42px; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 25px; border-radius: var(--radius); font-family: 'Sarabun', sans-serif; font-size: 15px; font-weight: 600; cursor: pointer; border: 2px solid transparent; transition: var(--transition); text-decoration: none; }
.btn-primary { background: var(--yellow); color: var(--black); border-color: var(--yellow); }
.btn-primary:hover { background: var(--yellow-dark); border-color: var(--yellow-dark); color: var(--black); }
.btn-secondary { background: transparent; color: var(--dark); border-color: var(--gray-light); }
.btn-secondary:hover { border-color: var(--yellow); color: var(--yellow-dark); }
.btn-dark { background: var(--black); color: var(--yellow); border-color: var(--black); }
.btn-dark:hover { background: var(--dark); color: var(--yellow); }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }

/* ===== AUTH PAGES ===== */
.auth-page { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-box { background: var(--white); border-radius: 12px; padding: 40px; max-width: 460px; width: 100%; box-shadow: var(--shadow-hover); border-top: 5px solid var(--yellow); }
.auth-logo { text-align: center; margin-bottom: 30px; }
.auth-logo i { font-size: 50px; color: var(--yellow); display: block; margin-bottom: 10px; }
.auth-logo h2 { font-size: 24px; font-weight: 800; color: var(--black); }
.auth-logo p { color: var(--gray); font-size: 14px; }
.auth-divider { text-align: center; position: relative; margin: 20px 0; }
.auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--gray-light); }
.auth-divider span { position: relative; background: var(--white); padding: 0 12px; color: var(--gray); font-size: 13px; }

/* ===== LESSONS ===== */
.lessons-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lesson-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: var(--transition); border-bottom: 4px solid transparent; }
.lesson-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-bottom-color: var(--yellow); }
.lesson-thumb { height: 160px; background: linear-gradient(135deg, var(--black), var(--dark)); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.lesson-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lesson-thumb .file-icon { font-size: 56px; color: var(--yellow); opacity: 0.8; }
.lesson-body { padding: 16px; }
.lesson-title { font-size: 15px; font-weight: 700; color: var(--black); margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lesson-meta { font-size: 12px; color: var(--gray); display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.lesson-badge { display: inline-block; background: #fff8e1; color: var(--yellow-dark); padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; border: 1px solid var(--yellow-light); }
.download-btn { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--yellow); color: var(--black); padding: 9px; border-radius: 0 0 var(--radius) var(--radius); font-weight: 700; font-size: 14px; transition: var(--transition); }
.download-btn:hover { background: var(--yellow-dark); color: var(--white); }

/* ===== MEDIA ===== */
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.media-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: var(--transition); }
.media-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.media-thumb { height: 170px; background: var(--dark); display: flex; align-items: center; justify-content: center; position: relative; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-type-badge { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,0.75); color: #fff; padding: 3px 10px; border-radius: 4px; font-size: 11px; }
.media-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 52px; height: 52px; background: var(--yellow); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--black); opacity: 0.9; }
.media-body { padding: 14px; }
.media-title { font-size: 14px; font-weight: 700; color: var(--dark); margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== ALERTS ===== */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.alert i { font-size: 18px; flex-shrink: 0; }
.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #4CAF50; }
.alert-error { background: #ffebee; color: #c62828; border-left: 4px solid #F44336; }
.alert-warning { background: #fff8e1; color: #f57f17; border-left: 4px solid #FFC107; }
.alert-info { background: #e3f2fd; color: #1565c0; border-left: 4px solid #2196F3; }

/* ===== PAGINATION ===== */
.pagination-nav { margin: 30px 0; text-align: center; }
.pagination { display: inline-flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.pagination li a, .pagination li span { display: block; padding: 8px 14px; border: 2px solid var(--gray-light); border-radius: var(--radius); color: var(--dark); font-size: 14px; transition: var(--transition); }
.pagination li a:hover { border-color: var(--yellow); background: #fffbea; color: var(--yellow-dark); }
.pagination li.active a { background: var(--yellow); border-color: var(--yellow); color: var(--black); font-weight: 700; }
.pagination li.dots span { border: none; color: var(--gray); }

/* ===== BREADCRUMB ===== */
.breadcrumb { font-size: 13px; color: var(--gray); margin-bottom: 20px; padding: 10px 15px; background: var(--white); border-radius: 6px; box-shadow: var(--shadow); }
.breadcrumb a { color: var(--yellow-dark); }
.breadcrumb a:hover { color: var(--yellow); }
.breadcrumb span { margin: 0 8px; color: var(--gray-light); }

/* ===== PROFILE ===== */
.profile-header { background: linear-gradient(135deg, var(--black), var(--dark)); border-radius: var(--radius); padding: 30px; margin-bottom: 25px; display: flex; align-items: center; gap: 25px; box-shadow: var(--shadow); }
.profile-avatar { width: 90px; height: 90px; border-radius: 50%; border: 4px solid var(--yellow); overflow: hidden; flex-shrink: 0; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-placeholder { width: 90px; height: 90px; border-radius: 50%; border: 4px solid var(--yellow); background: var(--yellow); display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 700; color: var(--black); flex-shrink: 0; }
.profile-info h2 { color: var(--yellow); font-size: 24px; }
.profile-info p { color: #aaa; }
.profile-role { display: inline-block; background: var(--yellow); color: var(--black); padding: 2px 10px; border-radius: 3px; font-size: 12px; font-weight: 700; margin-top: 5px; }

/* ===== PAGE HEADER ===== */
.page-header { background: linear-gradient(135deg, var(--black) 0%, #2d2d2d 100%); padding: 40px 0; margin-bottom: 30px; position: relative; overflow: hidden; }
.page-header::after { content: ''; position: absolute; right: -50px; top: -50px; width: 200px; height: 200px; background: var(--yellow); opacity: 0.05; border-radius: 50%; }
.page-header h1 { font-size: 30px; font-weight: 800; color: var(--yellow); display: flex; align-items: center; gap: 12px; }
.page-header p { color: #aaa; margin-top: 6px; }

/* ===== SEARCH PAGE ===== */
.search-hero { background: linear-gradient(135deg, var(--black), var(--dark)); padding: 50px 0; margin-bottom: 30px; text-align: center; }
.search-hero h1 { color: var(--yellow); font-size: 32px; margin-bottom: 20px; }
.search-hero form { display: flex; max-width: 600px; margin: 0 auto; background: #333; border-radius: 50px; overflow: hidden; border: 2px solid #555; }
.search-hero input { flex: 1; background: none; border: none; padding: 14px 24px; color: #fff; font-size: 16px; font-family: 'Sarabun', sans-serif; outline: none; }
.search-hero button { background: var(--yellow); border: none; padding: 14px 30px; color: var(--black); font-size: 16px; cursor: pointer; }

/* ===== BACK TO TOP ===== */
.back-to-top { position: fixed; bottom: 25px; right: 25px; width: 46px; height: 46px; background: var(--yellow); color: var(--black); border: none; border-radius: 50%; cursor: pointer; font-size: 18px; display: none; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(0,0,0,0.3); transition: var(--transition); z-index: 999; }
.back-to-top:hover { background: var(--yellow-dark); transform: translateY(-4px); }
.back-to-top.visible { display: flex; }

/* ===== FOOTER ===== */
.site-footer { background: var(--black); color: #aaa; margin-top: 40px; }
.footer-top { padding: 50px 0 30px; border-top: 4px solid var(--yellow); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer-logo { font-size: 24px; font-weight: 800; color: var(--yellow); margin-bottom: 12px; }
.footer-logo i { margin-right: 8px; }
.footer-col p { font-size: 14px; line-height: 1.8; margin-bottom: 15px; }
.social-links { display: flex; gap: 10px; }
.social-links a { width: 38px; height: 38px; border: 2px solid #444; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #aaa; font-size: 15px; transition: var(--transition); }
.social-links a:hover { border-color: var(--yellow); color: var(--yellow); }
.footer-col h4 { color: var(--yellow); font-size: 16px; margin-bottom: 15px; padding-bottom: 8px; border-bottom: 2px solid #333; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: #aaa; font-size: 14px; transition: var(--transition); }
.footer-col ul li a:hover { color: var(--yellow); padding-left: 5px; }
.footer-col ul li a i { margin-right: 6px; font-size: 12px; }
.footer-bottom { background: #111; padding: 15px 0; text-align: center; border-top: 1px solid #333; }
.footer-bottom p { font-size: 13px; color: #666; }
.footer-bottom a { color: var(--yellow); }

/* ===== LOADING SKELETON ===== */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: skeleton 1.5s infinite; border-radius: 4px; }
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== STATS BAR ===== */
.stats-bar { background: var(--yellow); padding: 18px 0; margin-bottom: 30px; }
.stats-bar .container { display: flex; gap: 0; }
.stat-item { flex: 1; text-align: center; padding: 0 20px; border-right: 1px solid rgba(0,0,0,0.15); }
.stat-item:last-child { border-right: none; }
.stat-num { font-size: 28px; font-weight: 800; color: var(--black); display: block; }
.stat-label { font-size: 13px; color: #555; }

/* ===== BADGE COLORS BY CATEGORY ===== */
.badge-blue { background: #e3f2fd; color: #1565c0; }
.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-orange { background: #fff3e0; color: #e65100; }
.badge-purple { background: #f3e5f5; color: #6a1b9a; }
.badge-red { background: #ffebee; color: #c62828; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .content-wrapper { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .lessons-grid, .media-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .hamburger { display: block; }
  .main-nav .container { padding: 0; }
  .nav-menu { display: none; flex-direction: column; padding: 10px 0; }
  .nav-menu.open { display: flex; }
  .nav-menu > li > a { padding: 12px 20px; border-bottom: 1px solid #3a3a3a; }
  .has-dropdown .dropdown { position: static; box-shadow: none; border: none; border-left: 3px solid var(--yellow); margin-left: 20px; }
  .has-dropdown:hover .dropdown { display: none; }
  .has-dropdown.open .dropdown { display: block; }
  .articles-grid { grid-template-columns: 1fr; }
  .articles-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .cat-boxes { grid-template-columns: 1fr 1fr; }
  .slide { height: 260px; }
  .slide-title { font-size: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .top-bar-left { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 25px; }
  .sidebar { grid-template-columns: 1fr; }
  .header-search { order: 3; width: 100%; }
  .header-inner { flex-wrap: wrap; }
  /* บนจอเล็ก ปุ่มต้องอยู่ข้างแฮมเบอร์เกอร์ ไม่ใช่ดันจนชิดขวาสุด */
  .header-cta { margin-left: auto; order: 2; padding: 8px 16px; font-size: 14px; }
  .hamburger { margin-left: 0; order: 2; }
  .stats-bar .container { flex-wrap: wrap; }
  .stat-item { flex: 0 0 50%; border-right: none; border-bottom: 1px solid rgba(0,0,0,0.1); padding: 10px; }
  .page-header h1 { font-size: 22px; }
  .article-header h1 { font-size: 22px; }
  .profile-header { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .articles-grid.cols-3, .lessons-grid, .media-grid { grid-template-columns: 1fr; }
  .cat-boxes { grid-template-columns: 1fr; }
  .auth-box { padding: 25px 20px; }
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-yellow { color: var(--yellow); }
.text-gray { color: var(--gray); }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mt-20 { margin-top: 20px; }
.hidden { display: none !important; }
.loading { opacity: 0.5; pointer-events: none; }
.nowrap { white-space: nowrap; }

/* ===== CATEGORY TAB BAR ===== */
.cat-tab-bar { background: #fff; border-bottom: 2px solid var(--gray-light); padding: 0; position: sticky; top: 53px; z-index: 90; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.cat-tab-scroll { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 2px; }
.cat-tab-scroll::-webkit-scrollbar { display: none; }
.ctab { display: flex; align-items: center; gap: 6px; padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--gray-dark); white-space: nowrap; border-bottom: 3px solid transparent; transition: var(--transition); flex-shrink: 0; }
.ctab:hover { color: var(--yellow-dark); border-bottom-color: var(--yellow); background: #fffbea; }
.ctab-active { color: var(--yellow-dark); border-bottom-color: var(--yellow); background: #fffbea; }
.ctab i { font-size: 13px; }

/* ===== HOME LAYOUT ===== */
.home-wrap { padding-top: 28px; }

/* ===== FEATURED SECTION ===== */
.feat-sec { margin-bottom: 30px; }
.feat-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; height: 420px; }
.feat-main-card { position: relative; border-radius: 10px; overflow: hidden; display: block; height: 100%; }
.feat-main-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.feat-main-card:hover img { transform: scale(1.04); }
.feat-no-img { width: 100%; height: 100%; background: linear-gradient(135deg,#1a1a1a,#2d2d2d); display: flex; align-items: center; justify-content: center; font-size: 80px; color: rgba(240,180,0,0.25); }
.feat-main-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent 0%,rgba(0,0,0,.88) 100%); padding: 50px 24px 22px; }
.feat-cat-badge { display: inline-block; padding: 3px 12px; border-radius: 4px; font-size: 12px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.feat-main-overlay h2 { font-size: 22px; font-weight: 800; color: #fff; line-height: 1.4; margin-bottom: 8px; }
.feat-meta { font-size: 13px; color: #ccc; }
.feat-meta i { color: var(--yellow); margin-right: 4px; }
.feat-side-stack { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.feat-side-card { display: flex; gap: 10px; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); flex: 1; min-height: 0; transition: var(--transition); }
.feat-side-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.feat-side-img { width: 120px; flex-shrink: 0; position: relative; overflow: hidden; }
.feat-side-img img { width: 100%; height: 100%; object-fit: cover; }
.feat-no-img-sm { width: 100%; height: 100%; background: linear-gradient(135deg,#1a1a1a,#444); display: flex; align-items: center; justify-content: center; font-size: 28px; color: rgba(240,180,0,0.3); }
.feat-cat-sm { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 700; color: #fff; padding: 2px 8px; border-radius: 3px; }
.feat-side-body { flex: 1; padding: 12px 12px 12px 4px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.feat-side-title { font-size: 14px; font-weight: 700; color: var(--black); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 5px; }
.feat-side-card:hover .feat-side-title { color: var(--yellow-dark); }
.feat-side-meta { font-size: 12px; color: var(--gray); }

/* ===== HOME SECTIONS ===== */
.home-sec { background: var(--white); border-radius: 10px; padding: 22px; margin-bottom: 28px; box-shadow: var(--shadow); }
.home-sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--gray-light); }
.hs-icon { width: 38px; height: 38px; background: var(--yellow); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--black); flex-shrink: 0; }
.home-sec-head h2 { font-size: 20px; font-weight: 700; color: var(--black); }
.home-sec-head h2 span { color: var(--yellow-dark); }
.hs-more { margin-left: auto; font-size: 13px; color: var(--gray); background: var(--gray-light); padding: 5px 14px; border-radius: 20px; white-space: nowrap; }
.hs-more:hover { background: var(--yellow); color: var(--black); }
.empty-state { text-align: center; padding: 40px; color: #bbb; }
.empty-state i { font-size: 48px; display: block; margin-bottom: 12px; opacity: .3; }

/* ===== 4-COLUMN ARTICLE GRID ===== */
.arts4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

/* ===== MEMBER GATE ===== */
.member-gate { position: relative; border-radius: 8px; overflow: hidden; }
.gate-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; filter: blur(4px); pointer-events: none; user-select: none; }
.gate-card-blur { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.gcard-img { height: 160px; background: linear-gradient(135deg, #1a1a1a, #3d3d3d); }
.gcard-body { padding: 14px; }
.gcard-line { height: 12px; background: #eee; border-radius: 4px; margin-bottom: 8px; }
.gcard-line.l1 { width: 90%; }
.gcard-line.l2 { width: 70%; }
.gcard-line.l3 { width: 50%; }
.gate-overlay { position: absolute; inset: 0; background: rgba(255,255,255,0.88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.gate-overlay i { font-size: 48px; color: var(--yellow); }
.gate-overlay h3 { font-size: 20px; font-weight: 800; color: var(--black); }
.gate-overlay p { font-size: 14px; color: var(--gray); margin-bottom: 6px; }
.gate-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.gate-btn-login { background: var(--yellow); color: var(--black); padding: 10px 24px; border-radius: 30px; font-weight: 700; font-size: 15px; transition: var(--transition); }
.gate-btn-login:hover { background: var(--yellow-dark); color: var(--black); transform: translateY(-2px); }
.gate-btn-reg { background: transparent; color: var(--dark); border: 2px solid var(--gray-light); padding: 10px 24px; border-radius: 30px; font-weight: 600; font-size: 15px; transition: var(--transition); }
.gate-btn-reg:hover { border-color: var(--yellow); color: var(--yellow-dark); }

/* ===== QUIZ HOME CARDS ===== */
.quiz-home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.quiz-home-card { border: 2px solid var(--gray-light); border-radius: 10px; padding: 20px; transition: var(--transition); display: flex; flex-direction: column; gap: 10px; }
.quiz-home-card:hover { border-color: var(--yellow); box-shadow: 0 4px 20px rgba(240,180,0,0.15); }
.qhc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qhc-cat { background: #fff8e1; color: var(--yellow-dark); padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; border: 1px solid var(--yellow-light); }
.qhc-badge-member { background: #e8f5e9; color: #2e7d32; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.qhc-badge-pub { background: #e3f2fd; color: #1565c0; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.qhc-title { font-size: 17px; font-weight: 700; color: var(--black); line-height: 1.4; }
.qhc-meta { display: flex; gap: 14px; font-size: 13px; color: var(--gray); flex-wrap: wrap; }
.qhc-meta i { color: var(--yellow); margin-right: 4px; }
.qhc-desc { font-size: 13px; color: var(--gray); line-height: 1.5; }
.qhc-btn { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--yellow); color: var(--black); padding: 10px; border-radius: 8px; font-weight: 700; font-size: 15px; transition: var(--transition); margin-top: auto; }
.qhc-btn:hover { background: var(--yellow-dark); color: #fff; }
.quiz-empty-home { text-align: center; padding: 40px; color: #bbb; border: 2px dashed #ddd; border-radius: 10px; }
.quiz-empty-home i { font-size: 48px; display: block; margin-bottom: 14px; opacity: .3; }
.quiz-empty-home a { color: var(--yellow-dark); }

/* ===== QUIZ LIST PAGE ===== */
.quiz-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.quiz-card { background: var(--white); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; transition: var(--transition); display: flex; flex-direction: column; border-top: 4px solid var(--yellow); }
.quiz-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.quiz-card-thumb { height: 160px; background: linear-gradient(135deg,#1a1a1a,#2d2d2d); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.quiz-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.quiz-card-thumb .qthumb-icon { font-size: 60px; color: rgba(240,180,0,0.25); }
.quiz-card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.quiz-card-cat { font-size: 12px; font-weight: 700; color: var(--yellow-dark); background: #fff8e1; padding: 2px 9px; border-radius: 3px; display: inline-block; }
.quiz-card-title { font-size: 16px; font-weight: 700; color: var(--black); line-height: 1.4; }
.quiz-card-meta { display: flex; gap: 12px; font-size: 12px; color: var(--gray); flex-wrap: wrap; }
.quiz-card-meta i { color: var(--yellow); }
.quiz-card-footer { padding: 12px 18px; border-top: 1px solid var(--gray-light); }
.quiz-start-btn { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--yellow); color: var(--black); padding: 10px; border-radius: 7px; font-weight: 700; transition: var(--transition); }
.quiz-start-btn:hover { background: var(--yellow-dark); color: #fff; }
.quiz-start-btn.locked { background: var(--gray-light); color: var(--gray); cursor: not-allowed; }

/* ===== QUIZ TAKE PAGE ===== */
.quiz-take-wrap { max-width: 820px; margin: 0 auto; }
.quiz-header-card { background: var(--black); color: #fff; border-radius: 10px; padding: 24px 28px; margin-bottom: 24px; display: flex; align-items: center; gap: 20px; }
.qh-info { flex: 1; }
.qh-title { font-size: 22px; font-weight: 800; color: var(--yellow); margin-bottom: 6px; }
.qh-meta { display: flex; gap: 16px; font-size: 13px; color: #aaa; flex-wrap: wrap; }
.qh-timer { background: var(--yellow); color: var(--black); border-radius: 10px; padding: 14px 20px; text-align: center; min-width: 90px; flex-shrink: 0; }
.qh-timer .tm-val { font-size: 28px; font-weight: 800; line-height: 1; }
.qh-timer .tm-lbl { font-size: 11px; font-weight: 600; }
.qh-timer.danger { background: var(--red); color: #fff; animation: timerPulse 1s ease-in-out infinite; }
@keyframes timerPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.progress-bar-wrap { background: #eee; border-radius: 20px; height: 8px; margin-bottom: 24px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--yellow); border-radius: 20px; transition: width 0.3s; }
.question-block { background: var(--white); border-radius: 10px; padding: 24px; box-shadow: var(--shadow); margin-bottom: 18px; }
.q-num { font-size: 12px; font-weight: 700; color: var(--yellow-dark); background: #fff8e1; padding: 2px 10px; border-radius: 3px; display: inline-block; margin-bottom: 10px; }
.q-text { font-size: 17px; font-weight: 600; color: var(--black); margin-bottom: 16px; line-height: 1.6; }
.option-list { display: flex; flex-direction: column; gap: 10px; }
.option-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 2px solid var(--gray-light); border-radius: 8px; cursor: pointer; transition: var(--transition); }
.option-item:hover { border-color: var(--yellow); background: #fffbea; }
.option-item input[type=radio] { accent-color: var(--yellow); width: 18px; height: 18px; flex-shrink: 0; }
.option-item.selected { border-color: var(--yellow); background: #fff8e1; }
.option-item.correct { border-color: var(--green); background: #e8f5e9; }
.option-item.wrong { border-color: var(--red); background: #ffebee; }
/* โจทย์และตัวเลือกแบบรูปภาพ */
.q-image { margin-bottom: 16px; }
.q-image img { max-width: 100%; max-height: 420px; border-radius: 8px; border: 1px solid var(--gray-light); display: block; }
.option-item > span { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.option-item .opt-image { max-width: 100%; max-height: 190px; border-radius: 6px; display: block; }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.option-grid .option-item { align-items: flex-start; }
@media (max-width: 600px) { .option-grid { grid-template-columns: 1fr; } }
.quiz-submit-bar { background: var(--white); border-radius: 10px; padding: 20px 24px; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; bottom: 20px; }
.answered-count { font-size: 15px; color: var(--gray); }
.answered-count strong { color: var(--black); }
.quiz-submit-btn { background: var(--yellow); color: var(--black); padding: 12px 32px; border-radius: 8px; font-size: 16px; font-weight: 700; border: none; cursor: pointer; transition: var(--transition); }
.quiz-submit-btn:hover { background: var(--yellow-dark); color: #fff; }

/* ===== QUIZ RESULT PAGE ===== */
.result-wrap { max-width: 800px; margin: 0 auto; }
.result-hero { background: linear-gradient(135deg, var(--black), #2d2d2d); border-radius: 12px; padding: 40px 30px; text-align: center; margin-bottom: 28px; color: #fff; }
.result-score-ring { width: 140px; height: 140px; margin: 0 auto 20px; position: relative; }
.result-score-ring svg { transform: rotate(-90deg); }
.result-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; color: var(--yellow); }
.result-pass { color: #4CAF50; font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.result-fail { color: var(--red); font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.result-sub { font-size: 15px; color: #aaa; }
.result-stats { display: flex; gap: 20px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.rs-item { background: rgba(255,255,255,0.1); border-radius: 8px; padding: 12px 20px; text-align: center; min-width: 90px; }
.rs-val { font-size: 24px; font-weight: 800; color: var(--yellow); }
.rs-lbl { font-size: 12px; color: #aaa; }
.result-answers { background: var(--white); border-radius: 10px; padding: 24px; box-shadow: var(--shadow); }
.ra-item { padding: 18px 0; border-bottom: 1px solid var(--gray-light); }
.ra-item:last-child { border-bottom: none; }
.ra-q { font-size: 16px; font-weight: 600; color: var(--black); margin-bottom: 10px; }
.ra-opt { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; font-size: 14px; margin-bottom: 5px; }
.ra-opt.correct { background: #e8f5e9; color: #2e7d32; }
.ra-opt.wrong { background: #ffebee; color: #c62828; }
.ra-opt.show-correct { background: #e8f5e9; color: #2e7d32; }

/* ===== ADMIN QUIZ FORM ===== */
.question-block-admin { background: #f9f9f9; border: 2px solid #e5e5e5; border-radius: 10px; padding: 20px; margin-bottom: 18px; }
.question-block-admin .q-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.question-block-admin .q-num-lbl { font-weight: 700; color: var(--blk); font-size: 15px; }
.option-row-admin { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.option-row-admin input[type=radio] { accent-color: var(--ya); width: 16px; height: 16px; flex-shrink: 0; }
.correct-label { font-size: 12px; color: #4CAF50; font-weight: 700; margin-left: 4px; }

/* ===== CATEGORY ROW SECTIONS (kruwandee style) ===== */
.cat-row-sec { border-left: 5px solid var(--cat-clr, var(--yellow)); }
.cat-row-layout { display: grid; grid-template-columns: 5fr 4fr; gap: 16px; }

/* Big main card */
.cat-main-card { position: relative; border-radius: 8px; overflow: hidden; display: block; height: 280px; flex-shrink: 0; }
.cat-main-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.cat-main-card:hover img { transform: scale(1.04); }
.cat-no-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 64px; }
.cat-main-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,.86)); padding: 40px 18px 16px; }
.cat-main-badge { display: inline-block; padding: 2px 10px; border-radius: 3px; font-size: 11px; font-weight: 700; color: #fff; margin-bottom: 7px; }
.cat-main-overlay h3 { font-size: 17px; font-weight: 700; color: #fff; line-height: 1.45; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-main-overlay:hover h3 { color: var(--yellow-light); }
.cat-main-meta { font-size: 12px; color: #bbb; }

/* Side list */
.cat-side-list { display: flex; flex-direction: column; gap: 1px; }
.cat-side-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed #eee; align-items: flex-start; transition: background .2s; }
.cat-side-item:last-child { border-bottom: none; }
.cat-side-item:hover { background: #fffbea; border-radius: 6px; padding-left: 6px; margin: 0 -6px; }
.csi-thumb { width: 90px; height: 68px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: #eee; }
.csi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.csi-no-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.csi-body { flex: 1; min-width: 0; }
.csi-title { font-size: 14px; font-weight: 700; color: var(--black); line-height: 1.45; margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-side-item:hover .csi-title { color: var(--yellow-dark); }
.csi-meta { font-size: 12px; color: var(--gray); }
.csi-meta i { margin-right: 3px; }

/* ===== HOME RESPONSIVE ===== */
@media (max-width: 1200px) {
  .arts4 { grid-template-columns: repeat(3, 1fr); }
  .gate-preview { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .feat-layout { grid-template-columns: 1fr; height: auto; }
  .feat-main-card { height: 280px; }
  .feat-side-stack { display: none; }
  .arts4 { grid-template-columns: repeat(2, 1fr); }
  .gate-preview { grid-template-columns: repeat(2, 1fr); }
  .quiz-home-grid { grid-template-columns: 1fr 1fr; }
  .quiz-grid { grid-template-columns: 1fr 1fr; }
  .cat-row-layout { grid-template-columns: 1fr; }
  .cat-main-card { height: 220px; }
}
@media (max-width: 600px) {
  .arts4 { grid-template-columns: 1fr; }
  .gate-preview { grid-template-columns: 1fr 1fr; }
  .quiz-home-grid { grid-template-columns: 1fr; }
  .quiz-grid { grid-template-columns: 1fr; }
  .feat-main-card { height: 220px; }
  .feat-main-overlay h2 { font-size: 16px; }
  .cat-tab-bar { top: 0; }
}
