/* MindfulPath Plugin — mp-plugin.css */

/* ── Search Trigger Button ─────────────────────────────────────── */
.mp-search-trigger {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 10px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 100px;
  font-size: .82rem;
  font-family: inherit;
  color: #3c434a;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: box-shadow .15s, background .15s;
  backdrop-filter: blur(6px);
}
.mp-search-trigger:hover { background: #fff; box-shadow: 0 3px 14px rgba(0,0,0,0.15); }
.mp-search-trigger svg   { flex-shrink: 0; color: #646970; }
.mp-search-kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: .72rem;
  background: #f0f0f1;
  border: 1px solid #c3c4c7;
  border-radius: 3px;
  color: #646970;
  line-height: 1.5;
}

/* ── Search Overlay ────────────────────────────────────────────── */
.mp-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}
.mp-search-modal {
  width: 100%;
  max-width: 680px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
}
.mp-search-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f1;
}
.mp-search-icon { font-size: 1.1rem; }
.mp-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.05rem;
  font-family: inherit;
  color: #1d2327;
  background: transparent;
}
.mp-search-input::placeholder { color: #aaa; }
.mp-search-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #646970;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.mp-search-close:hover { background: #f0f0f1; }

/* Intent Answer */
.mp-intent-answer {
  border-bottom: 1px solid #f0f0f1;
  background: #fffbf2;
}
.mp-intent-inner { padding: 14px 18px; }
.mp-intent-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #c2410c;
  margin-bottom: 6px;
}
.mp-intent-quote {
  margin: 0 0 6px;
  padding-left: 12px;
  border-left: 3px solid #f97316;
  font-style: italic;
  color: #3c434a;
  font-size: .9rem;
  line-height: 1.5;
}
.mp-intent-meta { font-size: .75rem; color: #646970; margin-bottom: 8px; }
.mp-intent-link {
  font-size: .82rem;
  font-weight: 600;
  color: #2271b1;
  text-decoration: none;
}
.mp-intent-link:hover { text-decoration: underline; }

/* Results */
.mp-search-results {
  overflow-y: auto;
  flex: 1;
}
.mp-search-item a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 18px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f9f9f9;
  transition: background .1s;
}
.mp-search-item a:hover,
.mp-search-item a:focus { background: #f6f7f7; outline: none; }
.mp-si-title   { font-size: .93rem; font-weight: 600; color: #1d2327; }
.mp-si-excerpt { font-size: .78rem; color: #646970; line-height: 1.45; }
.mp-search-hint-text,
.mp-search-loading,
.mp-search-empty,
.mp-search-error {
  padding: 20px 18px;
  font-size: .85rem;
  color: #646970;
  margin: 0;
}
.mp-search-error { color: #d63638; }

/* Footer */
.mp-search-footer {
  padding: 8px 18px;
  border-top: 1px solid #f0f0f1;
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: #aaa;
}
.mp-search-footer kbd {
  padding: 1px 4px;
  background: #f0f0f1;
  border: 1px solid #c3c4c7;
  border-radius: 3px;
  font-family: inherit;
}

/* Source badges (shared with search results) */
.mp-source-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 100px;
  background: #e5e7eb;
  color: #374151;
}
.mp-source-dhammatalks { background: #dbeafe; color: #1e40af; }
.mp-source-suttacentral { background: #d1fae5; color: #065f46; }
.mp-source-ati   { background: #fef3c7; color: #92400e; }
.mp-source-blog  { background: #f3e8ff; color: #6b21a8; }
.mp-source-MN, .mp-source-SN, .mp-source-AN,
.mp-source-KN, .mp-source-DN { background: #e0e7ff; color: #3730a3; }

/* ── Read indicators ───────────────────────────────────────────── */
a.mp-read { opacity: .55; }
.mp-archive-item.mp-read a::after {
  content: ' ✓';
  font-size: .7rem;
  color: #1a7f37;
}

/* ── Daily Practice Block ──────────────────────────────────────── */
.mp-daily-practice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.mp-practice-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px 22px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.mp-practice-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6b7280;
  margin-bottom: 12px;
}
.mp-practice-theme {
  font-size: .82rem;
  color: #c2410c;
  margin: 0 0 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.mp-practice-quote {
  margin: 0 0 10px;
  padding-left: 12px;
  border-left: 3px solid #f97316;
  font-style: italic;
  font-size: .88rem;
  color: #374151;
  line-height: 1.55;
}
.mp-practice-action {
  font-size: .83rem;
  color: #4b5563;
  margin: 0 0 12px;
  line-height: 1.5;
}
.mp-practice-link {
  font-size: .82rem;
  font-weight: 600;
  color: #2271b1;
  text-decoration: none;
}
.mp-practice-link:hover { text-decoration: underline; }
.mp-practice-loading { font-size: .83rem; color: #aaa; margin: 0; }

/* ── Breathing Timer ───────────────────────────────────────────── */
.mp-breathe-timer { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.mp-breathe-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: border-color .5s, background .5s, transform 3s ease-in-out;
  background: #f9fafb;
}
.mp-breathe-circle.mp-breathe-in    { border-color: #3b82f6; background: #eff6ff; transform: scale(1.12); }
.mp-breathe-circle.mp-breathe-hold  { border-color: #8b5cf6; background: #f5f3ff; transform: scale(1.12); }
.mp-breathe-circle.mp-breathe-out   { border-color: #10b981; background: #ecfdf5; transform: scale(1); }
.mp-breathe-circle.mp-breathe-rest  { border-color: #e5e7eb; background: #f9fafb; transform: scale(1); }
#mp-breathe-phase  { font-size: .73rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .06em; }
.mp-breathe-count  { font-size: 1.6rem; font-weight: 700; color: #1d2327; line-height: 1; }
.mp-breathe-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.mp-breathe-duration-label { font-size: .8rem; color: #6b7280; }
.mp-breathe-select {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: .8rem;
  font-family: inherit;
}
.mp-breathe-message {
  font-size: .82rem;
  font-style: italic;
  color: #6b7280;
  text-align: center;
  padding: 6px 12px;
  background: #f9fafb;
  border-radius: 6px;
  width: 100%;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.mp-btn {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: .83rem;
  font-family: inherit;
  font-weight: 600;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
  line-height: 1.4;
}
.mp-btn:hover { background: #f3f4f6; border-color: #9ca3af; }
.mp-btn-primary {
  background: #2271b1;
  border-color: #2271b1;
  color: #fff;
}
.mp-btn-primary:hover { background: #135e96; border-color: #135e96; color: #fff; }

/* ── Reflection ────────────────────────────────────────────────── */
.mp-reflection-question { margin-bottom: 10px; }
.mp-reflection-q { font-size: .9rem; color: #1d2327; font-style: italic; line-height: 1.55; margin: 0; }
.mp-reflection-textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: .83rem;
  font-family: inherit;
  resize: vertical;
  color: #1d2327;
  box-sizing: border-box;
  margin-bottom: 10px;
}
.mp-reflection-textarea:focus { outline: none; border-color: #2271b1; box-shadow: 0 0 0 2px rgba(34,113,177,0.15); }
.mp-reflection-actions { display: flex; align-items: center; gap: 10px; }
.mp-reflection-saved { font-size: .8rem; color: #1a7f37; font-weight: 600; }

/* ── Pause & Choose ────────────────────────────────────────────── */
.mp-pause-intro { font-size: .83rem; color: #6b7280; margin: 0 0 12px; }
.mp-pause-scenarios { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mp-pause-btn {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: .78rem;
  font-family: inherit;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151 !important;
  cursor: pointer;
  transition: all .15s;
}
.mp-pause-btn:hover { background: #f3f4f6; border-color: #9ca3af; color: #374151 !important; }
.mp-pause-btn-active { background: #2271b1 !important; border-color: #2271b1 !important; color: #fff !important; }
.mp-pause-result { margin-top: 4px; }
.mp-pause-teaching {
  background: #fffbf2;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 16px 18px;
}
.mp-pause-teaching-title { font-size: .8rem; font-weight: 700; color: #c2410c; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .05em; }
.mp-pause-quote {
  font-style: italic;
  font-size: .88rem;
  color: #374151;
  border-left: 3px solid #f97316;
  padding-left: 12px;
  margin: 0 0 12px;
  line-height: 1.55;
}
.mp-pause-read-btn { margin-top: 4px; }

/* ── Mega Archive ──────────────────────────────────────────────── */
.mp-mega-archive { margin: 20px 0; }
.mp-archive-search-wrap { margin-bottom: 16px; }
.mp-archive-filter {
  width: 100%;
  max-width: 400px;
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: .88rem;
  font-family: inherit;
  color: #1d2327;
}
.mp-archive-filter:focus { outline: none; border-color: #2271b1; box-shadow: 0 0 0 2px rgba(34,113,177,0.15); }
.mp-archive-source {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.mp-archive-source-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  background: #f9fafb;
  list-style: none;
  user-select: none;
}
.mp-archive-source-head:hover { background: #f3f4f6; }
.mp-archive-source-head::marker,
.mp-archive-source-head::-webkit-details-marker { display: none; }
.mp-archive-source[open] .mp-archive-source-head { border-bottom: 1px solid #e5e7eb; }
.mp-archive-source-body { padding: 10px 16px 14px; }
.mp-archive-group { margin-bottom: 8px; }
.mp-archive-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
  user-select: none;
}
.mp-archive-group-head::marker,
.mp-archive-group-head::-webkit-details-marker { display: none; }
.mp-archive-count {
  font-size: .72rem;
  background: #e5e7eb;
  color: #6b7280;
  padding: 1px 7px;
  border-radius: 100px;
  font-weight: 600;
}
.mp-archive-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mp-archive-item a {
  font-size: .83rem;
  color: #2271b1;
  text-decoration: none;
  line-height: 1.4;
}
.mp-archive-item a:hover { text-decoration: underline; }
.mp-archive-empty { font-size: .88rem; color: #6b7280; }

/* ── Streak widget ─────────────────────────────────────────────── */
.mp-streak-widget {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  color: #c2410c;
  background: #fff7ed;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid #fed7aa;
}

/* ── Resume reading ────────────────────────────────────────────── */
.mp-resume-reading {
  display: none;
  font-size: .83rem;
  color: #4b5563;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 12px;
}
.mp-resume-label { color: #6b7280; }
.mp-resume-link  { color: #2271b1; font-weight: 600; text-decoration: none; }
.mp-resume-link:hover { text-decoration: underline; }

/* ── Admin styles ──────────────────────────────────────────────── */
#mp-search-input.widefat {
  font-family: monospace;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .mp-search-overlay { padding-top: 0; align-items: flex-end; }
  .mp-search-modal   { border-radius: 16px 16px 0 0; max-height: 85vh; }
  .mp-search-trigger { top: auto; bottom: 16px; right: 16px; }
  .mp-daily-practice { grid-template-columns: 1fr; }
}
