/* ========================================
   SATIKOMO - Dataset Page Styles
   ======================================== */



/* Dataset Page */
.dataset-page {
  padding: 2rem 0 4rem;
  background: var(--gray-50);
  min-height: calc(100vh - 300px);
}

/* Page Header */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.page-header h1 i {
  color: var(--primary-600);
}

.page-header p {
  font-size: 0.875rem;
  color: var(--gray-500);
  max-width: 800px;
}

/* Dataset Search */
.dataset-search {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  transition: border-color var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--primary-500);
}

.search-box i {
  color: var(--gray-400);
}

.search-box input {
  flex: 1;
  border: none;
  background: none;
  font-size: 0.9375rem;
  color: var(--gray-700);
}

.search-box input:focus {
  outline: none;
}

.search-box input::placeholder {
  color: var(--gray-400);
}

/* Dataset Layout */
.dataset-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}

/* Sidebar */
.dataset-sidebar {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  height: fit-content;
  position: sticky;
  top: 90px;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  background: var(--primary-600);
  color: white;
}

.sidebar-header h3 {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.subject-list {
  padding: 0.5rem;
}

.subject-group {
  border-bottom: 1px solid var(--gray-100);
}

.subject-group:last-child {
  border-bottom: none;
}

.subject-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: var(--radius-md);
}

.subject-toggle:hover {
  background: var(--gray-50);
}

.subject-toggle.active {
  background: var(--primary-50);
}

.subject-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-100);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
  font-size: 0.875rem;
}

.subject-toggle.active .subject-icon {
  background: var(--primary-600);
  color: white;
}

.subject-name {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
}

.subject-toggle.active .subject-name {
  color: var(--primary-700);
}

.toggle-icon {
  font-size: 0.625rem;
  color: var(--gray-400);
  transition: transform var(--transition-fast);
}

.subject-toggle.active .toggle-icon {
  transform: rotate(180deg);
  color: var(--primary-600);
}

/* Subject Submenu */
.subject-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.subject-submenu.active {
  max-height: 500px;
}

.subject-submenu li a {
  display: block;
  padding: 0.625rem 1rem 0.625rem 3.25rem;
  font-size: 0.8125rem;
  color: var(--gray-600);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.subject-submenu li a::before {
  content: "";
  position: absolute;
  left: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: var(--gray-400);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.subject-submenu li a:hover {
  background: var(--gray-50);
  color: var(--primary-600);
}

.subject-submenu li a:hover::before {
  background: var(--primary-500);
}

.subject-submenu li a.active {
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 600;
}

.subject-submenu li a.active::before {
  background: var(--primary-600);
  width: 6px;
  height: 6px;
}

/* Dataset Main */
.dataset-main {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Dataset Tabs */
.dataset-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
}

.dataset-tabs .tab-btn {
  flex: 1;
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.dataset-tabs .tab-btn:hover {
  color: var(--gray-700);
  background: var(--gray-50);
}

.dataset-tabs .tab-btn.active {
  color: var(--primary-600);
  border-bottom-color: var(--primary-600);
  background: var(--primary-50);
}

/* Tab Content */
.dataset-main .tab-content {
  display: none;
  padding: 1.5rem;
}

.dataset-main .tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Category Info */
.category-info {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.category-info h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.category-info p {
  font-size: 0.875rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.filter-left select {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--gray-700);
  background: white;
  cursor: pointer;
}

.filter-left select:focus {
  outline: none;
  border-color: var(--primary-500);
}

.filter-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-table {
  position: relative;
}

.search-table input {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  width: 220px;
  transition: all var(--transition-fast);
}

.search-table input:focus {
  outline: none;
  border-color: var(--primary-500);
  width: 260px;
}

.search-table i {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 0.75rem;
}

/* Data Table */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.data-table thead {
  background: var(--gray-50);
}

.data-table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.data-table th i {
  margin-left: 0.25rem;
  color: var(--gray-400);
  cursor: pointer;
}

.data-table th i:hover {
  color: var(--primary-600);
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: top;
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

.data-table tbody tr.dataset-row {
  transition: all var(--transition-fast);
}

.data-table tbody tr.dataset-row:hover {
  background: var(--primary-50);
  box-shadow: inset 3px 0 0 var(--primary-500);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.col-no {
  width: 50px;
  text-align: center;
}

.col-title {
  min-width: 400px;
}

.col-date {
  width: 140px;
  white-space: nowrap;
}

.col-action {
  width: 100px;
  text-align: center;
}

.data-table td.col-no {
  color: var(--gray-500);
  font-weight: 500;
}

.data-table td.col-title {
  color: var(--primary-700);
  font-weight: 500;
}

.data-table td.col-title:hover {
  color: var(--primary-800);
  cursor: pointer;
}

.data-table td.col-date {
  color: var(--gray-500);
}

/* Action Buttons */
.action-btns {
  display: flex;
  gap: 0.375rem;
  justify-content: center;
}

.action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.action-btn.view {
  background: var(--primary-50);
  color: var(--primary-600);
}

.action-btn.view:hover {
  background: var(--primary-600);
  color: white;
}

.action-btn.download {
  background: var(--gray-100);
  color: var(--gray-600);
}

.action-btn.download:hover {
  background: var(--gray-600);
  color: white;
}

/* Pagination */
.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
  flex-wrap: wrap;
  gap: 1rem;
}

.pagination-info {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.pagination-info span {
  font-weight: 600;
  color: var(--gray-700);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: white;
  color: var(--gray-600);
  font-size: 0.8125rem;
  transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-btn.active {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: white;
}

.page-btn.prev,
.page-btn.next {
  font-size: 0.625rem;
}

/* Publications Grid */
.publications-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.publication-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
}

.publication-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-300);
  transform: translateY(-2px);
}

.publication-card:hover .pub-title {
  color: var(--primary-600);
}

.pub-cover {
  height: 160px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pub-cover i {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.3);
}

.pub-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.625rem;
  background: var(--accent-500);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.pub-content {
  padding: 1rem;
}

.pub-category {
  font-size: 0.6875rem;
  color: var(--primary-600);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.375rem;
}

.pub-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.4;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pub-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.6875rem;
  color: var(--gray-400);
  margin-bottom: 0.75rem;
}

.pub-actions {
  display: flex;
  gap: 0.5rem;
}

.pub-actions .btn {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.6875rem;
}

/* Responsive */
@media (max-width: 1200px) {
  .dataset-layout {
    grid-template-columns: 280px 1fr;
  }

  .publications-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .dataset-layout {
    grid-template-columns: 1fr;
  }

  .dataset-sidebar {
    position: static;
  }

  .publications-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dataset-search {
    flex-direction: column;
  }

  .dataset-search .btn {
    width: 100%;
  }

  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-table input,
  .search-table input:focus {
    width: 100%;
  }

  .pagination-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .publications-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 0.75rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.625rem 0.75rem;
  }

  .col-title {
    min-width: 250px;
  }
}

@media (max-width: 480px) {
  .page-header h1 {
    font-size: 1.375rem;
  }

  .dataset-tabs .tab-btn {
    padding: 0.875rem 0.5rem;
    font-size: 0.75rem;
  }

  .subject-toggle {
    padding: 0.75rem;
  }

  .subject-name {
    font-size: 0.75rem;
  }

  .subject-submenu li a {
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    font-size: 0.75rem;
  }

  .subject-submenu li a::before {
    left: 1.25rem;
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state i {
  font-size: 3rem;
  color: var(--gray-300);
  margin-bottom: 1rem;
}

.empty-state h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

/* Loading State */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loading-spinner .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner .spinner-text {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Skeleton Loader */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 37%, #f0f0f0 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 4px;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.skeleton-row .skeleton-no {
  width: 30px;
  height: 16px;
}

.skeleton-row .skeleton-title {
  flex: 1;
  height: 16px;
}

.skeleton-row .skeleton-date {
  width: 100px;
  height: 16px;
}

.skeleton-row .skeleton-action {
  width: 60px;
  height: 24px;
}

@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
