body { 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "맑은 고딕", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding: 20px;
  background: #f5f5f5;
  margin: 0;
}

h1 { 
  font-size: 24px; 
  margin-bottom: 10px; 
  margin-top: 60px;
  color: #333;
  font-weight: 600;
}

/* Language buttons in top-right */
.top-right {
  position: absolute;
  right: 20px;
  top: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Language Dropdown */
.lang-dropdown {
  position: relative;
  display: inline-block;
}

.lang-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  background: white;
  color: #333;
  font-size: 13px;
  transition: all 0.3s;
  min-width: 80px;
}

.lang-dropdown-btn:hover {
  background: #f0f0f0;
}

.dropdown-arrow {
  font-size: 10px;
  transition: transform 0.3s;
}

.lang-dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 5px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  z-index: 1000;
  overflow: hidden;
}

.lang-dropdown-menu.show {
  display: block;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lang-option {
  display: block;
  padding: 10px 15px;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

.lang-option:last-child {
  border-bottom: none;
}

.lang-option:hover {
  background: #f8f9fa;
}

.lang-option.active {
  background: #4CAF50;
  color: white;
  font-weight: 600;
}

.lang-option.active:hover {
  background: #45a049;
}

/* Dark mode for language dropdown */
body.dark-mode .lang-dropdown-btn {
  background: #2d2d2d;
  color: #e0e0e0;
  border-color: #404040;
}

body.dark-mode .lang-dropdown-btn:hover {
  background: #383838;
}

body.dark-mode .lang-dropdown-menu {
  background: #2d2d2d;
  border-color: #404040;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark-mode .lang-option {
  color: #e0e0e0;
  border-bottom-color: #404040;
}

body.dark-mode .lang-option:hover {
  background: #383838;
}

body.dark-mode .lang-option.active {
  background: #4CAF50;
  color: white;
}

body.dark-mode .lang-option.active:hover {
  background: #45a049;
}

.lang-btn, .help-btn {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  background: white;
  text-decoration: none;
  color: #333;
  font-size: 13px;
  transition: all 0.3s;
}

.lang-btn:hover, .help-btn:hover {
  background: #f0f0f0;
}

.lang-btn.active {
  background-color: #4CAF50;
  color: white;
  font-weight: bold;
  border-color: #4CAF50;
}

/* Summary panel */
.top-panel {
  border: 1px solid #ddd;
  padding: 20px;
  border-radius: 8px;
  margin: 40px 0 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#summaryText {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.details-btn {
  padding: 8px 16px;
  cursor: pointer;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.2s;
}

.details-btn:hover {
  background: #45a049;
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.controls {
  display: flex;
  gap: 8px;
}

.controls button { 
  padding: 8px 14px; 
  cursor: pointer;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.2s;
}

.controls button:hover {
  background: #f0f0f0;
  border-color: #999;
}

.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.filters select { 
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  font-size: 13px;
  cursor: pointer;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  margin-right: 13px;
}

.filter-checkbox input[type="checkbox"] {
  margin: 0;
}

.filter-checkbox label {
  cursor: pointer;
}

/* Dark mode for filter checkbox */
body.dark-mode .filter-checkbox label {
  color: #e0e0e0;
}

.search-box {
  margin-left: auto;
  font-size: 14px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  font-size: 16px;
  color: #888;
  pointer-events: none;
}

.search-box input { 
  padding: 6px 10px 6px 32px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  width: 200px;
  transition: border-color 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: #4CAF50;
}

/* Table */
table { 
  width: 100%; 
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

th, td { 
  padding: 12px 10px; 
  text-align: left; 
}

th { 
  background: #f8f9fa; 
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #e0e0e0;
  font-size: 13px;
}

td {
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  color: #333;
}

/* Sortable headers */
.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background 0.2s;
}

.sortable:hover {
  background: #e9ecef;
}

.sort-indicator {
  display: inline-block;
  margin-left: 5px;
  font-size: 10px;
  color: #999;
  min-width: 12px;
}

.sort-indicator::after {
  content: '⇅';
}

.sort-indicator.asc::after {
  content: '▲';
  color: #4CAF50;
}

.sort-indicator.desc::after {
  content: '▼';
  color: #4CAF50;
}

tbody tr {
  transition: background 0.2s;
}

tbody tr:hover {
  background: #f8f9fa;
}

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

/* Card image styling with lazy loading - NO FLASHING */
.card-pic { 
  width: 55px; 
  height: 77px; 
  background: linear-gradient(135deg, #ddd 0%, white 100%);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin: 0 auto;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Loading placeholder with icon - NO ANIMATION */
.card-pic:not(.loaded):not(.error)::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  opacity: 0.4;
}

/* Smooth fade in when loaded */
.card-pic.loaded {
  animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0.8;
  }
  to {
    opacity: 1;
  }
}

/* Error state */
.card-pic.error {
  background: linear-gradient(135deg, white 0%, #ddd 100%);
}

.card-pic.error::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  color: #3ac628;
  font-weight: bold;
}

/* Hover effect */
.card-pic:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px #ddd;
  cursor: pointer;
  z-index: 10;
}

/* Checkbox styling with white checkmark */
input[type="checkbox"] {
  min-width: 18px;
  min-height: 18px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 2px solid #ddd;
  border-radius: 4px;
  background: white;
  position: relative;
  transition: all 0.2s ease;
  outline: none;
}

input[type="checkbox"]:hover {
  border-color: #4CAF50;
}

input[type="checkbox"]:checked {
  background: #4CAF50;
  border-color: #4CAF50;
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Modal styles */
.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);
  animation: fadeIn 0.3s;
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 700px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: slideDown 0.3s;
  position: relative;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h2 {
  margin-top: 0;
  color: #333;
  font-size: 22px;
  margin-bottom: 20px;
  padding-bottom: 10px;
}

.close {
  color: #aaa;
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover,
.close:focus {
  color: #333;
}

/* Details modal specific styles */
.missing-summary {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #4CAF50;
  line-height: 1.8;
}

/* Details modal specific styles */
.summary-divider {
  border: none;
  border-top: 1px solid #ddd;
  margin: 10px 0;
}

body.dark-mode .summary-divider {
  border-top-color: #555;
}

.no-cards {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 16px;
}

#helpContent, #detailsContent {
    line-height: 1.6;
    color: #555;
    font-size: 14px;
  }
  
#detailsContent .card-item {
  padding: 12px;
  margin: 8px 0;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid #4CAF50;
}

#detailsContent .card-item strong {
  color: #333;
}

#detailsContent .no-cards {
  text-align: center;
  padding: 20px;
  color: #999;
  font-style: italic;
}


/* Responsive design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  h1 {
    margin-top: 0; /* Add this line - reset margin since top-right becomes static */
  }

  .top-right {
    position: static;
    margin-bottom: 15px;
    justify-content: center;
  }

  .top-panel {
    margin-top: 0;
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .toolbar {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .controls {
    justify-content: space-between;
  }

  .filters {
    flex-wrap: wrap;
  }

  .search-box {
    margin-left: auto;
  }

  .search-box input {
    width: 100%;
  }

  table {
    table-layout: auto;
    font-size: 12px;
  }

  th, td {
    padding: 8px 5px;
  }

  .card-pic {
    width: 40px;
    height: 52px;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
    padding: 20px;
  }
}

/* Print styles */
@media print {
  .top-right,
  .toolbar,
  .details-btn,
  input[type="checkbox"] {
    display: none;
  }

  .top-panel {
    margin-top: 0;
  }

  table {
    box-shadow: none;
  }
}

/* ============================================
   DARK MODE TOGGLE BUTTON
   ============================================ */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;  /* Match other buttons */
  height: auto;       /* Let padding control height */
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  background: white;
  transition: all 0.3s;
}

.theme-toggle:hover {
  background: #f0f0f0;
  transform: scale(1.05);
}

.theme-icon {
  width: 18px;   /* Adjust size as needed */
  height: 18px;  /* Adjust size as needed */
  display: block;
  transition: transform 0.3s;
}


/* ============================================
   DARK MODE STYLES
  ============================================ */

body.dark-mode {
  background: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode h1 {
  color: #e0e0e0;
}

/* Top right buttons */
body.dark-mode .lang-btn,
body.dark-mode .help-btn,
body.dark-mode .theme-toggle {
  background: #2d2d2d;
  color: #e0e0e0;
  border-color: #404040;
}

body.dark-mode .lang-btn:hover,
body.dark-mode .help-btn:hover,
body.dark-mode .theme-toggle:hover {
  background: #383838;
}

body.dark-mode .lang-btn.active {
  background-color: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

/* Top panel */
body.dark-mode .top-panel {
  background: #2d2d2d;
  border-color: #404040;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode #summaryText {
  color: #e0e0e0;
}

body.dark-mode .details-btn {
  background: #4CAF50;
  color: white;
}

body.dark-mode .details-btn:hover {
  background: #45a049;
}

/* Toolbar */
body.dark-mode .toolbar {
  background: #2d2d2d;
  border-color: #404040;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode .controls button {
  background: #383838;
  color: #e0e0e0;
  border-color: #404040;
}

body.dark-mode .controls button:hover {
  background: #454545;
  border-color: #555;
}

body.dark-mode .filters {
  color: #e0e0e0;
}

body.dark-mode .filters select {
  background: #383838;
  color: #e0e0e0;
  border-color: #404040;
}

body.dark-mode .search-box input {
  background: #383838;
  color: #e0e0e0;
  border-color: #404040;
}

body.dark-mode .search-box input::placeholder {
  color: #b0b0b0;
}

body.dark-mode .search-box input:focus {
  border-color: #4CAF50;
}

body.dark-mode .search-icon {
  color: #888;
}

/* Table */
body.dark-mode table {
  background: #2d2d2d;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode th {
  background: #383838;
  color: #e0e0e0;
  border-bottom-color: #404040;
}

body.dark-mode td {
  color: #e0e0e0;
  border-bottom-color: #353535;
}

body.dark-mode .sortable:hover {
  background: #404040;
}

body.dark-mode tbody tr:hover {
  background: #333333;
}

/* Card images in dark mode */
body.dark-mode .card-pic:not(.loaded) {
  background: linear-gradient(135deg, #404040 0%, #2d2d2d 100%);
}

body.dark-mode .card-pic {
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

body.dark-mode .card-pic:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

body.dark-mode .card-pic.error {
  background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
}

/* Checkbox in dark mode */
body.dark-mode input[type="checkbox"] {
  background: #383838;
  border-color: #555;
}

body.dark-mode input[type="checkbox"]:hover {
  border-color: #4CAF50;
}

body.dark-mode input[type="checkbox"]:checked {
  background: #4CAF50;
  border-color: #4CAF50;
}

/* Modal */
body.dark-mode .modal {
  background-color: rgba(0, 0, 0, 0.8);
}

body.dark-mode .modal-content {
  background-color: #2d2d2d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

body.dark-mode .modal-content h2 {
  color: #e0e0e0;
}

body.dark-mode .close {
  color: #888;
}

body.dark-mode .close:hover,
body.dark-mode .close:focus {
  color: #e0e0e0;
}

body.dark-mode .missing-summary {
  background: #383838;
  border-left-color: #4CAF50;
}

body.dark-mode #helpContent,
body.dark-mode #detailsContent {
  color: #e0e0e0;
}

body.dark-mode .no-cards {
  color: #777;
}

body.dark-mode #detailsContent .card-item {
  background: #383838;
  border-left-color: #4CAF50;
}

body.dark-mode #detailsContent .card-item strong {
  color: #e0e0e0;
}

/* Sort indicators in dark mode */
body.dark-mode .sort-indicator {
  color: #888;
}

body.dark-mode .sort-indicator.asc::after,
body.dark-mode .sort-indicator.desc::after {
  color: #4CAF50;
}

.search-icon {
  width: 16px;
  height: 16px;
  display: block;
}

/* Feedback Button */
.feedback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  background: white;
  transition: all 0.3s;
}

.feedback-btn:hover {
  background: #f0f0f0;
  transform: scale(1.05);
}

.feedback-icon {
  width: 18px;
  height: 18px;
  display: block;
}

/* Feedback Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.form-group input[type="email"],
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-group input[type="email"]:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4CAF50;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.cancel-btn,
.submit-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.cancel-btn {
  background: #f0f0f0;
  color: #333;
}

.cancel-btn:hover {
  background: #e0e0e0;
}

.submit-btn {
  background: #4CAF50;
  color: white;
}

.submit-btn:hover {
  background: #45a049;
}

.submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.feedback-status {
  margin-top: 15px;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
  display: none;
}

.feedback-status.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  display: block;
}

.feedback-status.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  display: block;
}

/* Dark mode for feedback */
body.dark-mode .feedback-btn {
  background: #2d2d2d;
  border-color: #404040;
}

body.dark-mode .feedback-btn:hover {
  background: #383838;
}

body.dark-mode .form-group label {
  color: #e0e0e0;
}

body.dark-mode .form-group input[type="email"],
body.dark-mode .form-group textarea {
  background: #383838;
  color: #e0e0e0;
  border-color: #404040;
}

body.dark-mode .form-group input[type="email"]::placeholder,
body.dark-mode .form-group textarea::placeholder {
  color: #999;
  opacity: 1;
}

body.dark-mode .cancel-btn {
  background: #383838;
  color: #e0e0e0;
}

body.dark-mode .cancel-btn:hover {
  background: #454545;
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 40px;
  height: 40px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background-color 0.3s;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.scroll-to-top img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.scroll-to-top:hover {
  background-color: #45A049;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* Dark mode support */
.dark-mode .scroll-to-top {
  background-color: #4CAF50;
}

.dark-mode .scroll-to-top:hover {
  background-color: #45A049;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .scroll-to-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
    font-size: 20px;
  }
  
  .scroll-to-top img {
    width: 20px;
    height: 20px;
  }
}

/* Point Range Expandable Hints */
.point-range-item {
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.point-range-item:hover {
  background: #e9ecef;
}

.point-range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.expand-icon {
  font-size: 12px;
  transition: transform 0.3s;
  color: #999;
}

.point-range-item.expanded .expand-icon {
  transform: rotate(180deg);
}

.hint-box {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-in-out, margin-top 0.2s ease-in-out, opacity 0.2s ease-in-out;
  margin-top: 0;
}

.point-range-item.expanded .hint-box {
  max-height: 10000px;
}

.hint-content {
  padding: 12px;
  background: #f0f0f0;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.2;
  margin: 10px;
}

.hint-content-header{
  margin-bottom: 12px;
}

.combination-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.combination-list li {
  padding: 3px 0;
}

.combination-list li:last-child {
  border-bottom: none;
}

/* Dark mode for hint boxes */
body.dark-mode .point-range-item {
  background: #383838;
  border-left-color: #4CAF50;
}

body.dark-mode .point-range-item:hover {
  background: #444;
}

body.dark-mode .expand-icon {
  color: #999;
}

body.dark-mode .hint-content {
  background: #2d2d2d;
  color: #e0e0e0;
}

/* Icon Button Styles */
.icon-btn {
  padding: 8px 12px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

.control-icon {
  width: 18px;
  height: 18px;
  display: block;
  transition: transform 0.2s, opacity 0.2s;
}

.controls button:disabled {
  cursor: default;
}

.controls button:disabled .control-icon {
  opacity: 0.3;
}

.controls button:not(:disabled):hover .control-icon {
  transform: scale(1.1);
}

/* Specific icon adjustments if needed */
.undo-icon,
.redo-icon {
  width: 18px;
  height: 18px;
}

/* Dark mode disabled buttons */
body.dark-mode .controls button:disabled {
  background: #2a2a2a;
  opacity: 1; /* Keep button visible */
}

body.dark-mode .controls button:disabled .control-icon {
  opacity: 0.3; /* Only dim the icon */
}

body.dark-mode .controls button:disabled:hover {
  background: #2a2a2a;
  border-color: #404040;
}

/* Level Radio Button Styling */
.level-radio {
  width: 24px;
  height: 24px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 2px solid #ddd;
  border-radius: 50%; /* Make it round */
  background: white;
  position: relative;
  transition: all 0.2s ease;
  outline: none;
  margin: 0 auto;
  display: block;
}

/* Show number on all radio buttons */
.level-radio::before {
  content: attr(data-level);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ddd;
  font-size: 10px;
}

.level-radio:hover {
  border-color: #4CAF50;
  transform: scale(1.1);
}

/* Change number color to white when checked */
.level-radio:checked::before {
  color: white;
}

.level-radio:checked {
  background: #4CAF50;
  border-color: #4CAF50;
}

.level-radio:checked::after {
  content: attr(data-level);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 11px;
}

/* Level header styling */
.level-header {
  text-align: center;
  font-weight: 600;
  color: #555;
  padding: 8px 5px !important;
}

.level-header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.level-header-content span {
  font-size: 13px;
}

/* Select all radio button in header */
.select-all-radio {
  width: 24px;
  height: 24px;
}

.select-all-radio:hover {
  transform: scale(1.15);
}

/* Dark mode for radio buttons */
body.dark-mode .level-radio {
  background: #383838;
  border-color: #555;
}

body.dark-mode .level-radio::before {
  color: #555;
}

body.dark-mode .level-radio:hover {
  border-color: #4CAF50;
}

body.dark-mode .level-radio:checked {
  background: #4CAF50;
  border-color: #4CAF50;
}

body.dark-mode .level-header {
  color: #e0e0e0;
}

body.dark-mode .level-radio:checked::before {
  color: white;
}

/* Remove hover effect on level header rows */
body.dark-mode .level-header:hover {
  background: #383838;
}

.level-header:hover {
  background: #f8f9fa;
}

/* Copies Control Column */
.copies-header {
  text-align: center;
  font-weight: 600;
  color: #555;
  padding: 8px 5px !important;
  width: 120px;
}

.copies-header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  padding-right: 30px;
}

.copies-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.copy-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.copy-btn:hover:not(:disabled) {
  background: #4CAF50;
  color: white;
  border-color: #4CAF50;
  transform: scale(1.1);
}

.copy-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.copies-input {
  width: 50px;
  height: 28px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  padding: 0 5px;
  transition: border-color 0.2s;
}

/* Remove default number input spinners */
.copies-input::-webkit-outer-spin-button,
.copies-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.copies-input[type=number] {
  -moz-appearance: textfield; /* Firefox */
  appearance: textfield;
}

.copies-input:focus {
  outline: none;
  border-color: #4CAF50;
}

.copies-input:disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

.copies-hint {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
  text-align: center;
}

/* Dark mode for copies control */
body.dark-mode .copies-header {
  color: #e0e0e0;
}

body.dark-mode .copy-btn {
  background: #383838;
  color: #e0e0e0;
  border-color: #555;
}

body.dark-mode .copy-btn:hover:not(:disabled) {
  background: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

body.dark-mode .copies-input {
  background: #383838;
  color: #e0e0e0;
  border-color: #555;
}

body.dark-mode .copies-input:disabled {
  background: #2a2a2a;
  color: #666;
}

body.dark-mode .copies-input:focus {
  border-color: #4CAF50;
}

body.dark-mode .copies-hint {
  color: #999;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .copies-control {
    flex-direction: column;
    gap: 2px;
  }
  
  .copy-btn {
    width: 100%;
    height: 24px;
  }
  
  .copies-input {
    width: 100%;
    height: 24px;
  }
}

/* Disabled/Uncollectible radio button styling */
.level-radio:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: #ccc;
}

.level-radio:disabled:hover {
  border-color: #ccc;
  transform: none;
}

/* Dark mode for disabled radio buttons */
body.dark-mode .level-radio:disabled {
  opacity: 0.2;
  border-color: #555;
}

body.dark-mode .level-radio:disabled:hover {
  border-color: #555;
  transform: none;
}

/* Disabled copies controls for uncollectible */
.copy-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: #ddd;
}

.copy-btn:disabled:hover {
  background: white;
  color: #333;
  border-color: #ddd;
  transform: none;
}

.copies-input:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Dark mode for disabled copies controls */
body.dark-mode .copy-btn:disabled {
  opacity: 0.3;
  background: #383838;
  color: #666;
  border-color: #555;
}

body.dark-mode .copy-btn:disabled:hover {
  background: #383838;
  color: #666;
  border-color: #555;
  transform: none;
}

body.dark-mode .copies-input:disabled {
  opacity: 0.;
  background: #2a2a2a;
  color: #666;
}

/* Select All Radio Button - Disabled State */
.select-all-radio:disabled {
  opacity: 0.3;
  cursor: not-allowed !important;
  border-color: #ccc;
}

.select-all-radio:disabled:hover {
  border-color: #ccc;
  transform: none;
}

/* Dark mode for disabled select all radio buttons */
body.dark-mode .select-all-radio:disabled {
  opacity: 0.2;
  border-color: #555;
}

body.dark-mode .select-all-radio:disabled:hover {
  border-color: #555;
  transform: none;
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 450px; /* Reduced height */
  margin: 20px 0;
  padding: 15px;
  padding-top: 0px;
  padding-bottom: 0px;
  border-radius: 8px;
}

.chart-wrapper {
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #4CAF50;
  margin-bottom: 20px;
  background: #f8f9fa;
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
}

.chart-legend {
  display: flex;
  justify-content: center;  /* Centers the content horizontally */
  margin-top: 15px;
}

.legend-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;  /* Left-aligns items within the group */
  gap: 15px;
  font-size: 13px;
}

body.dark-mode .chart-wrapper {
  background: #383838;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

/* Dark mode for chart */
body.dark-mode .chart-title {
  color: #e0e0e0;
}

body.dark-mode .legend-item {
  color: #e0e0e0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .chart-container {
    height: 350px;
    padding: 10px;
  }
  
  .chart-legend {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
}

/* Card Details Modal */
.card-details-modal {
  max-width: 600px;
  padding: 20px;
}

.card-details-modal h2 {
  margin-top: 10px;
  color: #333;
  font-size: 20px;
  margin-bottom: 20px;
  padding-bottom: 10px;
}

.card-details-container {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.card-details-image-section {
  flex-shrink: 0;
}

.card-details-image {
  width: 140px;
  height: 196px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-details-info {
  flex: 1;
  min-width: 0;
  min-height: 176px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #4CAF50;
  padding: 15px;
  line-height: 1.8;
  justify-content: center;  /* Centers content vertically */
}

.card-info-line {
  display: flex;
  margin-bottom: 8px;
  font-size: 13px;
}

.card-info-line:last-child {
  margin-bottom: 0;
}

.card-info-label {
  font-weight: 600;
  color: #555;
  min-width: 180px;
  flex-shrink: 0;
}

.card-info-value {
  color: #333;
  word-break: break-word;
}

/* Dark mode for card details modal */
body.dark-mode .card-details-modal h2 {
  color: #e0e0e0;
  border-bottom-color: #4CAF50;
}

body.dark-mode .card-details-image {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark-mode .card-details-info {
  background: #383838;
  border-left-color: #4CAF50;
}

body.dark-mode .card-info-label {
  color: #e0e0e0;
}

body.dark-mode .card-info-value {
  color: #e0e0e0;
}

/* Responsive */
@media (max-width: 768px) {
  .card-details-modal {
    max-width: 95%;
    padding: 15px;
  }
  
  .card-details-container {
    flex-direction: column;
    align-items: center;
  }
  
  .card-details-image {
    width: 132px;
    height: 185px;
  }
  
  .card-details-info {
    width: 100%;
  }
  
  .card-info-line {
    flex-direction: column;
    gap: 2px;
  }
  
  .card-info-label {
    min-width: unset;
  }
}

/* Info Button */
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  background: white;
  transition: all 0.3s;
}

.info-btn:hover {
  background: #f0f0f0;
  transform: scale(1.05);
}

.info-icon {
  width: 18px;
  height: 18px;
  display: block;
}

/* Info Modal Content */
.info-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.info-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.info-section h3 {
  color: #4CAF50;
  font-size: 16px;
  margin-bottom: 10px;
  font-weight: 600;
}

.update-date {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.update-list,
.credits-list {
  padding-left: 20;
  margin: 10px 0;
}

.update-list li,
.credits-list li {
  padding: 6px 0;
  position: relative;
  font-size: 14px;
  color: #555;
  line-height: 1.2;
}

.credits-list li {
  padding-left: 0;
}

.credits-list li::before {
  content: none;
}

.info-section p {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  margin: 10px 0;
}

/* Dark mode for info button and modal */
body.dark-mode .info-btn {
  background: #2d2d2d;
  border-color: #404040;
}

body.dark-mode .info-btn:hover {
  background: #383838;
}

body.dark-mode .info-section {
  border-bottom-color: #404040;
}

body.dark-mode .info-section h3 {
  color: #4CAF50;
}

body.dark-mode .update-date,
body.dark-mode .update-list li,
body.dark-mode .credits-list li,
body.dark-mode .info-section p {
  color: #e0e0e0;
}

/* Instant theme switching - no transitions */
body * {
  transition-property: transform, box-shadow, opacity !important;
  transition-duration: 0.2s !important;
}

/* Remove color/background transitions that cause delay */
body,
body *,
h1, h2, h3, h4, h5, h6, p, span, div,
.top-panel,
.toolbar,
table, th, td,
.modal-content,
.info-section,
.missing-summary,
.hint-content,
.card-details-info {
  transition: none !important;
}

/* Keep only hover/interaction transitions */
.card-pic:hover,
button:hover,
.lang-btn:hover,
.help-btn:hover,
.feedback-btn:hover,
.info-btn:hover,
.theme-toggle:hover,
input:hover,
select:hover {
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s, opacity 0.2s !important;
}

/* Darker separation line every 5 rows */

tbody tr:nth-child(5n) td {
  border-bottom: 1px solid #ccc;
}

body.dark-mode tbody tr:nth-child(5n) td {
  border-bottom: 1px solid #555;
}

/* Settings Dropdown */
.settings-dropdown {
  position: relative;
  display: inline-block;
}

.settings-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  background: white;
  transition: all 0.3s;
}

.settings-dropdown-btn:hover {
  background: #f0f0f0;
}

.settings-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.settings-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 5px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 1000;
  overflow: hidden;
}

.settings-dropdown-menu.show {
  display: block;
  animation: slideDown 0.2s ease-out;
}

.settings-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

.settings-option:last-child {
  border-bottom: none;
}

.settings-option:hover {
  background: #f8f9fa;
}

.option-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.settings-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 5px 0;
}

/* Import Modal */
.import-content {
  margin: 20px 0;
}

.import-instructions p {
  margin-bottom: 10px;
  color: #666;
  font-size: 14px;
}

.import-tips {
  list-style: none;
  padding: 0;
  margin: 15px 0;
  font-size: 13px;
  color: #666;
}

.import-tips li {
  padding: 5px 0;
  padding-left: 20px;
  position: relative;
}

.import-tips li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #4CAF50;
  font-weight: bold;
}

.file-input-area {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #fafafa;
  margin: 20px 0;
}

.file-input-area:hover {
  border-color: #4CAF50;
  background: #f0f8f0;
}

.file-input-area.drag-over {
  border-color: #4CAF50;
  background: #e8f5e9;
  transform: scale(1.02);
}

.file-icon {
  width: 44px;
  height: 44px;
}

.file-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.file-prompt {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.file-hint {
  font-size: 13px;
  color: #999;
}

.selected-file-name {
  text-align: center;
  color: #4CAF50;
  font-size: 13px;
  font-weight: 500;
  margin-top: 10px;
  min-height: 20px;
}

.import-status {
  margin-top: 20px;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
  display: none;
  white-space: pre-line;
}

.import-status.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.import-status.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Temporary Message */
.temporary-message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  max-width: 300px;
}

.temporary-message.show {
  opacity: 1;
  transform: translateY(0);
}

.temporary-message.success {
  background: #4CAF50;
  color: white;
}

.temporary-message.error {
  background: #f44336;
  color: white;
}

/* Dark mode for settings */
body.dark-mode .settings-dropdown-btn {
  background: #2d2d2d;
  border-color: #404040;
}

body.dark-mode .settings-dropdown-btn:hover {
  background: #383838;
}

body.dark-mode .settings-dropdown-menu {
  background: #2d2d2d;
  border-color: #404040;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark-mode .settings-option {
  color: #e0e0e0;
  border-bottom-color: #404040;
}

body.dark-mode .settings-option:hover {
  background: #383838;
}

body.dark-mode .settings-divider {
  background: #404040;
}

body.dark-mode .import-instructions p,
body.dark-mode .import-tips {
  color: #e0e0e0;
}

body.dark-mode .import-tips li::before {
  color: #4CAF50;
}

body.dark-mode .file-input-area {
  background: #383838;
  border-color: #555;
}

body.dark-mode .file-input-area:hover {
  border-color: #4CAF50;
  background: #2d4a2d;
}

body.dark-mode .file-input-area.drag-over {
  border-color: #4CAF50;
  background: #1e3a1e;
}

body.dark-mode .file-prompt {
  color: #e0e0e0;
}

body.dark-mode .file-hint {
  color: #999;
}

body.dark-mode .selected-file-name {
  color: #4CAF50;
}

.export-icon,
.import-icon {
  width: 18px;
  height: 18px;
  display: block;
}

/* Adjust for new column order */
th:nth-child(1), td:nth-child(1) { /* ID */
  width: 70px;
  text-align: center;
  padding: 12px 5px;
}

th:nth-child(2), td:nth-child(2) { /* Image */
  width: 40px;
  text-align: center;
  padding: 12px 5px;
}

th:nth-child(3), td:nth-child(3) { /* Name */
  padding-left: 20px;
}

th:nth-child(6), td:nth-child(6), /* Lv0 */
th:nth-child(7), td:nth-child(7), /* Lv1 */
th:nth-child(8), td:nth-child(8), /* Lv2 */
th:nth-child(9), td:nth-child(9) { /* Lv3 */
  width: 60px;
  text-align: center;
  padding: 12px 5px;
}

th:nth-child(10), td:nth-child(10) { /* Copies */
  width: 140px;
  text-align: center;
  padding: 8px 5px;
  padding-left: 10px;
  padding-right: 30px;
}

/* Export hint button - same style as details-btn */
.export-hint-btn {
  background: #4CAF50;
  color: white;
}

.export-hint-btn:hover {
  background: #45a049;
}

body.dark-mode .export-hint-btn {
  background: #4CAF50;
  color: white;
}

body.dark-mode .export-hint-btn:hover {
  background: #45a049;
}