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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  overflow: hidden; /* Fixed viewport - no scrolling */
}

.dashboard {
  height: 100vh;
  display: flex;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 280px;
  background: white;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.sidebar-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
}

.nav-section {
  padding: 1rem;
}

.nav-section h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

.nav-item {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #475569;
  margin-bottom: 0.25rem;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-item:hover:not(.disabled) {
  background: #f1f5f9;
  color: #1e293b;
}

.nav-item.active {
  background: #3b82f6;
  color: white;
}

.nav-item.disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.coming-soon {
  font-size: 0.625rem;
  background: #f1f5f9;
  color: #64748b;
  padding: 0.125rem 0.375rem;
  border-radius: 12px;
  font-weight: 500;
}

/* Sidebar Jobs */
.sidebar-jobs {
  border-top: 1px solid #f1f5f9;
  max-height: 40%;
  display: flex;
  flex-direction: column;
}

.jobs-header {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.jobs-header h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
}

.job-count {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.jobs-controls {
  display: flex;
  gap: 0.25rem;
}

.btn-icon {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #64748b;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.jobs-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.job-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem;
  margin-bottom: 0.25rem;
  cursor: pointer;
  transition: all 0.2s;
}

.job-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.job-item.active {
  border-color: #3b82f6;
  background: #eff6ff;
}

.job-name {
  font-weight: 600;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  color: #1e293b;
}

.job-meta {
  font-size: 0.625rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.job-status {
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
}

.job-status.pending {
  background: #fef3c7;
  color: #92400e;
}

.job-status.running {
  background: #dbeafe;
  color: #1e40af;
  animation: pulse 2s infinite;
}

.job-status.completed {
  background: #dcfce7;
  color: #166534;
}

.job-status.failed {
  background: #fee2e2;
  color: #991b1b;
}

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

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.agent-content {
  display: none;
  max-width: 800px;
}

.agent-content.active {
  display: block;
}

.agent-header {
  margin-bottom: 2rem;
}

.agent-header h2 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.agent-header p {
  color: #64748b;
  font-size: 1rem;
}

.agent-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.input-section h3,
.results-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
}

/* Input Section */
#contentInput {
  width: 100%;
  min-height: 200px;
  padding: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
  background: white;
  margin-bottom: 1rem;
}

#contentInput:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-primary {
  width: 100%;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.875rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Results Section */
.results-section {
  background: white;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
}

.tweets-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tweet-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
}

.tweet-text {
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  color: #1f2937;
}

.tweet-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #6b7280;
  border-top: 1px solid #f3f4f6;
  padding-top: 0.75rem;
}

.char-count {
  font-weight: 600;
}

.refinement {
  font-style: italic;
  max-width: 60%;
  text-align: right;
}

/* ===== LOGS FOOTER ===== */
.logs-footer {
  height: 200px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}

.logs-header {
  padding: 1rem 2rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafbfc;
}

.logs-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.log-status {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

#tweetLogOutput {
  flex: 1;
  background: #1e293b;
  color: #10b981;
  padding: 1rem 2rem;
  font-family: "SF Mono", Monaco, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-y: auto;
  white-space: pre-wrap;
  border: none;
}

/* Utility classes */
.loading,
.error {
  text-align: center;
  padding: 2rem;
  color: #64748b;
  font-size: 0.875rem;
}

.error {
  background: #fee2e2;
  color: #991b1b;
  border-radius: 8px;
}

.logs-section {
  margin-top: 1rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.logs-section summary {
  cursor: pointer;
  font-weight: 500;
  color: #6b7280;
  font-size: 0.875rem;
}

.logs {
  background: #f9fafb;
  padding: 1rem;
  border-radius: 8px;
  font-family: "SF Mono", Monaco, monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  border: 1px solid #e5e7eb;
  margin: 0.5rem 0 0 0;
  overflow-x: auto;
}

/* Single column layout for smaller screens */
@media (max-width: 1200px) {
  .agent-body {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
