/* calendar-connect.css — Connected Calendars UI styles */

.cal-connect-section {
  padding: 0 2px;
}

.cal-connect-intro {
  font-size: 0.875rem;
  color: var(--muted, #6b7280);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── Provider cards ─────────────────────────────────────────────────────────── */

.cal-provider-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cal-provider-card {
  background: var(--card-bg, #fff);
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 14px;
  padding: 16px;
  transition: border-color 0.15s;
}

.cal-provider-card.cal-provider-connected {
  border-color: #22c55e;
}

.cal-provider-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.cal-provider-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.cal-provider-logo--google    { background: #fff; border: 1px solid #e8eaf0; }
.cal-provider-logo--microsoft { background: #f3f4f6; }
.cal-provider-logo--apple     { background: #1c1c1e; }

.cal-provider-info {
  flex: 1;
  min-width: 0;
}

.cal-provider-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text, #0a2540);
  margin-bottom: 2px;
}

.cal-provider-email {
  font-size: 0.78rem;
  color: var(--muted, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-provider-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

.cal-status-connected {
  background: #dcfce7;
  color: #166534;
}

.cal-status-disconnected {
  background: var(--bg2, #f8fafc);
  color: var(--muted, #6b7280);
}

/* ── Sync toggles ────────────────────────────────────────────────────────────── */

.cal-sync-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--bg2, #f8fafc);
  border-radius: 10px;
}

.cal-sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cal-sync-label {
  font-size: 0.82rem;
  color: var(--text, #0a2540);
  line-height: 1.4;
  flex: 1;
}

.cal-sync-label em {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--muted, #6b7280);
  margin-top: 1px;
}

/* Toggle switch */
.cal-toggle {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 22px;
}

.cal-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cal-toggle-track {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.2s;
}

.cal-toggle input:checked + .cal-toggle-track {
  background: #6C3CE1;
}

.cal-toggle-track::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.cal-toggle input:checked + .cal-toggle-track::after {
  left: 20px;
}

/* ── Connect / disconnect buttons ─────────────────────────────────────────────── */

.cal-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cal-btn-connect {
  background: #6C3CE1;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.cal-btn-connect:hover { background: #5a30c7; }

.cal-btn-disconnect {
  background: transparent;
  color: #ef4444;
  border: 1.5px solid #fca5a5;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.cal-btn-disconnect:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.cal-btn-apple-note {
  font-size: 0.78rem;
  color: var(--muted, #6b7280);
  font-style: italic;
  text-align: right;
  margin-top: 4px;
}

/* ── Loading state ─────────────────────────────────────────────────────────── */

.cal-loading {
  text-align: center;
  padding: 32px 0;
  color: var(--muted, #6b7280);
  font-size: 0.9rem;
}

/* ── Error / info banners ──────────────────────────────────────────────────── */

.cal-banner {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.82rem;
  margin-bottom: 12px;
  line-height: 1.4;
}

.cal-banner--info {
  background: #eff6ff;
  color: #1d4ed8;
}

.cal-banner--warn {
  background: #fffbeb;
  color: #92400e;
}

.cal-banner--error {
  background: #fef2f2;
  color: #991b1b;
}
