:root {
  --bg-main: #0f0f1a;
  --bg-column: rgba(255, 255, 255, 0.03);
  --bg-card: rgba(255, 255, 255, 0.07);
  --bg-card-hover: rgba(255, 255, 255, 0.12);
  --bg-input: rgba(255, 255, 255, 0.07);
  --bg-modal: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.4);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
  --accent-primary: #667eea;
  --accent-secondary: #764ba2;
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --toolbar-bg: rgba(255, 255, 255, 0.05);
  --toolbar-btn-hover: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] {
  --bg-main: #f5f7fb;
  --bg-column: rgba(0, 0, 0, 0.03);
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-input: #ffffff;
  --bg-modal: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: rgba(26, 26, 46, 0.7);
  --text-muted: rgba(26, 26, 46, 0.5);
  --border-subtle: rgba(0, 0, 0, 0.1);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.1);
  --toolbar-bg: rgba(0, 0, 0, 0.05);
  --toolbar-btn-hover: rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background: var(--bg-main);
  min-height: 100vh;
  color: var(--text-primary);
  transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
  background-image: 
    radial-gradient(ellipse at top left, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
}

/* Loading Screen */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 20px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Setup Screen */
.setup-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px;
  text-align: center;
}

.setup-icon {
  font-size: 64px;
  margin-bottom: 24px;
}

.setup-screen h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

.setup-screen p {
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 500px;
}

.setup-btn {
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.setup-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.setup-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.setup-progress {
  margin-top: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Header */
.header {
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-modal);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.header-emoji {
  font-size: 2rem;
}

.header-slogan {
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.header-btn {
  background: var(--toolbar-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.header-btn:hover {
  background: var(--toolbar-btn-hover);
}

.header-btn.primary {
  background: var(--accent-gradient);
  border: none;
  color: white;
}

/* Board */
.board {
  display: flex;
  gap: 24px;
  padding: 24px;
  overflow-x: auto;
  min-height: calc(100vh - 80px);
}

/* Column */
.column {
  flex: 0 0 320px;
  background: var(--bg-column);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border-subtle);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
}

.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-icon {
  font-size: 1.2rem;
}

.column-name {
  font-weight: 600;
  font-size: 1rem;
}

.column-count {
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.column-actions {
  display: flex;
  gap: 4px;
}

.column-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.column-btn:hover {
  background: var(--toolbar-btn-hover);
  color: var(--text-primary);
}

/* Cards */
.cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.card-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.card-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
}

.card-preview {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.card-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-stats {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Add Card Button */
.add-card-btn {
  background: transparent;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.add-card-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(102, 126, 234, 0.1);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-modal);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 24px;
  padding: 4px;
}

.modal-close:hover {
  color: var(--text-primary);
}

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

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

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

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

.btn {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: var(--toolbar-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--toolbar-btn-hover);
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-modal);
  color: var(--text-primary);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* Sync Indicator */
.sync-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.sync-dot.syncing {
  background: #f59e0b;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .board {
    padding: 16px;
  }
  
  .column {
    flex: 0 0 280px;
  }
}
