/* Task Queue - ClojureScript SPA */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #F5F5F5;
  color: #1A1A1A;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Shell */
.app-bar {
  background: #FFFFFF;
  color: #1A1A1A;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-bar-title {
  font-size: 20px;
  font-weight: 600;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-bar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Connection Status */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.connected { background-color: #2E7D32; }
.status-dot.connecting { background-color: #C49000; }
.status-dot.disconnected { background-color: #9E9E9E; }

/* Icon Buttons */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.icon-btn:hover {
  background: rgba(0,0,0,0.06);
}

/* Cards */
.card {
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  margin: 8px 16px;
  overflow: hidden;
}

/* Active Task Card */
.active-card {
  background: #E8EAF6;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 16px;
  cursor: pointer;
  transition: transform 0.1s;
}

.active-card:hover {
  transform: scale(0.995);
}

.active-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.active-card-label {
  font-size: 12px;
  font-weight: 700;
  color: #3F51B5;
  letter-spacing: 0.5px;
}

.active-card-icon {
  color: #3F51B5;
  font-size: 20px;
}

.active-card-title {
  font-size: 20px;
  font-weight: 600;
  color: #1A237E;
  margin-bottom: 4px;
}

.active-card-meta {
  font-size: 12px;
  color: #5C6BC0;
  margin-bottom: 12px;
}

.active-card-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Task Tile */
.task-tile {
  display: flex;
  padding: 12px 16px;
  border-left: 4px solid;
  cursor: pointer;
  transition: background 0.15s;
}

.task-tile:hover {
  background: rgba(0,0,0,0.02);
}

.task-tile-content {
  flex: 1;
  min-width: 0;
}

.task-tile-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.task-tile-title {
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-tile-title.completed {
  text-decoration: line-through;
  color: #757575;
}

.task-tile-elapsed {
  font-size: 12px;
  font-weight: 500;
  color: #757575;
  white-space: nowrap;
}

.task-tile-status-line {
  font-size: 12px;
  color: #757575;
  margin-top: 2px;
}

.task-tile-due {
  font-size: 12px;
  color: #757575;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-tile-due.overdue {
  color: #D32F2F;
}

.task-tile-desc {
  font-size: 13px;
  color: #616161;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-tile-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

/* Importance Badge */
.importance-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.importance-badge.urgent { color: #D32F2F; background: #FFEBEE; }
.importance-badge.high { color: #E65100; background: #FFF3E0; }
.importance-badge.medium { color: #C49000; background: #FFF8E1; }
.importance-badge.low { color: #757575; background: #F5F5F5; }

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  padding: 12px 16px 4px;
  cursor: pointer;
  user-select: none;
}

.section-header-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
}

.section-header-count {
  font-size: 12px;
  color: #757575;
  margin-left: 8px;
}

.section-header-toggle {
  font-size: 18px;
  color: #757575;
  transition: transform 0.2s;
}

.section-header-toggle.collapsed {
  transform: rotate(-90deg);
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-filled {
  background: #3F51B5;
  color: white;
  border-color: #3F51B5;
}

.btn-filled:hover {
  background: #3949AB;
}

.btn-outline {
  background: transparent;
  border-color: currentColor;
}

.btn-outline:hover {
  background: rgba(0,0,0,0.04);
}

.btn-text {
  background: transparent;
  border: none;
  color: #3F51B5;
  padding: 8px 12px;
}

.btn-text:hover {
  background: rgba(63,81,181,0.08);
}

.btn-danger { color: #D32F2F; }
.btn-warning { color: #E65100; }
.btn-success { color: #2E7D32; }

.btn-small {
  padding: 4px 12px;
  font-size: 12px;
}

/* FAB */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #3F51B5;
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(63,81,181,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 50;
}

.fab:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(63,81,181,0.5);
}

/* Extended FAB */
.fab-extended {
  width: auto;
  padding: 0 20px;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

/* Dialogs / Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.15s;
}

.modal {
  background: white;
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: slideUp 0.2s;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

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

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 4px;
  display: block;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #DDD;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: #3F51B5;
}

.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #DDD;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: white;
  cursor: pointer;
  appearance: auto;
}

.form-select:focus {
  border-color: #3F51B5;
}

/* Dropdown / Popup Menu */
.dropdown {
  position: relative;
  display: inline-block;
  z-index: 150;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 200px;
  z-index: 150;
  overflow: hidden;
  animation: fadeIn 0.1s;
}

.dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.1s;
}

.dropdown-item:hover {
  background: #F5F5F5;
}

/* Live Badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #E8F5E9;
  color: #2E7D32;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.live-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2E7D32;
  animation: pulse 2s infinite;
}

/* Login Screen */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
}

.login-icon {
  font-size: 64px;
  color: #3F51B5;
  margin-bottom: 16px;
}

.login-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
}

/* Snackbar */
.snackbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #333333;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 300;
  animation: slideUp 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #757575;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 16px;
}

/* Spinner */
.spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.spinner::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid #E0E0E0;
  border-top-color: #3F51B5;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #CCC;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #AAA;
}

/* Utility */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
