/* Base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: #f9fafb;
  transition: background-color 0.3s, color 0.3s;
}

/* Dark mode */
.dark body,
body.dark {
  background-color: #111827;
  color: #f3f4f6;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.header-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.dark .title {
  color: #ffffff;
}

.subtitle {
  color: #6b7280;
  margin: 0;
}

.dark .subtitle {
  color: #9ca3af;
}

/* Dark mode toggle */
.dark-toggle {
  padding: 0.5rem;
  border-radius: 0.5rem;
  background-color: #e5e7eb;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: #374151;
}

.dark .dark-toggle svg {
  stroke: #e5e7eb;
}

.dark-toggle:hover {
  background-color: #d1d5db;
}

.dark .dark-toggle {
  background-color: #374151;
}

.dark .dark-toggle:hover {
  background-color: #4b5563;
}

/* Loading */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 0;
}

.spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  margin-left: 0.75rem;
  color: #6b7280;
}

.dark .loading-text {
  color: #9ca3af;
}

/* Error */
.error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  color: #dc2626;
}

.dark .error {
  background-color: rgba(127, 29, 29, 0.3);
  border-color: #991b1b;
  color: #f87171;
}

/* Controls */
.controls {
  margin-bottom: 1rem;
}

.controls-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
  .controls-row {
    flex-direction: row;
  }
}

.search-input {
  flex: 1;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  color: #374151;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.dark .search-input {
  background-color: #1f2937;
  border-color: #4b5563;
  color: #e5e7eb;
}

.status-filter {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  color: #374151;
  font-size: 0.875rem;
  cursor: pointer;
}

.dark .status-filter {
  background-color: #1f2937;
  border-color: #4b5563;
  color: #e5e7eb;
}

.controls-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: #6b7280;
}

.dark .controls-info {
  color: #9ca3af;
}

.reset-btn {
  background: none;
  border: none;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
}

.dark .reset-btn {
  color: #60a5fa;
}

/* Table */
.table-container {
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.dark .table-container {
  background-color: #1f2937;
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background-color: #2563eb;
  color: #ffffff;
  position: sticky;
  top: 0;
}

.dark .data-table thead {
  background-color: #1e40af;
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}

.data-table th:hover {
  background-color: #1d4ed8;
}

.dark .data-table th:hover {
  background-color: #1e3a8a;
}

.data-table td {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: #374151;
  vertical-align: top;
}

.dark .data-table td {
  color: #d1d5db;
}

.data-table tbody tr {
  transition: background-color 0.2s;
}

.data-table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

.dark .data-table tbody tr:nth-child(even) {
  background-color: #111827;
}

.data-table tbody tr:hover {
  background-color: #eff6ff;
}

.dark .data-table tbody tr:hover {
  background-color: #374151;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-submitted {
  background-color: #fef3c7;
  color: #92400e;
}
.dark .status-submitted {
  background-color: rgba(146, 64, 14, 0.5);
  color: #fcd34d;
}

.status-accepted {
  background-color: #d1fae5;
  color: #065f46;
}
.dark .status-accepted {
  background-color: rgba(6, 95, 70, 0.5);
  color: #6ee7b7;
}

.status-rejected {
  background-color: #fee2e2;
  color: #991b1b;
}
.dark .status-rejected {
  background-color: rgba(153, 27, 27, 0.5);
  color: #fca5a5;
}

.status-revision {
  background-color: #ffedd5;
  color: #9a3412;
}
.dark .status-revision {
  background-color: rgba(154, 52, 18, 0.5);
  color: #fdba74;
}

.status-published {
  background-color: #dbeafe;
  color: #1e40af;
}
.dark .status-published {
  background-color: rgba(30, 64, 175, 0.5);
  color: #93c5fd;
}

.status-review {
  background-color: #ede9fe;
  color: #5b21b6;
}
.dark .status-review {
  background-color: rgba(91, 33, 182, 0.5);
  color: #c4b5fd;
}

.status-default {
  background-color: #f3f4f6;
  color: #374151;
}
.dark .status-default {
  background-color: #374151;
  color: #d1d5db;
}

/* Column widths */
.col-nama { min-width: 80px; }
.col-jurnal { min-width: 45px; max-width: 45px; }
.col-id-jurnal { min-width: 90px; }
.col-tanggal { min-width: 85px; white-space: nowrap; }
.col-nama-jurnal { min-width: 120px; }
.col-nama-artikel { min-width: 180px; }
.col-status { min-width: 85px; }

/* Footer */
.footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.875rem;
  color: #9ca3af;
}

.dark .footer {
  color: #6b7280;
}

.refresh-btn {
  margin-top: 0.5rem;
  background: none;
  border: none;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
}

.dark .refresh-btn {
  color: #60a5fa;
}

.refresh-btn:hover {
  color: #1d4ed8;
}

.dark .refresh-btn:hover {
  color: #93c5fd;
}

/* Utility */
.hidden {
  display: none !important;
}
