/* File: app/static/style.css */
/* Changed: 2026-05-06 | Consolidated all inline CSS from templates */

/* ── Reset & Base ─────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f4f8; min-height: 100vh;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 1.5rem 1rem;
}
.main-card {
  background: white; border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  padding: 2rem; width: 100%; max-width: 700px;
}

/* ── Header / Logo ────────────────────────────────────────── */
.logo { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.2rem; flex-wrap: wrap; }
h1   { font-size: 1.4rem; color: #1a202c; }
.app-tag     { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; background: #4299e1; color: white; border-radius: 4px; padding: 0.15rem 0.4rem; }
.version-tag { font-size: 0.65rem; font-weight: 600; color: #a0aec0; background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 4px; padding: 0.12rem 0.4rem; letter-spacing: 0.04em; }
.subtitle  { color: #718096; font-size: 0.9rem; margin-bottom: 1.5rem; }
.org-name  { font-size: 0.78rem; color: #a0aec0; display: block; margin-top: 0.15rem; }

/* ── Tab-Navigation (shared: public.html + nlcal.html) ─────── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.5rem;
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  color: #718096;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  transition: color 0.15s;
}
.tab-btn:hover:not(.locked):not(.active) { color: #4a5568; }
.tab-btn.active {
  color: #4299e1;
  border-bottom-color: #4299e1;
}
.tab-btn.locked {
  color: #cbd5e0;
  cursor: not-allowed; /* Changed from pointer to not-allowed for locked state */
}
.tab-btn.locked .lock-icon { font-size: 0.75rem; }

/* ── Public: Year/Month Picker ────────────────────────────── */
.picker-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (max-width: 480px) { .picker-row { grid-template-columns: 1fr; } }
.picker-group label {
  display: block;
  font-size: 0.73rem;
  font-weight: 700;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.picker-group select {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  background: white;
  font-family: inherit;
  transition: border-color 0.2s;
}
.picker-group select:focus { outline: none; border-color: #4299e1; }

/* ── Public: Calendar Download Buttons ───────────────────── */
.cal-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}
.cal-btn {
  flex: 1;
  min-width: 160px;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: white;
  transition: opacity 0.2s, transform 0.1s;
}
.cal-btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.cal-btn:active { opacity: 1;    transform: translateY(0); }
.cal-btn-termine      { background: #4299e1; }
.cal-btn-schelleboem  { background: #ed8936; }
.cal-btn-jugend       { background: #48bb78; }
.cal-btn-raumbelegung { background: #718096; }
.desc-hint { font-size: 0.78rem; color: #a0aec0; margin-top: 0.2rem; margin-bottom: 0.75rem; }

/* ── Login Page ─────────────────────────────────────────── */
.login-card {
  max-width: 420px;
  margin: 4rem auto;
  padding: 2.5rem 2rem;
  text-align: center;
}
.login-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}
.login-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 0.4rem;
}
.login-subtitle {
  font-size: 0.88rem;
  color: #718096;
  margin-bottom: 2rem;
}
.btn-nextcloud {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #0082c9;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
  width: 100%;
  justify-content: center;
}
.btn-nextcloud:hover { background: #006aa3; }
.login-hint {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: #a0aec0;
}
.login-error {
  background: #fed7d7;
  color: #742a2a;
  border-radius: 6px;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  text-align: left;
}
.back-link {
  display: block;
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: #a0aec0;
  text-decoration: none;
}
.back-link:hover { color: #718096; }


/* ── NLCalApp: Textarea ───────────────────────────────────── */
textarea { width: 100%; border: 2px solid #e2e8f0; border-radius: 8px; padding: 0.75rem 1rem; font-size: 1rem; resize: vertical; min-height: 90px; font-family: inherit; transition: border-color 0.2s; }
textarea:focus { outline: none; border-color: #4299e1; }
.examples { margin-top: 0.5rem; font-size: 0.8rem; color: #a0aec0; }
.examples span { cursor: pointer; text-decoration: underline dotted; }
.examples span:hover { color: #4299e1; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 1.3rem; border: none; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background 0.2s, opacity 0.2s; white-space: nowrap; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: #4299e1; color: white; }
.btn-primary:hover:not(:disabled) { background: #3182ce; }
.btn-success { background: #48bb78; color: white; }
.btn-success:hover:not(:disabled) { background: #38a169; }
.btn-warning { background: #ed8936; color: white; }
.btn-warning:hover:not(:disabled) { background: #dd6b20; }
.btn-danger  { background: #f56565; color: white; }
.btn-danger:hover:not(:disabled)  { background: #e53e3e; }
.btn-ghost   { background: #edf2f7; color: #4a5568; }
.btn-ghost:hover:not(:disabled)   { background: #e2e8f0; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.actions { display: flex; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; }

/* ── Messages ─────────────────────────────────────────────── */
.msg { border-radius: 8px; padding: 0.75rem 1rem; margin-top: 1rem; font-size: 0.9rem; }
.msg-success { background: #c6f6d5; color: #22543d; }
.msg-error   { background: #fed7d7; color: #742a2a; }
.msg-warning { background: #fefcbf; color: #744210; }

/* ── Spinners ─────────────────────────────────────────────── */
.spinner      { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.4); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner-dark { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(0,0,0,0.15); border-top-color: #718096; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Summary Bar ──────────────────────────────────────────── */
#summary-bar { margin-top: 1rem; background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 0.75rem 1rem; font-size: 0.88rem; color: #4a5568; display: none; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.summary-pill { border-radius: 999px; padding: 0.18rem 0.6rem; font-size: 0.78rem; font-weight: 700; }
.pill-green  { background: #c6f6d5; color: #276749; }
.pill-gray   { background: #edf2f7; color: #718096; }
.pill-red    { background: #fed7d7; color: #742a2a; }
.pill-yellow { background: #fefcbf; color: #744210; }

/* ── Confirm-All Bar ──────────────────────────────────────── */
#confirm-all-bar { display: none; margin-top: 0.75rem; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
#confirm-all-bar .hint { font-size: 0.82rem; color: #718096; }

/* ── Event Cards ──────────────────────────────────────────── */
.event-card { border: 2px solid #e2e8f0; border-radius: 10px; margin-top: 1.25rem; overflow: hidden; transition: border-color 0.2s; }
.event-card.status-confirmed { border-color: #9ae6b4; }
.event-card.status-skipped   { border-color: #e2e8f0; opacity: 0.5; }
.event-card.status-error     { border-color: #fc8181; }
.card-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1rem; background: #f7fafc; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap; }
.card-num { font-size: 0.72rem; font-weight: 700; color: #a0aec0; }
.card-title-preview { font-weight: 600; font-size: 0.9rem; color: #2d3748; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.badge { border-radius: 999px; padding: 0.15rem 0.55rem; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.badge-serie        { background: #e9d8fd; color: #553c9a; }
.badge-allday       { background: #e6fffa; color: #234e52; }
.badge-multiday     { background: #e0e7ff; color: #3730a3; }
.badge-tentative    { background: #fef3c7; color: #92400e; border: 1px dashed #f6ad55; }
.badge-termine      { background: #bee3f8; color: #2b6cb0; }
.badge-schelleboem  { background: #feebc8; color: #c05621; }
.badge-jugend       { background: #c6f6d5; color: #276749; }
.badge-raumbelegung { background: #e2e8f0; color: #4a5568; }

/* ── Calendar Picker Toggles ──────────────────────────────── */
.cal-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.25rem; }
.cal-toggle { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.35rem 0.75rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; cursor: pointer; border: 2px solid transparent; transition: all 0.15s; background: #edf2f7; color: #718096; }
.cal-toggle.active-termine      { background: #bee3f8; color: #2b6cb0; border-color: #90cdf4; }
.cal-toggle.active-schelleboem  { background: #feebc8; color: #c05621; border-color: #fbd38d; }
.cal-toggle.active-jugend       { background: #c6f6d5; color: #276749; border-color: #9ae6b4; }
.cal-toggle.active-raumbelegung { background: #e2e8f0; color: #2d3748; border-color: #a0aec0; }
.cal-toggle.inactive            { background: #f7fafc; color: #cbd5e0; border-color: #e2e8f0; }
.cal-validation-hint { font-size: 0.78rem; color: #e53e3e; margin-top: 0.3rem; display: none; }

/* ── Toggle Switch ────────────────────────────────────────── */
.toggle-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.toggle-switch { position: relative; width: 38px; height: 21px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #cbd5e0; border-radius: 999px; cursor: pointer; transition: background 0.2s; }
.toggle-slider::before { content: ''; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: transform 0.2s; }
.toggle-switch input:checked + .toggle-slider               { background: #48bb78; }
.toggle-switch input:checked + .toggle-slider.slider-amber  { background: #ed8936; }
.toggle-switch input:checked + .toggle-slider.slider-indigo { background: #667eea; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(17px); }
.toggle-label { font-size: 0.85rem; font-weight: 600; color: #4a5568; cursor: pointer; }
.toggle-hint  { font-size: 0.78rem; }

/* ── Status Banners ───────────────────────────────────────── */
.status-banner { display: none; padding: 0.65rem 1rem; font-size: 0.88rem; font-weight: 600; align-items: center; gap: 0.5rem; }
.status-confirmed .status-banner { display: flex; background: #f0fff4; color: #276749; }
.status-skipped   .status-banner { display: flex; background: #f7fafc; color: #718096; }
.status-error     .status-banner { display: flex; background: #fff5f5; color: #c53030; flex-direction: column; align-items: flex-start; }
.card-body { padding: 1.1rem 1rem 0.5rem; }
.status-confirmed .card-body, .status-skipped .card-body { display: none; }

/* ── Form Fields ──────────────────────────────────────────── */
.field { margin-bottom: 0.75rem; }
.field label { display: block; font-size: 0.73rem; font-weight: 700; color: #718096; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.22rem; }
.field input { width: 100%; border: 1.5px solid #e2e8f0; border-radius: 6px; padding: 0.45rem 0.7rem; font-size: 0.9rem; background: white; font-family: inherit; }
.field input:focus { outline: none; border-color: #4299e1; }
.field-row   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.65rem; margin-bottom: 0.75rem; }
.field-row-2 { display: grid; grid-template-columns: 1fr 1fr;     gap: 0.65rem; margin-bottom: 0.75rem; }
@media (max-width: 520px) { .field-row, .field-row-2 { grid-template-columns: 1fr; } }

/* ── Multi-day ────────────────────────────────────────────── */
.multiday-row { margin-bottom: 0.6rem; }
.multiday-enddate { margin-top: 0.45rem; padding: 0.5rem 0.75rem; background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 6px; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.multiday-enddate label { font-size: 0.73rem; font-weight: 700; color: #4338ca; text-transform: uppercase; letter-spacing: 0.05em; margin: 0; white-space: nowrap; }
.multiday-enddate input { border: 1.5px solid #c7d2fe; border-radius: 6px; padding: 0.35rem 0.55rem; font-size: 0.88rem; background: white; font-family: inherit; flex: 1; min-width: 130px; }
.multiday-enddate input:focus { outline: none; border-color: #667eea; }

/* ── Tentative Hint ───────────────────────────────────────── */
.tentative-hint-box { background: #fffbeb; border: 1px dashed #f6ad55; border-radius: 6px; padding: 0.4rem 0.7rem; font-size: 0.8rem; color: #92400e; margin-bottom: 0.6rem; display: none; }

/* ── Series Block ─────────────────────────────────────────── */
.series-block { background: #faf5ff; border: 1px solid #d6bcfa; border-radius: 8px; padding: 0.75rem 0.9rem; margin-bottom: 0.75rem; }
.series-label { font-size: 0.8rem; font-weight: 700; color: #553c9a; margin-bottom: 0.35rem; }
.series-rule  { font-size: 0.88rem; color: #44337a; margin-bottom: 0.45rem; }
.occ-list { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.occ-chip { background: #e9d8fd; color: #553c9a; border-radius: 4px; padding: 0.15rem 0.45rem; font-size: 0.75rem; font-weight: 500; }
.occ-more { color: #a0aec0; font-size: 0.75rem; align-self: center; }

/* ── RfM Block ────────────────────────────────────────────── */
.rfm-block  { border-radius: 8px; padding: 0.75rem 0.9rem; margin-bottom: 0.75rem; border: 1px solid #bee3f8; background: #ebf8ff; }
.rfm-header { font-size: 0.82rem; font-weight: 700; color: #2b6cb0; margin-bottom: 0.3rem; }
.rfm-times  { font-size: 0.84rem; color: #2c5282; }

/* ── Conflict Status (inline, after parse) ────────────────── */
.conflict-status    { margin-top: 0.6rem; font-size: 0.82rem; }
.conflict-checking  { color: #718096; display: flex; align-items: center; gap: 0.4rem; }
.conflict-clear     { color: #276749; font-weight: 600; }
.conflict-check-err { color: #718096; font-style: italic; }
.conflict-warning { background: #fff5f5; border: 1px solid #fc8181; border-radius: 6px; padding: 0.65rem 0.85rem; margin-top: 0.4rem; }
.cw-title       { font-size: 0.83rem; font-weight: 700; color: #c53030; margin-bottom: 0.4rem; }
.cw-summary-bar { font-size: 0.8rem; color: #742a2a; margin-bottom: 0.5rem; padding-bottom: 0.4rem; border-bottom: 1px solid #fed7d7; }
.cw-date-group  { margin-bottom: 0.5rem; }
.cw-date-group:last-child { margin-bottom: 0; }
.cw-date-header { font-size: 0.78rem; font-weight: 700; color: #c53030; background: #fed7d7; border-radius: 4px; padding: 0.12rem 0.45rem; display: inline-block; margin-bottom: 0.25rem; }
.cw-item { font-size: 0.82rem; color: #742a2a; display: flex; align-items: center; gap: 0.4rem; border-left: 2px solid #fc8181; margin-left: 0.2rem; padding-left: 0.5rem; margin-bottom: 0.15rem; }
.cw-time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Conflict Panel (before confirm) ─────────────────────── */
.conflict-panel { margin: 0.75rem 1rem; border-radius: 8px; overflow: hidden; border: 2px solid #fc8181; }
.cp-header { background: #fff5f5; padding: 0.65rem 0.9rem; font-size: 0.88rem; font-weight: 700; color: #c53030; border-bottom: 1px solid #fed7d7; display: flex; align-items: center; gap: 0.4rem; }
.cp-body   { padding: 0.75rem 0.9rem; background: white; }
.cp-cal-label  { font-size: 0.78rem; font-weight: 700; color: #4a5568; margin: 0.5rem 0 0.3rem; display: flex; align-items: center; gap: 0.4rem; }
.cp-cal-target { font-size: 0.7rem; background: #bee3f8; color: #2b6cb0; border-radius: 3px; padding: 0.1rem 0.35rem; font-weight: 700; }
.cp-cal-other  { font-size: 0.7rem; background: #edf2f7; color: #718096; border-radius: 3px; padding: 0.1rem 0.35rem; }
.cp-conflict-row { border: 1px solid #fed7d7; border-radius: 6px; margin-bottom: 0.4rem; overflow: hidden; }
.cp-conflict-row.is-tentative { border-color: #f6ad55; }
.cp-conflict-info { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.4rem 0.65rem; background: #fff5f5; font-size: 0.83rem; color: #2d3748; }
.cp-conflict-row.is-tentative .cp-conflict-info { background: #fffbeb; }
.ci-time  { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: #c53030; }
.cp-conflict-row.is-tentative .ci-time { color: #92400e; }
.ci-title { font-weight: 600; }
.ci-date  { font-size: 0.75rem; color: #718096; }
.ci-badge { font-size: 0.7rem; border-radius: 3px; padding: 0.1rem 0.35rem; font-weight: 700; }
.ci-badge-series    { background: #e9d8fd; color: #553c9a; }
.ci-badge-single    { background: #edf2f7; color: #4a5568; }
.ci-badge-tentative { background: #fef3c7; color: #92400e; border: 1px dashed #f6ad55; }
.cp-conflict-actions { display: flex; gap: 0.3rem; padding: 0.35rem 0.65rem; background: #fafafa; border-top: 1px solid #fed7d7; flex-wrap: wrap; }
.cp-conflict-row.is-tentative .cp-conflict-actions { background: #fffdf5; border-top-color: #f6ad55; }
.ca-btn { font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: 5px; border: 1.5px solid transparent; cursor: pointer; transition: all 0.15s; }
.ca-btn-ignore  { background: #edf2f7; color: #718096; border-color: #e2e8f0; }
.ca-btn-ignore.active  { background: #e2e8f0; color: #2d3748; border-color: #a0aec0; font-weight: 700; }
.ca-btn-exdate  { background: #fef3c7; color: #92400e; border-color: #f6d860; }
.ca-btn-exdate.active  { background: #fcd34d; color: #78350f; border-color: #d97706; font-weight: 700; }
.ca-btn-delete  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.ca-btn-delete.active  { background: #fca5a5; color: #7f1d1d; border-color: #ef4444; font-weight: 700; }
.ca-btn-replace { background: #fed7aa; color: #7c2d12; border-color: #fb923c; }
.ca-btn-replace.active { background: #fb923c; color: #431407; border-color: #ea580c; font-weight: 700; }
.ca-btn-keep    { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.ca-btn-keep.active    { background: #6ee7b7; color: #064e3b; border-color: #059669; font-weight: 700; }
.cp-legend       { font-size: 0.75rem; color: #718096; padding: 0.4rem 0.9rem; background: #f7fafc; border-top: 1px solid #e2e8f0; }
.cp-series-stats { font-size: 0.84rem; font-weight: 700; color: #c53030; margin-bottom: 0.4rem; }
.cp-free-count   { color: #276749; margin-left: 0.5rem; }
.cp-actions        { display: flex; gap: 0.5rem; flex-wrap: wrap; padding: 0.65rem 0.9rem; background: #f7fafc; border-top: 1px solid #e2e8f0; align-items: center; }
.cp-action-summary { font-size: 0.78rem; color: #718096; margin-left: auto; }

/* ── Reason Box ───────────────────────────────────────────── */
.reason-box { background: #fffbeb; border: 1px solid #f6e05e; border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.82rem; color: #744210; margin-bottom: 0.75rem; }

/* ── Card Footer ──────────────────────────────────────────── */
.card-footer { padding: 0.75rem 1rem; border-top: 1px solid #f0f0f0; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.status-confirmed .card-footer, .status-skipped .card-footer { display: none; }

/* ── App Footer ───────────────────────────────────────────── */
.app-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #e2e8f0; text-align: center; font-size: 0.72rem; color: #cbd5e0; }
