/* Liquid Glass Design System */

:root {
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.35);
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --text: #e5e7eb;
  --text-muted: #94a3b8;
}

* { 
  box-sizing: border-box; 
}

body {
  font-family: Inter, system-ui, sans-serif;
  background: radial-gradient(1200px at top left, #1e293b, #020617);
  color: var(--text);
  margin: 0; 
  padding: 24px;
  min-height: 100vh;
}

/* Glass Component */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 16px 0;
  color: var(--text);
  font-weight: 700;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

h2 {
  font-size: 2rem;
}

p {
  margin: 0 0 16px 0;
  line-height: 1.6;
  color: var(--text-muted);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-strong);
}

/* Form Elements */
textarea, input[type="text"], input[type="email"], input[type="number"] {
  width: 100%; 
  background: rgba(0,0,0,0.35); 
  border: 1px solid var(--glass-border);
  color: var(--text); 
  border-radius: 10px; 
  padding: 10px; 
  font-family: inherit;
  font-size: 1rem;
}

textarea {
  font-family: monospace;
  resize: vertical;
  min-height: 100px;
}

input[type="text"]:focus, 
input[type="email"]:focus, 
input[type="number"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.1);
}

button, select {
  padding: 8px 14px; 
  border-radius: 10px; 
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #020617; 
  font-weight: 600; 
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

button:hover, select:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(125, 211, 252, 0.3);
}

button:active {
  transform: translateY(0);
}

select {
  background: rgba(0,0,0,0.35);
  color: var(--text);
  border: 1px solid var(--glass-border);
}

select:hover {
  background: rgba(0,0,0,0.45);
}

/* Table Styles */
table { 
  width: 100%; 
  border-collapse: collapse; 
  margin-top: 12px; 
  font-size: 0.9rem; 
}

th, td { 
  padding: 8px; 
  border-bottom: 1px solid rgba(255,255,255,0.15); 
  text-align: left;
}

th { 
  cursor: pointer; 
  color: #bae6fd; 
  font-weight: 600;
}

tr:hover { 
  background: rgba(255,255,255,0.08); 
}

input.qty { 
  width: 60px; 
  text-align: center; 
}

.mana-cost {
  font-family: monospace;
  font-size: 0.9rem;
  text-align: center;
  white-space: nowrap;
  color: var(--accent);
  font-weight: 600;
}

.price { 
  text-align: right; 
}

tr.bought {
  opacity: 0.5;
  text-decoration: line-through;
}

.purchase-order {
  font-size: 0.75rem;
  color: var(--accent);
  margin-left: 8px;
  font-weight: 600;
}

/* Column toggle menu */
.column-toggle {
  position: relative;
}

.column-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  padding: 12px;
  min-width: 180px;
  z-index: 100;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.column-menu.hidden {
  display: none;
}

.column-menu label {
  display: block;
  padding: 6px 0;
  cursor: pointer;
  color: var(--text);
  user-select: none;
}

.column-menu label:hover {
  color: var(--accent);
}

.column-menu input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  cursor: pointer;
}

/* Card name with links */
.card-name-cell {
  position: relative;
}

.card-name {
  display: inline-block;
  margin-right: 8px;
}

.card-links {
  display: inline-flex;
  gap: 6px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

tr:hover .card-links {
  opacity: 1;
}

.card-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  transition: transform 0.2s;
}

.card-links a:hover {
  transform: scale(1.2);
  color: var(--accent-strong);
}

.order-details {
  width: 100%;
  min-width: 150px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--glass-border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 0.9rem;
}

.order-details:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.1);
}

/* Tier badges */
.tier-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}

.tier-badge.tier-A {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: white;
}

.tier-badge.tier-B {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.tier-badge.tier-C {
  background: rgba(156, 163, 175, 0.3);
  color: var(--text);
  border: 1px solid rgba(156, 163, 175, 0.5);
}

/* Tier row highlighting */
tr.tier-a {
  background: rgba(239, 68, 68, 0.08);
}

tr.tier-a:hover {
  background: rgba(239, 68, 68, 0.12);
}

/* Shipping warning */
.shipping-warning {
  margin-left: 6px;
  opacity: 0.7;
  cursor: help;
}

/* Tier filter controls */
.tier-filters {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.tier-filters label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text);
  user-select: none;
}

.tier-filters label:hover {
  color: var(--accent);
}

.tier-filters input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

/* Layout Utilities */
.layout { 
  display: grid; 
  grid-template-columns: 1fr 320px; 
  gap: 24px; 
}

.controls, .top-controls {
  display: flex; 
  gap: 8px; 
  justify-content: space-between; 
  align-items: center; 
  margin-top: 12px;
  flex-wrap: wrap;
}

.pagination { 
  display: flex; 
  gap: 6px; 
  align-items: center; 
}

.export-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.image-panel img { 
  width: 100%; 
  border-radius: 12px; 
  display: none; 
}

.img-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-muted);
  gap: 12px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.error-icon {
  font-size: 48px;
  opacity: 0.7;
}

/* Section Styles */
section {
  margin-bottom: 48px;
}

.section-content {
  padding: 24px;
}

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

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .controls, .top-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .controls > * {
    width: 100%;
  }
}

@media (max-width: 480px) {
  body {
    padding: 12px;
  }

  .glass {
    border-radius: 12px;
  }

  .section-content {
    padding: 16px;
  }
}

