/**
 * ZenAgent — Agent Modules CSS
 * Styles pour la barre d'onglets, les panneaux de modules,
 * et le modal de sélection de preset.
 */

/* ─── Barre d'onglets ────────────────────────────────────────────────────────── */
.za-tab-bar {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1.5px solid var(--zen-border);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  padding: 0 20px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.za-tab-bar::-webkit-scrollbar { display: none; }

.za-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--zen-text-secondary);
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
  margin-bottom: -1.5px; /* overlap sur la border du bar */
}
.za-tab i { font-size: 15px; }
.za-tab:hover {
  color: var(--zen-text);
}
.za-tab.active {
  color: var(--zen-primary-dark);
  border-bottom-color: var(--zen-primary);
  font-weight: 600;
}

/* ─── Panneau module ─────────────────────────────────────────────────────────── */
.za-module-panel {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  background: var(--zen-bg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.za-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--zen-border);
}
.za-module-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--zen-text);
}
.za-module-title i { font-size: 18px; color: var(--zen-primary); }

.za-module-btn-primary {
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--zen-primary);
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.za-module-btn-primary:hover { background: var(--zen-primary-dark); }

.za-module-btn-secondary {
  padding: 8px 16px;
  border-radius: 8px;
  background: transparent;
  color: var(--zen-text-secondary);
  border: 1.5px solid var(--zen-border);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.za-module-btn-secondary:hover {
  border-color: var(--zen-primary);
  color: var(--zen-primary-dark);
}

.za-module-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--zen-text-muted);
  text-align: center;
  flex: 1;
}
.za-module-empty p { font-size: 14px; max-width: 380px; line-height: 1.6; }

/* Panneau placeholder (module non encore implémenté) */
.za-module-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex: 1;
  padding: 40px 20px;
  text-align: center;
}
.za-module-placeholder-icon { margin-bottom: 4px; }
.za-module-placeholder p {
  font-size: 14px;
  color: var(--zen-text-secondary);
  max-width: 400px;
  line-height: 1.6;
}
.za-module-placeholder-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

/* Chips agents zenagent requis */
.za-module-zenagents {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 10px 14px;
  background: var(--zen-surface);
  border: 1px solid var(--zen-border);
  border-radius: 10px;
  font-size: 12px;
}
.za-mz-label { color: var(--zen-text-muted); font-weight: 600; }
.za-mz-chip {
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--zen-bg);
  border: 1px solid var(--zen-border);
  color: var(--zen-text-secondary);
  font-size: 11px;
}
.za-mz-chip.connected {
  background: rgba(45,212,168,0.1);
  border-color: var(--zen-primary-light);
  color: var(--zen-primary-dark);
}

/* ─── Panneau tâches ─────────────────────────────────────────────────────────── */
.za-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.za-task-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--zen-surface);
  border: 1px solid var(--zen-border);
  border-radius: 10px;
  cursor: default;
  transition: box-shadow 0.15s;
}
.za-task-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.za-task-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--zen-primary), var(--zen-primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.za-task-body { flex: 1; min-width: 0; }
.za-task-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--zen-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.za-task-freq { font-size: 11.5px; color: var(--zen-text-muted); margin-top: 2px; }
.za-task-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 8px;
  white-space: nowrap;
}
.za-task-badge.active {
  background: rgba(45,212,168,0.12);
  color: var(--zen-primary-dark);
}
.za-task-badge.paused {
  background: rgba(240,165,0,0.12);
  color: var(--zen-warning);
}

/* ─── Modal preset step ──────────────────────────────────────────────────────── */
.za-preset-subtitle {
  font-size: 13px;
  color: var(--zen-text-secondary);
  margin: 0 0 16px;
  line-height: 1.5;
}

.za-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.za-preset-card {
  border: 1.5px solid var(--zen-border);
  border-radius: 12px;
  padding: 16px 12px 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--zen-surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
  user-select: none;
}
.za-preset-card:hover {
  border-color: var(--zen-primary-light);
  background: rgba(45,212,168,0.04);
  transform: translateY(-1px);
}
.za-preset-card.selected {
  border-color: var(--zen-primary);
  border-width: 2px;
  background: rgba(45,212,168,0.06);
  box-shadow: 0 0 0 3px rgba(45,212,168,0.12);
}
.za-preset-blank {
  border-style: dashed;
  opacity: 0.75;
}
.za-preset-blank:hover { opacity: 1; }
.za-preset-blank.selected { opacity: 1; border-style: solid; }

.za-preset-emoji { font-size: 24px; line-height: 1; }
.za-preset-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--zen-text);
}
.za-preset-desc {
  font-size: 11px;
  color: var(--zen-text-muted);
  line-height: 1.4;
}
.za-preset-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}
.za-preset-module-chip {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--zen-bg);
  color: var(--zen-text-secondary);
  border: 1px solid var(--zen-border);
}
.za-preset-module-chip i { font-size: 11px; }

.za-preset-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--zen-border);
}

/* Badge preset actif dans le header du modal */
.za-preset-badge-active {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--zen-primary-dark);
  background: rgba(45,212,168,0.1);
  border: 1px solid var(--zen-primary-light);
  border-radius: 8px;
  padding: 4px 10px;
  margin-top: 8px;
}
.za-preset-badge-active button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--zen-text-muted);
  font-size: 13px;
  padding: 0;
  margin-left: 4px;
  line-height: 1;
}
.za-preset-badge-active button:hover { color: var(--zen-danger); }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .za-preset-grid {
    grid-template-columns: 1fr 1fr;
  }
  .za-tab span { display: none; } /* icônes seules sur mobile */
  .za-tab { padding: 10px 12px; }
  .za-tab.active span { display: inline; }
}
@media (max-width: 400px) {
  .za-preset-grid { grid-template-columns: 1fr; }
}
