:root {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2a2a2a;
  --bg-tertiary: #333333;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --success: #16a34a;
  --error: #dc2626;
  --warning: #f59e0b;
  --border: #404040;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Login Page */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-box {
  background: var(--bg-secondary);
  padding: 3rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  margin-bottom: 2rem;
  text-align: center;
  font-size: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

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

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

.error-message {
  background: var(--error);
  color: white;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  text-align: center;
}

/* Dashboard Layout */
.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.dashboard-header h1 {
  font-size: 1.5rem;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.datetime {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

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

/* Search Section */
.search-section {
  margin-bottom: 2rem;
  text-align: center;
}

.search-box {
  display: flex;
  gap: 0.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.search-box input {
  flex: 1;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-box button {
  padding: 1rem 2rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.search-box button:hover {
  background: var(--accent-hover);
}

/* Summary Section */
.summary-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.summary-header h2 {
  font-size: 1.3rem;
}

.summary-content {
  color: var(--text-primary);
  line-height: 1.8;
  white-space: pre-wrap;
}

.summary-loading {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
}

.summary-error {
  color: var(--error);
  padding: 1rem;
  background: rgba(220, 38, 38, 0.1);
  border-radius: 6px;
}

.cache-info {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 1rem;
  text-align: right;
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 968px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.card h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-content {
  max-height: 400px;
  overflow-y: auto;
}

.card-content::-webkit-scrollbar {
  width: 8px;
}

.card-content::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 4px;
}

.card-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.card-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Items */
.item {
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  transition: background 0.2s;
}

.item:hover {
  background: var(--bg-primary);
}

.item-header {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.item-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.item-preview {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.item-link {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.item-link:hover {
  background: var(--accent-hover);
}

/* Task Item */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.task-checkbox {
  margin-top: 0.25rem;
}

.task-content {
  flex: 1;
}

.task-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.task-due {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.task-due.overdue {
  color: var(--error);
  font-weight: 600;
}

.task-due.today {
  color: var(--warning);
  font-weight: 600;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

/* Setup Notice */
.setup-notice {
  background: var(--warning);
  color: var(--bg-primary);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  text-align: center;
}

.setup-notice a {
  color: var(--bg-primary);
  font-weight: 600;
  text-decoration: underline;
}

/* Setup Page */
.setup-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
}

.setup-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.setup-box h2 {
  margin-bottom: 1.5rem;
}

.setup-steps {
  list-style: none;
  counter-reset: step-counter;
}

.setup-steps li {
  counter-increment: step-counter;
  margin-bottom: 1rem;
  padding-left: 2.5rem;
  position: relative;
}

.setup-steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  background: var(--accent);
  color: white;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.code-box {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  margin: 1rem 0;
  overflow-x: auto;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-badge.connected {
  background: var(--success);
  color: white;
}

.status-badge.disconnected {
  background: var(--error);
  color: white;
}

/* Loading Spinner */
.spinner {
  border: 3px solid var(--bg-tertiary);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
