/* ============================================================
   Style.css — Stylesheet ของหน้า Home (index)
   โครงสร้าง:
   1. Reset & Base
   2. Page Wrapper
   3. Banner Section
   4. Top Bar
   5. Content Area
   6. Box Grid & Cards
   7. Responsive (Media Queries)
============================================================ */


/* ============================================================
   1. RESET & BASE
============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  background: #101010; /* ✏️ สี Background หลักของหน้าเว็บ */
  color: #f0f0f0;
}


/* ============================================================
   2. PAGE WRAPPER
============================================================ */
.page-wrapper {
  width: 100%;
}


/* ============================================================
   3. BANNER SECTION
============================================================ */
.banner-section {
  position: relative;
  width: 100%;
  height: 260px; /* ✏️ ความสูง Banner */
  overflow: hidden;
}

/* สไลด์รูปพื้นหลัง — สร้างโดย Basic.js */
.banner-slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out; /* ✏️ ความเร็ว fade */
}

.banner-slide.active {
  opacity: 1;
}

/* Text กลาง Banner — คงที่ ไม่เปลี่ยนตามสไลด์ */
.banner-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  text-align: center;
  pointer-events: none;
  width: 90%;
}

.banner-title {
  font-size: clamp(16px, 4vw, 22px);
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.banner-subtitle {
  font-size: clamp(12px, 2.5vw, 14px);
  color: rgba(255, 255, 255, 0.85);
  margin-top: 6px;
}


/* ============================================================
   4. TOP BAR
============================================================ */
.top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
  padding: 0 1.25rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* --- ซ้าย: Logo --- */
.top-bar-left {
  flex-shrink: 0;
}

.logo-box {
  width: 55px;
  height: 55px;
  border-radius: 8px;
  display: block;
  object-fit: contain;
}

/* --- กลาง: Nav --- */
.top-bar-center {
  display: flex;
  align-items: center;
  gap: 4px; /* ✏️ ระยะห่างปุ่ม — ลดถ้าเพิ่มปุ่มมาก */
  flex: 1;
  justify-content: center;
}

.nav-btn {
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 400;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.nav-btn a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  display: block;
}

.nav-btn:hover,
.nav-btn.active-nav {
  background: rgba(255, 255, 255, 0.15);
}

.nav-btn:hover a,
.nav-btn.active-nav a {
  color: #fff;
}

/* --- ขวา: Follow --- */
.top-bar-right {
  flex-shrink: 0;
}

.follow-btn {
  background: #fff;
  border: none;
  color: #111;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.follow-btn:hover {
  opacity: 0.85;
}


/* ============================================================
   5. CONTENT AREA
============================================================ */
.content-area {
  padding: 1.25rem 1rem;
}


/* ============================================================
   6. BOX GRID & CARDS
============================================================ */
.box-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.box-card {
  background: #1a1a1a;
  border: 0.5px solid #2a2a2a;
  border-radius: 12px;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 130px;
}

.box-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* ✏️ สีไอคอนแต่ละกล่อง */
.icon-purple { background: #2a2560; color: #9d97e8; }
.icon-green  { background: #0d3328; color: #3ecf98; }
.icon-blue   { background: #0d2540; color: #5aabf0; }
.icon-orange { background: #3a1a0d; color: #e8845a; }

.box-card h3 {
  font-size: 15px;
  font-weight: 500;
  color: #f0f0f0;
  margin-top: 4px;
}

.box-card p {
  font-size: 13px;
  color: #888;
  line-height: 1.6;
}


/* ============================================================
   7. RESPONSIVE
============================================================ */
@media (max-width: 768px) {
  .box-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .banner-section  { height: 200px; }
  .top-bar         { padding: 0 0.75rem; height: 50px; }
  .nav-btn         { padding: 5px 10px; font-size: 13px; }
  .follow-btn      { padding: 6px 12px; font-size: 12px; }
  .box-grid        { grid-template-columns: 1fr; }
}
