/* ============================================================
   ABIDE - Component Library
   All components use the new glass token system.
   ============================================================ */

/* --- Scripture Card --- */
.scripture-card {
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.scripture-card::before {
  content: '\201C';
  font-family: var(--font-serif);
  font-size: 8rem;
  color: rgba(255, 255, 255, 0.12);
  position: absolute;
  top: -1.5rem;
  left: var(--space-3);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.scripture-card--morning {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
}

.scripture-card--evening {
  background: linear-gradient(135deg, var(--accent2, #7A6898) 0%, color-mix(in srgb, var(--accent2, #5A4870) 80%, black) 100%);
}

.scripture-card__text {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  line-height: var(--leading-scripture);
  font-style: italic;
  position: relative;
  z-index: 1;
  margin-bottom: var(--space-4);
}

.scripture-card__reference {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  opacity: 0.85;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.scripture-card__translation {
  font-size: var(--text-xs);
  opacity: 0.6;
  margin-top: var(--space-1);
}

/* --- Session Toggle (Morning / Evening) --- */
.session-toggle {
  display: flex;
  background: var(--bg-sunken);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 3px;
}

.session-toggle__btn {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  transition: all var(--transition-base);
  text-align: center;
  cursor: pointer;
  background: none;
  border: none;
}

.session-toggle__btn--active[data-session="morning"] {
  background: var(--accent-light, #E35336);
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.session-toggle__btn--active[data-session="evening"] {
  background: var(--accent2, #7A6898);
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* --- Reflection Prompt Card --- */
.prompt-card {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--glass-fill);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.prompt-card__number {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: var(--leading-normal);
  padding-top: 2px;
  flex-shrink: 0;
  min-width: 1.5rem;
}

.prompt-card__text {
  font-size: var(--text-base);
  color: var(--text-primary);
  line-height: var(--leading-normal);
  flex: 1;
}

/* --- Faith Stretch Card --- */
.stretch-card {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  position: relative;
  overflow: hidden;
}

.stretch-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light, var(--accent)));
}

.stretch-card__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}

.stretch-card__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  line-height: var(--leading-snug);
}

.stretch-card__description {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

/* --- Prayer Card --- */
.prayer-card {
  background: var(--glass-fill);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .prayer-card {
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
}

.prayer-card__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}

.prayer-card__text {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--text-primary);
  line-height: var(--leading-scripture);
  font-style: italic;
}

/* --- Section Header --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.section-action {
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: var(--weight-medium);
}

/* --- Devotion Body Text --- */
.devotion-paragraph {
  font-size: var(--text-md);
  color: var(--text-primary);
  line-height: var(--leading-scripture);
  margin-bottom: var(--space-5);
}

.devotion-scripture-block {
  background: var(--bg-sunken);
  border-left: 3px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-4) var(--space-5);
  margin: var(--space-5) 0;
}

.devotion-scripture-block__text {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--text-primary);
  line-height: var(--leading-scripture);
}

.devotion-scripture-block__ref {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-2);
  font-weight: var(--weight-medium);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn-primary:hover {
  background: var(--accent-light, var(--accent));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 40%, transparent);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--accent) 20%, transparent);
}

.btn-secondary {
  background: var(--glass-fill);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--divider);
}

.btn-ghost {
  background: none;
  color: var(--accent);
}

.btn-ghost:hover {
  background: var(--accent-soft);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

/* --- Icon Button --- */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
  background: none;
  border: none;
}

.icon-btn:hover {
  background: var(--bg-sunken);
  color: var(--text-primary);
}

/* --- Pill Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
}

.badge-primary {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-morning {
  background: color-mix(in srgb, var(--accent-light, var(--accent)) 14%, transparent);
  color: var(--accent-light, var(--accent));
}

.badge-evening {
  background: color-mix(in srgb, var(--accent2, #7A6898) 14%, transparent);
  color: var(--accent2, #7A6898);
}

/* --- Card --- */
.card {
  background: var(--glass-fill);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

.card-body {
  padding: var(--space-5);
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: var(--divider);
  margin: var(--space-5) 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: var(--space-5) 0;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--divider);
}

/* --- Progress Bar --- */
.progress-bar {
  height: 4px;
  background: var(--divider);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* --- Form Elements --- */
.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-fill);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  -webkit-appearance: none;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.input::placeholder {
  color: var(--text-tertiary);
}

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: var(--leading-normal);
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input-wrap .input {
  padding-left: calc(var(--space-4) + 24px + var(--space-2));
}

/* --- Toggle Switch --- */
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
}

.toggle__info {
  flex: 1;
}

.toggle__label {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.toggle__description {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: 2px;
}

.toggle__switch {
  position: relative;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}

.toggle__switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle__track {
  position: absolute;
  inset: 0;
  background: var(--divider);
  border-radius: var(--radius-full);
  transition: background var(--transition-base);
  cursor: pointer;
}

.toggle__track::after {
  content: '';
  position: absolute;
  width: 27px;
  height: 27px;
  left: 2px;
  top: 2px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-base);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle__switch input:checked + .toggle__track {
  background: var(--accent);
}

.toggle__switch input:checked + .toggle__track::after {
  transform: translateX(20px);
}

/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  gap: var(--space-4);
}

.empty-state__icon {
  color: var(--text-tertiary);
  opacity: 0.5;
}

.empty-state__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--text-primary);
}

.empty-state__description {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 280px;
  line-height: var(--leading-normal);
}

/* --- Collapsible --- */
.collapsible__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-4) 0;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
  text-align: left;
}

.collapsible__trigger-text {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.collapsible__chevron {
  color: var(--text-tertiary);
  transition: transform var(--transition-base);
}

.collapsible.open .collapsible__chevron {
  transform: rotate(180deg);
}

.collapsible__content {
  display: none;
  padding-bottom: var(--space-4);
}

.collapsible.open .collapsible__content {
  display: block;
}

/* --- Streak Counter --- */
.streak-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--accent-soft);
  border-radius: var(--radius-full);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

.streak-badge__flame {
  font-size: var(--text-lg);
  line-height: 1;
}

.streak-badge__count {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--accent);
}

.streak-badge__label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

/* --- Timer Display --- */
.timer-display {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--accent);
  text-align: center;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* --- Source Card (for plan builder) --- */
.source-card {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--glass-fill);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-md);
  border: 1.5px solid var(--glass-border);
  transition: border-color var(--transition-fast);
  cursor: pointer;
}

.source-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.source-card__check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all var(--transition-fast);
}

.source-card.selected .source-card__check {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.source-card__content {
  flex: 1;
  min-width: 0;
}

.source-card__pastor {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
}

.source-card__title {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.source-card__url {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Midday Prompt Banner --- */
.midday-banner {
  background: var(--glass-fill);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .midday-banner {
  background: var(--glass-fill);
}

.midday-banner__icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.midday-banner__content {}

.midday-banner__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--accent);
  margin-bottom: var(--space-1);
}

.midday-banner__text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

/* --- Completion Checkmark --- */
.complete-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  border: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
  background: none;
  transition: all var(--transition-base);
}

.complete-btn.completed {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

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

/* --- Pastor Chip (Plan Builder) --- */
.pastor-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--glass-fill);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  white-space: nowrap;
}

.pastor-chip--add {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pastor-chip--add:hover {
  background: var(--accent-soft);
}

/* --- Palette Card (Theme Picker) --- */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-3);
}

@media (max-width: 360px) {
  .palette-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.palette-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-3) var(--space-2);
  background: var(--glass-fill);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.palette-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.palette-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.palette-dots {
  display: flex;
  gap: 3px;
}

.palette-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.palette-name {
  font-size: 9px;
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
