/* Base Reset & Variables */
:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #3b82f6;
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
}

.container {
  margin: 0 auto;
  padding: 1rem;
  max-width: 900px; /* PC width */
}

/* Utilities (mimicking tailwind explicitly or implicitly) */
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.text-sm { font-size: 0.875rem; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  font-size: 1.875rem;
  background: linear-gradient(to right, #60a5fa, #a855f7);
  -webkit-background-clip: text;
  color: transparent;
}

button {
  cursor: pointer;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  transition: all 0.2s;
}
button:hover {
  background: #334155;
}

/* Hidden Panel */
#hiddenPanel {
  display: none;
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1rem;
}
#hiddenPanel.show {
  display: block;
}

.restore-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #334155;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  cursor: pointer;
}
.restore-tag:hover {
  background: #475569;
}

/* Categories */
.category {
  background: var(--bg-secondary);
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--card-border);
  transition: opacity 0.3s ease;
}

.category.hidden-client-side {
  display: none;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  user-select: none;
}

.category-header:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cat-title {
  font-weight: 600;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.25rem;
}
.icon-btn:hover {
  color: white;
  background: transparent;
}

/* Items list */
.category-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem;
  /* transition for folding? simpler to just toggle display or height */
}

.category.collapsed .category-items {
  display: none;
}

.chevron {
  transition: transform 0.2s;
}
.category.collapsed .chevron {
  transform: rotate(-90deg);
}

/* Cards */
.item-card {
  background: var(--card-bg); /* slightly lighter than bg */
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  padding: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-color: rgba(96, 165, 250, 0.3);
}

.item-title {
  font-weight: 600;
  color: #60a5fa;
  margin-bottom: 0.5rem;
}

.item-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-date {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.75rem;
  display: block;
  text-align: right;
}

/* Responsive Grid for PC */
@media (min-width: 768px) {
  .category-items {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}
