/* ══════════════════════════════════════════════════════════
   CHANNELS PAGE — Zalo Hub V3
   Zalo PC Blue Design
   ══════════════════════════════════════════════════════════ */

body {
  font-family: var(--font-family, 'Inter', system-ui, sans-serif);
  background: var(--color-bg, #F5F5F5);
  color: var(--color-text, #081C36);
  margin: 0;
  min-height: 100vh;
}

.channels-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ── Header ── */
.channels-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.channels-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.channels-header-left h1 {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--color-text, #081C36);
}
.channels-count {
  font-size: 13px;
  color: var(--color-text-muted, #7A7A7A);
  background: var(--color-surface, #fff);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #0068FF;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: #005CE6; }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-surface, #fff);
  color: var(--color-text, #081C36);
  border: 1px solid var(--color-border, #E5E7EB);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-secondary:hover { background: var(--color-surface-hover, #F0F2F5); }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--color-text-muted, #7A7A7A);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-ghost:hover {
  background: var(--color-surface-hover, #F0F2F5);
  color: var(--color-text, #081C36);
}
.btn-danger {
  color: #E74C3C;
}
.btn-danger:hover {
  background: #FEE2E2;
  color: #DC2626;
}

/* ── Section ── */
.channels-section {
  margin-bottom: 24px;
}
.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted, #7A7A7A);
  margin-bottom: 10px;
  padding-left: 2px;
}

/* ── Channel Card Grid ── */
.channel-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.channel-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--color-surface, #fff);
  border-radius: 10px;
  border: 1px solid var(--color-border, #E5E7EB);
  transition: all 0.15s ease;
}
.channel-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.channel-card.active {
  border-color: #0068FF;
  box-shadow: 0 0 0 1px rgba(0,104,255,0.2);
}

/* Channel Icon */
.channel-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.channel-icon span {
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}
.channel-icon.zalo { background: #0068FF; }
.channel-icon.oa { background: linear-gradient(135deg, #0068FF, #0052CC); }
.channel-icon.fb { background: #1877F2; }

/* Channel Info */
.channel-info {
  flex: 1;
  min-width: 0;
}
.channel-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #081C36);
  margin-bottom: 2px;
}
.channel-detail {
  font-size: 12px;
  color: var(--color-text-muted, #7A7A7A);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Channel Status */
.channel-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.channel-status.online {
  background: #D1FAE5;
  color: #065F46;
}
.channel-status.online .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
}
.channel-status.pending {
  background: #FEF3C7;
  color: #B45309;
}
.channel-status.error {
  background: #FEE2E2;
  color: #DC2626;
}

/* Channel Actions */
.channel-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Empty State ── */
.channels-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted, #7A7A7A);
}
.channels-empty i { margin-bottom: 12px; opacity: 0.4; }
.channels-empty p {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-secondary, #4A4A4A);
  margin: 0 0 4px 0;
}
.channels-empty span {
  font-size: 13px;
}

/* ── Add Channel Overlay / Panel ── */
.add-channel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
}
.add-channel-panel {
  width: 420px;
  max-width: 100%;
  background: var(--color-surface, #fff);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 16px rgba(0,0,0,0.1);
  animation: slideInRight 0.2s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border, #E5E7EB);
}
.panel-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  margin: 0;
}
.panel-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}
.panel-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border, #E5E7EB);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Channel Type Selector ── */
.channel-type-selector { margin-bottom: 20px; }
.channel-type-selector label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text, #081C36);
}
.type-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border: 2px solid var(--color-border, #E5E7EB);
  border-radius: 10px;
  background: var(--color-surface, #fff);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary, #4A4A4A);
}
.type-card:hover {
  border-color: #0068FF;
  background: #E8F0FE;
}
.type-card.selected {
  border-color: #0068FF;
  background: #E8F0FE;
  color: #0068FF;
  font-weight: 600;
}
.type-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.type-icon span {
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}
.type-icon.zalo { background: #0068FF; }
.type-icon.oa { background: linear-gradient(135deg, #0068FF, #0052CC); }
.type-icon.fb { background: #1877F2; }

/* ── Form Fields ── */
.form-field {
  margin-bottom: 16px;
}
.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text, #081C36);
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border, #E5E7EB);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text, #081C36);
  background: var(--color-surface, #fff);
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #0068FF;
  box-shadow: 0 0 0 2px rgba(0,104,255,0.12);
}
.form-field small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--color-text-muted, #7A7A7A);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .channels-wrapper { padding: 16px 12px; }
  .channels-header { flex-direction: column; align-items: flex-start; }
  .add-channel-panel { width: 100%; }
}
