:root {
  --primary: #e3c08d;
  --secondary: #2c3e50;
  --accent: #e74c3c;
  --bg-deep: oklch(20% 0.02 260);
  --bg-card: oklch(25% 0.03 260 / 0.8);
  --text-main: #f5f5f5;
  --text-dim: #a0a0a0;
  --border: oklch(35% 0.03 260 / 0.5);
  --glass: blur(12px);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Pretendard', sans-serif;
  background-color: var(--bg-deep);
  background-image: radial-gradient(circle at 50% 50%, oklch(25% 0.02 260) 0%, var(--bg-deep) 100%);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header & Search */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

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

.logo i {
  color: var(--primary);
  width: 32px;
  height: 32px;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
}

.logo h1 span {
  color: var(--primary);
}

.search-wrapper {
  flex: 1;
  min-width: 300px;
  max-width: 500px;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(227, 192, 141, 0.2);
}

.search-bar i {
  color: var(--text-dim);
  width: 20px;
  margin-right: 0.75rem;
}

.search-bar input {
  background: none;
  border: none;
  color: var(--text-main);
  width: 100%;
  font-size: 1rem;
  outline: none;
}

/* Tabs */
.category-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.tab-btn:hover {
  background: oklch(30% 0.03 260);
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--primary);
  color: var(--bg-deep);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(227, 192, 141, 0.3);
}

/* Table */
.table-container {
  background: var(--bg-card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
  padding: 1.25rem 1.5rem;
}

td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

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

tr.expandable-row {
  cursor: pointer;
  transition: background 0.2s ease;
}

tr.expandable-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.item-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-width: 300px;
}

.item-image {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #1a1a1a;
  padding: 4px;
  border: 1px solid var(--border);
  object-fit: contain;
  display: block;
}

.default-icon-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(227, 192, 141, 0.1);
  border: 1px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.default-icon-placeholder i {
  width: 24px;
  height: 24px;
}

.image-container {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.class-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: rgba(227, 192, 141, 0.15);
  border: 1px solid var(--primary);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 500;
}

.stats-text {
  font-size: 0.9rem;
  color: var(--text-dim);
  vertical-align: middle;
}

.item-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
}

.category-badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Details Row */
.details-row {
  background: rgba(0, 0, 0, 0.15);
}

.details-content {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.detail-item h4 {
  color: var(--primary);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.detail-item p {
  font-size: 0.95rem;
}

.hidden {
  display: none !important;
}

#no-results {
  padding: 4rem;
  text-align: center;
  color: var(--text-dim);
}

#no-results i {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

@media (max-width: 768px) {
  .app-container {
    padding: 1rem;
  }
  
  header {
    margin-bottom: 1.5rem;
  }
  
  th:nth-child(3), td:nth-child(3) {
    display: none;
  }
}
