/* ============================================
   ReadPuppy Components — components.css ?v=1.0
   ============================================ */

/* --- Buttons --- */
.rp-btn {
  display: inline-block;
  background: var(--rp-purple);
  color: var(--rp-white);
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: background 0.2s ease;
  line-height: 1.4;
}

.rp-btn:hover {
  background: var(--rp-purple-dark);
  color: var(--rp-white);
  text-decoration: none;
}

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

.rp-btn--secondary {
  background: var(--rp-green);
}

.rp-btn--secondary:hover {
  background: #177e5e;
}

.rp-btn--outline {
  background: transparent;
  color: var(--rp-purple);
  border: 2px solid var(--rp-purple);
}

.rp-btn--outline:hover {
  background: var(--rp-purple);
  color: var(--rp-white);
}

.rp-btn--auto {
  width: auto;
}

/* --- Card --- */
.rp-card {
  background: var(--rp-white);
  border: 1px solid var(--rp-border);
  border-radius: 12px;
  padding: 20px;
}

/* --- Progress Bar --- */
.rp-progress-bar {
  height: 6px;
  background: var(--rp-border);
  border-radius: 3px;
  overflow: hidden;
}

.rp-progress-fill {
  height: 100%;
  background: var(--rp-purple);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* --- Content Boxes (topic page) --- */
.rp-box {
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  border-top: 4px solid;
}

.rp-box--do {
  border-top-color: var(--rp-green);
  background: var(--rp-green-light);
  color: var(--rp-green-text);
}

.rp-box--dont {
  border-top-color: var(--rp-amber);
  background: var(--rp-amber-light);
  color: var(--rp-amber-text);
}

.rp-box--redflag {
  border-top-color: var(--rp-red);
  background: var(--rp-red-light);
  color: var(--rp-red-text);
}

.rp-box--bottomline {
  border-top-color: var(--rp-purple);
  background: var(--rp-purple-light);
  color: var(--rp-purple-text);
}

.rp-box__title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 12px;
}

.rp-box__list {
  padding-left: 0;
}

.rp-box__list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.rp-box__list li::before {
  position: absolute;
  left: 0;
  top: 0;
}

.rp-box--do .rp-box__list li::before {
  content: "\2713";
  color: var(--rp-green);
  font-weight: 700;
}

.rp-box--dont .rp-box__list li::before {
  content: "\2717";
  color: var(--rp-amber);
  font-weight: 700;
}

.rp-box--redflag .rp-box__list li::before {
  content: "\26A0";
  color: var(--rp-red);
}

/* --- Form Elements --- */
.rp-form-group {
  margin-bottom: 20px;
}

.rp-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--rp-dark);
}

.rp-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--rp-dark);
  background: var(--rp-white);
  transition: border-color 0.2s ease;
}

.rp-input:focus {
  outline: none;
  border-color: var(--rp-purple);
  box-shadow: 0 0 0 3px rgba(127, 119, 221, 0.15);
}

.rp-textarea {
  resize: vertical;
  min-height: 120px;
}

/* --- Checkbox --- */
.rp-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
}

.rp-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--rp-purple);
  flex-shrink: 0;
  cursor: pointer;
}

.rp-check__text {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* --- Badge --- */
.rp-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.rp-badge--test {
  background: #FFF3CD;
  color: #856404;
  border: 1px solid #FFEEBA;
}

.rp-badge--available {
  background: var(--rp-green-light);
  color: var(--rp-green-text);
}

.rp-badge--used {
  background: var(--rp-purple-light);
  color: var(--rp-purple-text);
}

/* --- Alert --- */
.rp-alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.rp-alert--error {
  background: var(--rp-red-light);
  color: var(--rp-red-text);
  border: 1px solid #f5c6c6;
}

.rp-alert--success {
  background: var(--rp-green-light);
  color: var(--rp-green-text);
  border: 1px solid #b5e4d2;
}

/* --- Expandable Section --- */
.rp-expand {
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  margin: 16px 0;
  overflow: hidden;
}

.rp-expand__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--rp-white);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--rp-dark);
  font-family: inherit;
}

.rp-expand__header:hover {
  background: var(--rp-bg);
}

.rp-expand__icon {
  transition: transform 0.2s ease;
  font-size: 0.85rem;
  color: var(--rp-muted);
}

.rp-expand.is-open .rp-expand__icon {
  transform: rotate(180deg);
}

.rp-expand__body {
  display: none;
  padding: 0 18px 18px;
}

.rp-expand.is-open .rp-expand__body {
  display: block;
}

/* --- Loading Spinner --- */
.rp-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--rp-border);
  border-top-color: var(--rp-purple);
  border-radius: 50%;
  animation: rp-spin 0.6s linear infinite;
}

@keyframes rp-spin {
  to { transform: rotate(360deg); }
}
