/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8f9fa;
  min-height: 100vh;
  padding: 24px;
  color: #1a1a2e;
}

/* Container */
.container {
  max-width: 1500px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  padding: 32px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 28px;
}

.header h1 {
  color: #1a1a2e;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.header p {
  color: #6b7280;
  font-size: 0.9rem;
}

/* Mode Tabs */
.mode-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 10px;
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: #6b7280;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: #ffffff;
  color: #1a1a2e;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tab-btn:hover:not(.active) {
  color: #374151;
}

/* Mode Content */
.mode-content {
  display: none;
}

.mode-content.active {
  display: block;
}

/* Form Group */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 0.875rem;
}

.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.875rem;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group select:disabled {
  background-color: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Deskripsi Container */
.deskripsi-container {
  background: #f9fafb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #e5e7eb;
}

.deskripsi-container h3 {
  color: #374151;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Deskripsi Item */
.deskripsi-item {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  align-items: flex-start;
  background: #fff;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.deskripsi-item .number {
  background: #3b82f6;
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.deskripsi-item .selects {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deskripsi-item select {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.8rem;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.deskripsi-item select:focus {
  outline: none;
  border-color: #3b82f6;
}

.deskripsi-item .btn-remove {
  background: transparent;
  color: #9ca3af;
  border: 1px solid #e5e7eb;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.2s;
  flex-shrink: 0;
}

.deskripsi-item .btn-remove:hover {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fecaca;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: #10b981;
  color: white;
}

.btn-secondary:hover {
  background: #059669;
}

.btn-outline {
  background: #fff;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.btn-outline:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.7rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* Hasil Container */
.hasil-container {
  background: #f0fdf4;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #bbf7d0;
}

.hasil-container h3 {
  color: #166534;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.hasil-text {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #374151;
  min-height: 56px;
  border: 1px solid #bbf7d0;
}

.hasil-text .nama {
  font-weight: 700;
  color: #3b82f6;
}

.hasil-text .empty {
  color: #9ca3af;
  font-style: italic;
}

.copy-section {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.copy-section .btn {
  padding: 8px 16px;
  font-size: 0.8rem;
}

.copy-feedback {
  color: #10b981;
  font-weight: 600;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.copy-feedback.show {
  opacity: 1;
}

/* Table Container */
.table-container {
  background: #f9fafb;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e5e7eb;
}

.table-wrapper {
  overflow-x: auto;
}

/* Student Table */
.student-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.student-table th {
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.student-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}

.student-table tbody tr:last-child td {
  border-bottom: none;
}

.student-table tbody tr:hover {
  background: #f9fafb;
}

.student-table .col-no {
  width: 50px;
  text-align: center;
}

.student-table .col-name {
  min-width: 180px;
}

.student-table .col-eskul {
  min-width: 140px;
}

.student-table .col-desc {
  min-width: 300px;
}

.student-table .col-result {
  min-width: 280px;
}

.student-table .col-action {
  width: 80px;
  text-align: center;
}

.student-no {
  background: #3b82f6;
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  margin: 0 auto;
}

.student-name {
  font-weight: 600;
  color: #1a1a2e;
}

.empty-row {
  text-align: center;
  color: #9ca3af;
  font-style: italic;
  padding: 30px !important;
}

/* Table Select */
.table-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.8rem;
  background: #fff;
  cursor: pointer;
}

.table-select:focus {
  outline: none;
  border-color: #3b82f6;
}

/* Deskripsi Row */
.desc-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}

.desc-row:last-child {
  margin-bottom: 0;
}

.desc-row select {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 0.75rem;
  background: #fff;
}

.desc-row select:focus {
  outline: none;
  border-color: #3b82f6;
}

.desc-row .btn-remove-desc {
  background: transparent;
  color: #9ca3af;
  border: 1px solid #e5e7eb;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
}

.desc-row .btn-remove-desc:hover {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fecaca;
}

.add-desc-btn {
  margin-top: 6px;
  padding: 4px 8px;
  font-size: 0.7rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  cursor: pointer;
  color: #374151;
}

.add-desc-btn:hover {
  background: #e5e7eb;
}

.add-desc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Result Cell */
.result-text {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #374151;
  background: #f0fdf4;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #bbf7d0;
}

.result-text .nama {
  font-weight: 700;
  color: #3b82f6;
}

.result-empty {
  color: #9ca3af;
  font-style: italic;
  font-size: 0.8rem;
}

/* Action Buttons */
.action-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.copy-btn {
  padding: 6px 12px;
  font-size: 0.75rem;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.copy-btn:hover {
  background: #059669;
}

.copy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.copy-success {
  color: #10b981;
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.copy-success.show {
  opacity: 1;
}

/* Row Layout */
.row {
  display: flex;
  gap: 16px;
}

.row .form-group {
  flex: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  .container {
    padding: 20px;
  }

  .header h1 {
    font-size: 1.35rem;
  }

  .row {
    flex-direction: column;
    gap: 0;
  }

  .button-group {
    flex-direction: column;
  }

  .button-group .btn {
    width: 100%;
  }
}