/* /assets/css/glossary.css - ไฟล์ CSS สำหรับหน้า glossary.html */

/* Glossary Page Specific Styles */
.glossary-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 20px;
}

.glossary-header {
  text-align: center;
  margin-bottom: 3rem;
}

.glossary-title {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

[data-theme="dark"] .glossary-title {
  color: var(--text-light);
}

.glossary-description {
  font-size: 1.2rem;
  color: #666;
  max-width: 800px;
  margin: 0 auto;
}

[data-theme="dark"] .glossary-description {
  color: #bdc3c7;
}

/* Search and Filter */
.glossary-search-container {
  background-color: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

[data-theme="dark"] .glossary-search-container {
  background-color: #34495e;
}

.search-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

[data-theme="dark"] .search-title {
  color: var(--text-light);
}

.search-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.search-input {
  flex: 1;
  min-width: 300px;
  padding: 0.8rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background-color: white;
  color: var(--text-dark);
}

[data-theme="dark"] .search-input {
  background-color: #34495e;
  color: var(--text-light);
  border-color: #444;
}

.search-input:focus {
  outline: none;
  border-color: var(--secondary-color);
}

.filter-select {
  padding: 0.8rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background-color: white;
  color: var(--text-dark);
  min-width: 200px;
}

[data-theme="dark"] .filter-select {
  background-color: #34495e;
  color: var(--text-light);
  border-color: #444;
}

.filter-select:focus {
  outline: none;
  border-color: var(--secondary-color);
}

/* Alphabet Navigation */
.alphabet-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 2rem 0;
}

.alphabet-link {
  display: inline-block;
  width: 35px;
  height: 35px;
  line-height: 35px;
  text-align: center;
  background-color: white;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
}

[data-theme="dark"] .alphabet-link {
  background-color: #34495e;
  color: var(--text-light);
  border-color: #444;
}

.alphabet-link:hover {
  background-color: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.alphabet-link.active {
  background-color: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

/* Glossary Terms Grid */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.glossary-term {
  background-color: white;
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  border: 2px solid transparent;
}

[data-theme="dark"] .glossary-term {
  background-color: #34495e;
}

.glossary-term:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.glossary-term.highlighted {
  border-color: var(--secondary-color);
  background-color: #f0f7ff;
}

[data-theme="dark"] .glossary-term.highlighted {
  background-color: #1a237e;
}

.term-header {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--secondary-color);
}

.term-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .term-title {
  color: var(--text-light);
}

.term-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.term-tag {
  padding: 0.3rem 0.8rem;
  background-color: #e3f2fd;
  color: #1976d2;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

[data-theme="dark"] .term-tag {
  background-color: #1a237e;
  color: #bbdefb;
}

.term-definition {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Related Sections */
.related-sections {
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 10px;
  margin-top: 1.5rem;
}

[data-theme="dark"] .related-sections {
  background-color: #2c3e50;
}

.related-title {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--secondary-color);
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.related-link {
  background-color: var(--secondary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.3s;
}

.related-link:hover {
  background-color: #2980b9;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

[data-theme="dark"] .no-results {
  background-color: #34495e;
}

.no-results-icon {
  font-size: 4rem;
  color: #95a5a6;
  margin-bottom: 1rem;
}

.no-results-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

[data-theme="dark"] .no-results-title {
  color: var(--text-light);
}

.no-results-text {
  font-size: 1.1rem;
  color: #666;
}

[data-theme="dark"] .no-results-text {
  color: #bdc3c7;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.page-link {
  display: inline-block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: white;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
}

[data-theme="dark"] .page-link {
  background-color: #34495e;
  color: var(--text-light);
  border-color: #444;
}

.page-link:hover {
  background-color: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.page-link.active {
  background-color: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

/* Term Detail Modal */
.term-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
}

.term-modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 2rem;
  border-radius: 15px;
  width: 90%;
  max-width: 800px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  position: relative;
  animation: modalOpen 0.3s;
  max-height: 90vh;
  overflow-y: auto;
}

[data-theme="dark"] .term-modal-content {
  background-color: #34495e;
}

.term-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--secondary-color);
}

.term-modal-title {
  font-size: 2rem;
  color: var(--primary-color);
}

[data-theme="dark"] .term-modal-title {
  color: var(--text-light);
}

.close-term-modal {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
}

.close-term-modal:hover {
  color: #000;
}

/* Responsive Design */
@media (max-width: 768px) {
  .search-controls {
    flex-direction: column;
  }
  
  .search-input,
  .filter-select {
    min-width: 100%;
  }
  
  .glossary-grid {
    grid-template-columns: 1fr;
  }
  
  .alphabet-link {
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 0.9rem;
  }
  
  .pagination {
    gap: 0.3rem;
  }
  
  .page-link {
    width: 35px;
    height: 35px;
    line-height: 35px;
    font-size: 0.9rem;
  }
}