/* Collegium Academicum — Broadcast UI styles */

:root {
  --ca-teal: #35ADA4;
  --ca-teal-dark: #2f9991;
  --ca-text: #363636;
}

body {
  font-family: 'Source Sans 3', sans-serif;
  background: #fcfcfc;
  color: var(--ca-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Navbar ── */
.ca-navbar {
  background: white;
  border-bottom: 3px solid var(--ca-teal);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.ca-navbar-logo img { height: 36px; display: block; }
.ca-navbar-right { display: flex; align-items: center; gap: 1rem; }
.ca-navbar-user { font-size: 0.9rem; color: #7a7a7a; }
.ca-logout {
  font-size: 0.85rem; color: var(--ca-teal); border: 1px solid var(--ca-teal);
  border-radius: 4px; padding: 4px 12px; cursor: pointer; background: white;
  font-family: inherit; font-weight: 600;
}
.ca-logout:hover { background: var(--ca-teal); color: white; }
.ca-navbar-admin {
  font-size: 0.85rem; color: var(--ca-teal); font-weight: 600; text-decoration: none;
}
.ca-navbar-admin:hover { text-decoration: underline; }

/* ── Offline banner ── */
@keyframes ca-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.ca-offline-banner {
  background: #c0392b;
  color: white;
  border-bottom: 3px solid #922b21;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
.ca-offline-banner::before {
  content: '⚠';
  font-size: 1.2rem;
  animation: ca-pulse 2s ease-in-out infinite;
}

/* ── Main ── */
.ca-main { flex: 1; padding: 0 1.5rem 3rem; }

/* ── Step progress indicator ── */
.ca-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 400px;
  margin: 2rem auto 1.5rem;
}
.ca-step { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ca-step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  border: 2px solid var(--ca-teal);
}
.ca-step.active .ca-step-circle { background: var(--ca-teal); color: white; }
.ca-step.done .ca-step-circle { background: var(--ca-teal); color: white; }
.ca-step:not(.active):not(.done) .ca-step-circle { background: white; color: var(--ca-teal); }
.ca-step-label { font-size: 0.75rem; color: #7a7a7a; }
.ca-step.active .ca-step-label { color: var(--ca-teal); font-weight: 600; }
.ca-step-line { height: 2px; flex: 1; background: #dbdbdb; margin-bottom: 18px; min-width: 48px; }
.ca-step-line.done { background: var(--ca-teal); }

/* ── Card ── */
.ca-card {
  background: white;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  padding: 2rem;
  max-width: 760px;
  margin: 0 auto;
}

/* ── Form elements ── */
.ca-label {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #7a7a7a; margin-bottom: 0.5rem; display: block;
}
.ca-input, .ca-textarea {
  width: 100%; border: 1px solid #dbdbdb; border-radius: 4px;
  padding: 0.75rem; font-family: inherit; font-size: 1rem;
  color: var(--ca-text); background: #fcfcfc;
}
.ca-textarea { resize: vertical; min-height: 120px; }
.ca-input:focus, .ca-textarea:focus {
  border-color: var(--ca-teal); outline: none;
  box-shadow: 0 0 0 2px rgba(53,173,164,0.15);
}

/* ── Buttons ── */
.ca-button {
  background: var(--ca-teal); color: white; border: none; border-radius: 4px;
  padding: 0.65rem 1.5rem; font-family: inherit; font-size: 1rem;
  font-weight: 600; cursor: pointer;
}
.ca-button:hover { background: var(--ca-teal-dark); }
.ca-button-outline {
  background: white; color: var(--ca-teal); border: 1px solid var(--ca-teal);
  border-radius: 4px; padding: 0.65rem 1.5rem; font-family: inherit;
  font-size: 1rem; font-weight: 600; cursor: pointer;
}
.ca-button-outline:hover { background: #f0faf9; }

/* ── Group cards ── */
.group-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.5rem; }
.group-card { border: 2px solid #dbdbdb; border-radius: 6px; overflow: hidden; transition: border-color 0.15s; }
.group-card.selected { border-color: var(--ca-teal); }
.group-card-top {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; cursor: pointer; transition: background 0.15s;
  user-select: none;
}
.group-card-top:hover { background: #f0faf9; }
.group-card.selected .group-card-top { background: #f0faf9; }
.group-check {
  width: 18px; height: 18px; border-radius: 3px; border: 2px solid #dbdbdb;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: white; transition: background 0.15s, border-color 0.15s;
}
.group-card.selected .group-check { background: var(--ca-teal); border-color: var(--ca-teal); }
.group-info { flex: 1; min-width: 0; }
.group-name { font-weight: 600; font-size: 0.95rem; }
.group-expand-btn {
  font-size: 0.75rem; color: var(--ca-teal); background: none; border: none;
  cursor: pointer; padding: 2px 6px; border-radius: 3px; white-space: nowrap;
  font-family: inherit;
}
.group-expand-btn:hover { background: rgba(53,173,164,0.1); }
.group-channels { display: none; border-top: 1px solid #efefef; background: #f8fffe; padding: 0.6rem 1rem; }
.group-channels.open { display: block; }
.group-channels ul { margin: 0; padding: 0; list-style: none; }
.group-channels li {
  font-size: 0.82rem; color: #4a4a4a; padding: 2px 0;
  display: flex; align-items: center; gap: 6px;
}
.group-channels li::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ca-teal); flex-shrink: 0; opacity: 0.6;
}

/* ── Messages (Django flash messages) ── */
.ca-messages { max-width: 760px; margin: 1rem auto 0; }
.ca-message {
  padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 0.5rem;
  font-size: 0.9rem; font-weight: 600;
}
.ca-message.error { background: #fdecea; color: #B61B29; border: 1px solid #f5c6cb; }
.ca-message.warning { background: #fff8e1; color: #7a5c00; border: 1px solid #ffe082; }
.ca-message.success { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.ca-message.info { background: #e3f2fd; color: #0d47a1; border: 1px solid #90caf9; }

/* ── Divider ── */
.ca-divider { border: none; border-top: 1px solid #efefef; margin: 1.5rem 0; }

/* ── Confirm page ── */
.ca-message-preview {
  background: #f8fffe; border: 1px solid #dbdbdb; border-radius: 4px;
  padding: 1rem; white-space: pre-wrap; font-family: inherit; font-size: 0.95rem;
  color: var(--ca-text);
}
.ca-channel-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.ca-channel-list li {
  font-size: 0.9rem; padding: 3px 0;
  display: flex; align-items: center; gap: 8px; color: #4a4a4a;
}
.ca-channel-list li::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ca-teal); flex-shrink: 0;
}
.ca-button-row { display: flex; gap: 0.75rem; align-items: center; }

/* ── Result page ── */
.ca-result-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.ca-result-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; }
.ca-result-sub { color: #7a7a7a; margin-bottom: 1.5rem; }
.ca-result.success .ca-result-title { color: #1b5e20; }
.ca-result.partial .ca-result-title { color: #7a5c00; }
.ca-result.failure .ca-result-title { color: #B61B29; }
.ca-error-list { list-style: none; padding: 0; }
.ca-error-list li { font-size: 0.85rem; color: #B61B29; padding: 2px 0; }

/* ── Login page ── */
.ca-login-wrap {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 1; padding: 2rem 1.5rem;
}
.ca-login-logo { margin-bottom: 1.5rem; }
.ca-login-logo img { height: 60px; }
.ca-login-card { background: white; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.07); padding: 2rem; width: 100%; max-width: 380px; }
.ca-login-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 1.5rem; text-align: center; color: var(--ca-teal); }
.ca-field { margin-bottom: 1rem; }
.ca-login-card .ca-button { width: 100%; margin-top: 0.5rem; }

/* ── Footer ── */
.ca-footer {
  background: white; border-top: 3px solid var(--ca-teal);
  padding: 1.25rem 1.5rem; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 0.75rem;
}
.ca-footer-logo img { height: 28px; opacity: 0.7; }
.ca-footer-links { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.ca-footer-links a {
  font-size: 0.82rem; color: white; background: var(--ca-teal);
  border-radius: 4px; padding: 3px 10px; text-decoration: none; font-weight: 600;
}
.ca-footer-links a:hover { background: var(--ca-teal-dark); }
.ca-footer-email { font-size: 0.82rem; color: #7a7a7a; }
