/**
 * Kennti Lernfortschritt — Widget & Registration Bar Styles
 * Brand colors: Blue #4A90E2, Pink #D94F78, Green #2E9E44
 * border-radius: 12px (Kennti standard)
 * No dark mode. No external fonts (inherit from theme).
 */

/* ============================================================
   CARD BASE
   ============================================================ */
.klpf-card {
  background: #ffffff;
  border: 1px solid #e8edf2;
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
  font-family: inherit;
  box-shadow: 0 2px 12px rgba(74, 144, 226, 0.08);
}

/* ============================================================
   HEADER
   ============================================================ */
.klpf-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.klpf-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.klpf-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a2333;
  letter-spacing: -0.01em;
}

/* ============================================================
   INACTIVE STATE
   ============================================================ */
.klpf-inactive .klpf-desc {
  font-size: 0.9rem;
  color: #5a6a7e;
  margin: 0 0 20px;
  line-height: 1.55;
}

/* ============================================================
   ACTIVE STATE — PROGRESS ROWS
   ============================================================ */
.klpf-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.klpf-row {
  display: grid;
  grid-template-columns: 130px 1fr 46px;
  align-items: center;
  gap: 10px;
}

.klpf-row-label {
  font-size: 0.85rem;
  color: #3d4f60;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress bar */
.klpf-bar-wrap {
  height: 10px;
  background: #edf2f7;
  border-radius: 999px;
  overflow: hidden;
}

.klpf-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4a90e2 0%, #D94F78 100%);
  transition: width 0.4s ease;
  min-width: 4px;
}

.klpf-count {
  font-size: 0.8rem;
  color: #5a6a7e;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Streak row */
.klpf-streak-row {
  grid-template-columns: 130px 1fr;
}

.klpf-streak {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #D94F78;
}

/* ============================================================
   SYNC INFO LINE
   ============================================================ */
.klpf-sync-info {
  display: flex;
  gap: 6px;
  font-size: 0.8rem;
  color: #8a9ab0;
  margin: 0 0 18px;
}

/* ============================================================
   ACTIONS
   ============================================================ */
.klpf-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.klpf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition:
    opacity 0.15s,
    transform 0.1s;
  text-decoration: none;
  line-height: 1;
}

.klpf-btn:hover {
  opacity: 0.88;
}

.klpf-btn:active {
  transform: scale(0.97);
}

.klpf-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.klpf-btn-activate {
  background: linear-gradient(135deg, #4a90e2, #D94F78);
  color: #ffffff;
}

.klpf-btn-sync {
  background: #4a90e2;
  color: #ffffff;
}

.klpf-btn-pause {
  background: transparent;
  color: #5a6a7e;
  border: 1px solid #d4dce6;
}

.klpf-btn-pause:hover {
  border-color: #aab8c8;
  background: #f5f8fc;
}

.klpf-btn-register {
  background: linear-gradient(135deg, #4a90e2, #D94F78);
  color: #ffffff;
  white-space: nowrap;
}

/* ============================================================
   STATUS MESSAGE
   ============================================================ */
.klpf-status {
  font-size: 0.82rem;
  margin: 10px 0 0;
  min-height: 1.2em;
}

.klpf-status.klpf-ok {
  color: #2E9E44;
}

.klpf-status.klpf-err {
  color: #ff3d3d;
}

/* ============================================================
   REGISTRATION BAR (bottom of tool pages)
   ============================================================ */
.klpf-regbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 2px solid #4a90e2;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  flex-wrap: wrap;
}

.klpf-regbar-msg {
  font-size: 0.9rem;
  color: #1a2333;
  margin: 0;
  flex: 1;
  min-width: 200px;
  line-height: 1.45;
}

.klpf-regbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.klpf-regbar-close {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: #8a9ab0;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.klpf-regbar-close:hover {
  color: #3d4f60;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .klpf-card {
    padding: 18px 16px;
  }

  .klpf-row {
    grid-template-columns: 110px 1fr 40px;
    gap: 8px;
  }

  .klpf-row-label {
    font-size: 0.8rem;
  }

  .klpf-actions {
    flex-direction: column;
  }

  .klpf-btn {
    width: 100%;
    justify-content: center;
  }

  .klpf-regbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
  }

  .klpf-regbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .klpf-btn-register {
    flex: 1;
    justify-content: center;
  }
}
