/* ===== Dashboard (index.php) ===== */
:root {
  --bg:        #0a0a0a;
  --surface:   #141414;
  --border:    #222;
  --accent:    #00d4ff;
  --accent2:   #8e44ad;
  --text:      #e0e0e0;
  --muted:     #666;
  --green:     #2ecc71;
  --orange:    #f39c12;
  --red:       #e74c3c;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.dashboard {
  max-width: 800px;
  width: 100%;
  text-align: center;
}

h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: .3rem;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: 2.5rem;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1rem;
  transition: border-color .2s, transform .2s;
}

.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.stat-value {
  font-size: 2.4rem;
  font-weight: 700;
}

.stat-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: .3rem;
}

.stat-pending .stat-value { color: var(--orange); }
.stat-content .stat-value  { color: var(--accent); }
.stat-done .stat-value     { color: var(--green); }
.stat-total .stat-value    { color: var(--text); }
.stat-sets .stat-value     { color: var(--accent2); }
.stat-images .stat-value   { color: #e056a0; }

/* Pipeline Bar */
.pipeline-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 2rem;
}

.pipeline-bar h3 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: .8rem;
}

.pipeline-track {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: #1a1a1a;
}

.pipeline-track .seg-pending  { background: var(--orange); }
.pipeline-track .seg-content  { background: var(--accent); }
.pipeline-track .seg-done     { background: var(--green); }

.pipeline-legend {
  display: flex;
  justify-content: space-between;
  margin-top: .5rem;
  font-size: .7rem;
  color: var(--muted);
}

/* Topics Table */
.topics-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 2rem;
  text-align: left;
}

.topics-section h3 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: .8rem;
}

.topic-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}

.topic-row:last-child { border-bottom: none; }

.topic-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.topic-dot.pending { background: var(--orange); }
.topic-dot.content { background: var(--accent); }
.topic-dot.done    { background: var(--green); }

.topic-name  { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-date  { color: var(--muted); font-size: .75rem; flex-shrink: 0; }

/* CTA Button */
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  text-decoration: none;
  padding: .85rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  transition: opacity .2s, transform .2s;
}

.cta-btn:hover { opacity: .85; transform: scale(1.03); }

.cta-btn .arrow { font-size: 1.2rem; }

.refresh-note {
  margin-top: 1.5rem;
  font-size: .75rem;
  color: var(--muted);
}

/* ===== Custom & Auto Generate Sections ===== */
.custom-generate-section,
.auto-generate-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: left;
}

.custom-generate-section h3,
.auto-generate-section h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.subtitle-small {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

/* Form Styles */
.custom-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.1);
}

.form-group textarea {
  resize: vertical;
}

/* Button Styles */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s, background-color 0.2s;
  display: inline-block;
  text-align: center;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--green);
  color: #000;
  width: 100%;
}

.btn-secondary:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* Status Messages */
.status-message {
  display: none;
  margin-top: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-message.success {
  background: rgba(46, 204, 113, 0.1);
  color: var(--green);
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-message.error {
  background: rgba(231, 76, 60, 0.1);
  color: var(--red);
  border: 1px solid rgba(231, 76, 60, 0.3);
}
