/* Import Google Font - Sarabun */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');
/* Reset และ Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Sarabun', sans-serif;
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  min-height: 100vh;
  padding: 20px;
  line-height: 1.8;
  color: #333;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
}
/* Header */
.site-header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.site-header h1 {
  font-size: 2.5em;
  margin-bottom: 5px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  font-weight: 600;
}
.tagline {
  font-size: 1.1em;
  opacity: 0.95;
  font-weight: 300;
}
/* Toolbar */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
/* Buttons */
.button-primary,
.button-secondary,
.button-edit,
.button-delete,
.button-view,
.button-search,
.button-clear {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1em;
  font-family: 'Sarabun', sans-serif;
}
.button-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #075985 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}
.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}
.button-secondary {
  background: white;
  color: #0ea5e9;
  border: 2px solid #0ea5e9;
}
.button-secondary:hover {
  background: #0ea5e9;
  color: white;
}
.button-edit {
  background: #f59e0b;
  color: white;
}
.button-edit:hover {
  background: #d97706;
}
.button-delete {
  background: #ef4444;
  color: white;
}
.button-delete:hover {
  background: #dc2626;
}
.button-view {
  background: #10b981;
  color: white;
}
.button-view:hover {
  background: #059669;
}
.button-search {
  background: #0ea5e9;
  color: white;
}
.button-search:hover {
  background: #0284c7;
}
.button-clear {
  background: #6b7280;
  color: white;
  padding: 12px 20px;
}
.button-clear:hover {
  background: #4b5563;
}
/* Search and Filter */
.search-filter {
  background: white;
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.search-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.search-input {
  flex: 2;
  min-width: 200px;
  padding: 12px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 1em;
  font-family: 'Sarabun', sans-serif;
  transition: border-color 0.3s ease;
}
.search-input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}
.category-select {
  flex: 1;
  min-width: 150px;
  padding: 12px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 1em;
  background: white;
  font-family: 'Sarabun', sans-serif;
  transition: border-color 0.3s ease;
}
.category-select:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}
.search-result {
  background: #dbeafe;
  border-left: 4px solid #0ea5e9;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  color: #075985;
  font-weight: 400;
}
/* Articles Container */
.articles-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
/* Article Card */
.article-card {
  background: white;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}
.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}
.article-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  gap: 10px;
}
.article-title {
  font-size: 1.5em;
  margin: 0;
  flex: 1;
  font-weight: 600;
}
.article-title a {
  color: #1e293b;
  text-decoration: none;
  transition: color 0.3s ease;
}
.article-title a:hover {
  color: #0ea5e9;
}
.category-badge {
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  color: white;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.85em;
  font-weight: 500;
  white-space: nowrap;
}
.article-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  font-size: 0.9em;
  color: #64748b;
  flex-wrap: wrap;
  font-weight: 400;
}
.article-excerpt {
  color: #475569;
  line-height: 1.8;
  margin-bottom: 20px;
  font-weight: 300;
}
.article-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.article-actions a,
.article-actions button {
  flex: 1;
  min-width: 80px;
  text-align: center;
  padding: 10px 15px;
  font-size: 0.9em;
}
/* No Articles */
.no-articles {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 15px;
}
.no-articles-icon {
  font-size: 4em;
  margin-bottom: 20px;
}
.no-articles h3 {
  font-size: 1.5em;
  margin-bottom: 10px;
  color: #64748b;
  font-weight: 600;
}
.no-articles p {
  color: #94a3b8;
  font-weight: 300;
}
.no-articles a {
  color: #0ea5e9;
  text-decoration: none;
  font-weight: 500;
}
/* Article Full View */
.article-full {
  background: white;
  border-radius: 15px;
  padding: 40px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}
.article-full-header {
  border-bottom: 3px solid #f1f5f9;
  padding-bottom: 20px;
  margin-bottom: 30px;
}
.article-full-title {
  font-size: 2.5em;
  margin-bottom: 15px;
  color: #1e293b;
  font-weight: 600;
}
.article-full-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.95em;
  color: #64748b;
  font-weight: 400;
}
.article-full-content {
  font-size: 1.1em;
  line-height: 1.9;
  color: #334155;
  font-weight: 300;
}
.article-navigation {
  text-align: center;
}
/* Form Styles */
.form-container {
  background: white;
  border-radius: 15px;
  padding: 40px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.article-form {
  max-width: 800px;
  margin: 0 auto;
}
.form-group {
  margin-bottom: 25px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #1e293b;
}
.required {
  color: #ef4444;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 1em;
  font-family: 'Sarabun', sans-serif;
  transition: all 0.3s ease;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}
.form-textarea {
  resize: vertical;
  min-height: 200px;
  line-height: 1.8;
}
.form-hint {
  font-size: 0.85em;
  color: #94a3b8;
  margin-top: 5px;
  font-weight: 300;
}
.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}
.form-actions button,
.form-actions a {
  flex: 1;
  text-align: center;
}
/* Messages */
.message {
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-weight: 400;
}
.message.success {
  background: #d1fae5;
  border-left: 4px solid #10b981;
  color: #065f46;
}
.message.error {
  background: #fee2e2;
  border-left: 4px solid #ef4444;
  color: #991b1b;
}
.message-link {
  color: inherit;
  text-decoration: underline;
  margin-left: 10px;
  font-weight: 500;
}
/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  .site-header h1 {
    font-size: 1.8em;
  }
  .articles-container {
    grid-template-columns: 1fr;
  }
  .article-card {
    padding: 20px;
  }
  .article-full {
    padding: 25px;
  }
  .article-full-title {
    font-size: 1.8em;
  }
  .form-container {
    padding: 25px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .search-form {
    flex-direction: column;
  }
  .search-input,
  .category-select {
    width: 100%;
  }
  .toolbar {
    flex-direction: column;
  }
  .toolbar a,
  .toolbar button {
    width: 100%;
    text-align: center;
  }
}
/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.article-card,
.message {
  animation: fadeIn 0.5s ease;
}
/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #0ea5e9;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #0284c7;
}