@import url('https://fonts.googleapis.com/css2?family=Kanit&display=swap');

/* main.css */
body {
    font-family: 'Kanit', sans-serif;
    background: #fff;
    color: #1e293b;
}
.container {
  max-width: 1400px;
  width: 100%;
  margin: 40px auto;
  padding: 32px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

table {
  font-size: 0.9rem;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 100%;
  border-collapse: collapse;
  position: relative;
  margin-bottom: 20px;
}

table::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2e7d32, #c0a040);
  border-radius: 16px 16px 0 0;
}

th {
  text-align: left;
  font-weight: 600;
  color: #1e293b;
  background: linear-gradient(135deg, rgba(46, 125, 50, 0.08), rgba(192, 160, 64, 0.08));
  padding: 16px 20px;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  border-bottom: 2px solid rgba(46, 125, 50, 0.15);
  position: relative;
}

td {
  color: #475569;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

tr {
  transition: all 0.3s ease;
}

tr:hover {
  background: linear-gradient(135deg, rgba(46, 125, 50, 0.05), rgba(192, 160, 64, 0.05));
  transform: translateY(-1px);
}

tr:hover td {
  color: #334155;
}

tr:last-child td {
  border-bottom: none;
}

tr:last-child td:first-child {
  border-radius: 0 0 0 16px;
}

tr:last-child td:last-child {
  border-radius: 0 0 16px 0;
}

a.knowless-read {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  padding: 8px 18px;
  color: white;
  border-radius: 40px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
  position: relative;
  overflow: hidden;
  font-family: 'Kanit', sans-serif;
  margin-right: 8px;
}

a.knowless-read::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

a.knowless-read:hover::before {
  left: 100%;
}

a.knowless-read:hover {
  background: linear-gradient(135deg, #1b5e20, #0d1b0d);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(46, 125, 50, 0.4);
}

a.knowless-read:active {
  transform: translateY(0);
}

/* Gold button variant */
a.knowless-read.gold {
  background: linear-gradient(135deg, #c0a040, #9c7a2e);
  box-shadow: 0 4px 15px rgba(192, 160, 64, 0.3);
}

a.knowless-read.gold:hover {
  background: linear-gradient(135deg, #9c7a2e, #7a5d20);
  box-shadow: 0 8px 25px rgba(192, 160, 64, 0.4);
}

/* Status badges */
.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  display: inline-block;
}
/* สีแต่ละประเภท */
.tag-blue    { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.tag-pink    { background: linear-gradient(135deg, #ec4899, #db2777); }
.tag-green   { background: linear-gradient(135deg, #10b981, #059669); }
.tag-orange  { background: linear-gradient(135deg, #f97316, #ea580c); }
.tag-purple  { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.tag-indigo  { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.tag-sky     { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.tag-teal    { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.tag-default { background: #94a3b8; color: white; }

.status-active {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  color: white;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

.status-draft {
  background: linear-gradient(135deg, #c0a040, #9c7a2e);
  color: white;
  box-shadow: 0 2px 8px rgba(192, 160, 64, 0.3);
}

.status-pending {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

/* Category tags */
.category-tag {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  color: white;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

/* Alternative category colors */
.category-tag.gold {
  background: linear-gradient(135deg, #c0a040, #9c7a2e);
  box-shadow: 0 2px 8px rgba(192, 160, 64, 0.3);
}

.category-tag.design {
  background: linear-gradient(135deg, #c0a040, #9c7a2e);
  box-shadow: 0 2px 8px rgba(192, 160, 64, 0.3);
}

.knowless-search {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
  align-items: center;
  justify-content: flex-start;
}

.search-container {
  position: relative;
  flex: 1 1 300px;
  min-width: 240px;
}

.doc-type {
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  text-align: center;
  display: inline-block;
  font-size: 0.8rem;
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tag-green   { background: linear-gradient(135deg, #2e7d32, #1b5e20); }
.tag-gold    { background: linear-gradient(135deg, #c0a040, #9c7a2e); }
.tag-default { background: #94a3b8; color: white; }

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border-radius: 40px;
  border: 2px solid rgba(46, 125, 50, 0.2);
  font-size: 0.95rem;
  font-family: 'Kanit', sans-serif;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  color: #1e293b;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
  transition: 0.3s ease all;
}

.search-input:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 6px 20px rgba(46, 125, 50, 0.2);
}

.search-select {
  padding: 12px 20px;
  border-radius: 40px;
  border: 2px solid rgba(46, 125, 50, 0.2);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  font-size: 0.95rem;
  font-family: 'Kanit', sans-serif;
  color: #1e293b;
  cursor: pointer;
  transition: 0.3s ease all;
  min-width: 180px;
}

.search-select:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 6px 20px rgba(46, 125, 50, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .knowless-search {
    flex-direction: column;
    align-items: stretch;
  }

  .search-container,
  .search-select {
    width: 100%;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  table {
    font-size: 0.85rem;
    border-radius: 12px;
  }
  
  th, td {
    padding: 12px 16px;
  }
  
  a.knowless-read {
    padding: 6px 14px;
    font-size: 0.8rem;
    margin-right: 4px;
    margin-bottom: 4px;
  }
  
  .status-badge {
    font-size: 0.75rem;
    padding: 3px 10px;
  }
  
  .category-tag {
    font-size: 0.7rem;
    padding: 3px 8px;
  }
  
  @media (max-width: 480px) {
    td:last-child {
      white-space: nowrap;
    }
    
    a.knowless-read {
      display: block;
      margin-bottom: 6px;
      text-align: center;
    }
  }
}

/* Table container for horizontal scroll on mobile */
.table-container {
  overflow-x: auto;
  border-radius: 16px;
}

.table-container::-webkit-scrollbar {
  height: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.1);
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #2e7d32, #c0a040);
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #1b5e20, #9c7a2e);
}
/* ================= DARK MODE ================= */
body.dark-mode {
  background: #121212 !important;
  color: #ddd !important;
}

/* Container */
body.dark-mode .container {
  background: rgba(26, 26, 26, 0.95) !important;
  border: 1px solid rgba(192, 160, 64, 0.25) !important;
  box-shadow: 0 15px 40px rgba(192, 160, 64, 0.1) !important;
  color: #eee !important;
}

/* Table */
body.dark-mode table {
  background: rgba(18, 18, 18, 0.95) !important;
  border: 1px solid rgba(192, 160, 64, 0.15) !important;
  box-shadow: 0 10px 30px rgba(192, 160, 64, 0.08) !important;
}

body.dark-mode table::before {
  background: linear-gradient(90deg, #c0a040, #2e7d32) !important;
}

body.dark-mode th {
  background: linear-gradient(135deg, rgba(192, 160, 64, 0.08), rgba(46, 125, 50, 0.08)) !important;
  color: #eee !important;
  border-bottom: 2px solid rgba(192, 160, 64, 0.15) !important;
}

body.dark-mode td {
  color: #ccc !important;
  border-bottom: 1px solid rgba(192, 160, 64, 0.08) !important;
}

body.dark-mode tr:hover {
  background: linear-gradient(135deg, rgba(192, 160, 64, 0.08), rgba(46, 125, 50, 0.08)) !important;
}

body.dark-mode tr:hover td {
  color: #fff !important;
}

/* Links & Buttons */
body.dark-mode a.knowless-read {
  background: linear-gradient(135deg, #c0a040, #9c7a2e) !important;
  color: #121212 !important;
  box-shadow: 0 4px 15px rgba(192, 160, 64, 0.3) !important;
}

body.dark-mode a.knowless-read:hover {
  background: linear-gradient(135deg, #9c7a2e, #7a5d20) !important;
  box-shadow: 0 8px 25px rgba(192, 160, 64, 0.4) !important;
}

body.dark-mode a.knowless-read.gold {
  background: linear-gradient(135deg, #c0a040, #7a5d20) !important;
  color: #121212 !important;
}

/* Status badges */
body.dark-mode .status-active {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
}

body.dark-mode .status-draft {
  background: linear-gradient(135deg, #c0a040, #9c7a2e);
}

body.dark-mode .status-pending {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

/* Category tags */
body.dark-mode .category-tag {
  background: linear-gradient(135deg, #c0a040, #9c7a2e);
  color: #121212 !important;
}

body.dark-mode .category-tag.gold,
body.dark-mode .category-tag.design {
  background: linear-gradient(135deg, #c0a040, #7a5d20);
  color: #121212 !important;
}

/* Search & Select */
body.dark-mode .search-input {
  background: #1a1a1a !important;
  border: 2px solid rgba(192, 160, 64, 0.3) !important;
  color: #eee !important;
}

body.dark-mode .search-input:focus {
  border-color: #c0a040 !important;
  box-shadow: 0 6px 20px rgba(192, 160, 64, 0.2) !important;
}

body.dark-mode .search-select {
  background: #1a1a1a !important;
  border: 2px solid rgba(192, 160, 64, 0.3) !important;
  color: #eee !important;
}

/* Table Scrollbar */
body.dark-mode .table-container::-webkit-scrollbar-track {
  background: rgba(192, 160, 64, 0.08) !important;
}

body.dark-mode .table-container::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #c0a040, #2e7d32) !important;
}
