/* ==========================================
   1. RESET & BASICS
   ========================================== */
* { 
  box-sizing: border-box; 
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: #f8f9fa;
  color: #333333;
  margin: 0;
  padding: 15px;
}

/* Container Utama */
.main-container {
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* ==========================================
   2. HEADER & LOGO
   ========================================== */
.header-logo { 
  text-align: center; 
  margin-bottom: 20px; 
  cursor: pointer; 
}

.header-logo h1 { 
  font-size: 1.8rem; 
  color: #0056b3; 
  margin: 0; 
}

/* Banner Offline */
.offline-banner {
  display: none;
  background-color: #dc3545;
  color: #ffffff;
  text-align: center;
  padding: 10px;
  font-weight: bold;
  border-radius: 6px;
  margin-bottom: 15px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* ==========================================
   3. BANNER INTRODUKSI & TOMBOL ATAS
   ========================================== */
.intro-box {
  background-color: #eef6ff;
  border-left: 4px solid #0056b3;
  padding: 18px;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #2c3e50;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-action-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background-color: #ffffff;
  color: #0056b3;
  border: 1px solid #b8daff;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-action-sm:hover {
  background-color: #0056b3;
  color: #ffffff;
  border-color: #0056b3;
}

/* ==========================================
   4. SEKSI KATEGORI DINAMIS
   ========================================== */
.category-selection-card,
.category-selection-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 25px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.category-selection-card h3,
.category-header h3 {
  margin: 0 0 4px 0;
  font-size: 1.05rem;
  color: #1e293b;
}

.category-selection-card p,
.category-header p {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  color: #64748b;
}

.category-buttons-wrapper,
.category-buttons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.loading-text {
  font-size: 0.85rem;
  color: #888888;
}

/* Style Chip / Tombol Kategori */
.cat-chip,
.cat-btn-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

.cat-chip:hover,
.cat-btn-chip:hover {
  background-color: #0056b3;
  color: #ffffff;
  border-color: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 86, 179, 0.2);
}

.cat-chip.all-btn,
.cat-btn-chip.all-cat {
  background-color: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

.cat-chip.all-btn:hover,
.cat-btn-chip.all-cat:hover {
  background-color: #0284c7;
  color: #ffffff;
}

/* ==========================================
   5. TAB NAVIGASI & FILTER SECTION
   ========================================== */
.tab-container {
  display: flex; 
  gap: 10px; 
  margin-bottom: 20px; 
  border-bottom: 2px solid #eeeeee; 
  padding-bottom: 10px;
}

.tab-btn {
  flex: 1; 
  padding: 10px 15px; 
  border: none; 
  background: #e9ecef; 
  color: #495057;
  font-weight: 600; 
  border-radius: 8px; 
  cursor: pointer; 
  transition: all 0.2s ease;
}

.tab-btn.active { 
  background: #0056b3; 
  color: #ffffff; 
}

/* Filter & Search Bar */
.filter-section { 
  display: flex; 
  gap: 10px; 
  margin-bottom: 20px; 
  flex-wrap: wrap; 
}

.search-input, 
.select-filter {
  padding: 10px 12px; 
  border: 1px solid #ced4da; 
  border-radius: 6px; 
  font-size: 0.95rem; 
  outline: none;
}

.search-input { 
  flex: 2; 
  min-width: 200px; 
}

.select-filter { 
  flex: 1; 
  min-width: 140px; 
}

.hidden-select {
  display: none;
}

/* Path / Breadcrumb Info */
.current-path-info {
  font-size: 0.9rem; 
  color: #6c757d; 
  margin-bottom: 15px; 
  font-weight: 500;
}

/* ==========================================
   6. GRID & CARD KONTEN MEDIA
   ========================================== */
.content-grid {
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
  gap: 20px;
}

.grid-loading-text {
  grid-column: 1 / -1; 
  text-align: center; 
  color: #666666;
}

.card-item {
  border: 1px solid #e0e0e0; 
  border-radius: 10px; 
  overflow: hidden; 
  background: #ffffff;
  display: flex; 
  flex-direction: column; 
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-item:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1); 
}

.card-thumb { 
  width: 100%; 
  height: 160px; 
  object-fit: cover; 
  background: #f1f1f1; 
}

.card-body { 
  padding: 15px; 
  display: flex; 
  flex-direction: column; 
  flex-grow: 1; 
}

.badge-tag {
  display: inline-block; 
  background: #e9ecef; 
  color: #495057; 
  font-size: 0.75rem;
  font-weight: bold; 
  padding: 4px 8px; 
  border-radius: 4px; 
  text-transform: uppercase; 
  margin-bottom: 8px;
}

.card-title { 
  font-size: 0.95rem; 
  font-weight: bold; 
  color: #212529; 
  margin: 0 0 15px 0; 
  line-height: 1.4; 
  flex-grow: 1; 
}

.btn-action {
  display: block; 
  width: 100%; 
  padding: 10px; 
  text-align: center; 
  color: #ffffff;
  text-decoration: none; 
  font-weight: bold; 
  border-radius: 6px; 
  font-size: 0.9rem;
}

.btn-youtube { 
  background-color: #ff0000; 
}

.btn-website { 
  background-color: #007bff; 
}

/* ==========================================
   7. FORM STYLING & DYNAMIC TABS
   ========================================== */
.hidden-tab {
  display: none;
}

.form-group { 
  margin-bottom: 15px; 
}

.form-group label { 
  display: block; 
  margin-bottom: 5px; 
  font-weight: 600; 
  font-size: 0.9rem; 
}

.form-group input, 
.form-group textarea, 
.form-group select {
  width: 100%; 
  padding: 10px; 
  border: 1px solid #ced4da; 
  border-radius: 6px; 
  font-size: 0.95rem;
}

.btn-submit-form {
  width: 100%; 
  padding: 12px; 
  background: #28a745; 
  color: #ffffff; 
  border: none; 
  border-radius: 6px; 
  font-weight: bold; 
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-submit-form:hover {
  background-color: #218838;
}

/* ==========================================
   8. ADSENSE SLOTS
   ========================================== */
.adsense-slot {
  background: #f1f3f5;
  border: 1px dashed #ced4da;
  text-align: center;
  padding: 12px;
  margin: 15px 0;
  font-size: 0.8rem;
  color: #adb5bd;
  border-radius: 6px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.adsense-bottom {
  margin-top: 30px;
}

/* ==========================================
   9. FOOTER
   ========================================== */
.main-footer {
  text-align: center;
  padding: 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  margin-top: 40px;
}

.footer-copy {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0 0 10px 0;
}

.footer-links {
  font-size: 0.85rem;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #475569;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #0056b3;
}

/* ==========================================
   10. MEDIA QUERIES (RESPONSIVE DESIGN)
   ========================================== */
@media (max-width: 600px) {
  .main-container { 
    padding: 12px; 
  }

  .content-grid { 
    grid-template-columns: 1fr; 
  }

  .filter-section { 
    flex-direction: column; 
  }

  .intro-box { 
    font-size: 0.9rem; 
  }

  .top-actions { 
    justify-content: flex-start; 
  }
}