/*
 * Memorink-OS FAQ-Widget Styles — v1.0
 * Customizable via CSS-Variable --mfw-primary (default: #c9a84c gold)
 */

.mfw-bubble {
  position: fixed;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: var(--mfw-primary, #c9a84c);
  color: #000;
  border: none;
  border-radius: 999px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 4px 8px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mfw-bottom-right { bottom: 24px; right: 24px; }
.mfw-bottom-left { bottom: 24px; left: 24px; }
.mfw-bubble:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.4); }
.mfw-bubble:active { transform: translateY(0); }

@media (max-width: 480px) {
  .mfw-bubble { padding: 12px 14px; font-size: 13px; }
  .mfw-bubble-text { display: none; } /* mobile: only icon */
  .mfw-bottom-right { bottom: 16px; right: 16px; }
  .mfw-bottom-left { bottom: 16px; left: 16px; }
}

/* ── Modal ── */
.mfw-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: mfw-fade 0.2s ease;
}
@keyframes mfw-fade { from { opacity: 0 } to { opacity: 1 } }

.mfw-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.mfw-modal-panel {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  color: #1a1a1a;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  animation: mfw-slide 0.25s ease;
}
@keyframes mfw-slide { from { transform: translateY(20px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

.mfw-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}
.mfw-modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}
.mfw-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 0 8px;
  border-radius: 8px;
  transition: background 0.15s;
}
.mfw-close:hover { background: #f3f3f3; color: #000; }

.mfw-search-wrap {
  padding: 12px 24px 0;
}
.mfw-search {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.mfw-search:focus { border-color: var(--mfw-primary, #c9a84c); }

.mfw-categories {
  padding: 12px 24px 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mfw-cat {
  background: #f3f3f3;
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mfw-cat:hover { background: #e8e8e8; }
.mfw-cat.active {
  background: var(--mfw-primary, #c9a84c);
  color: #000;
  font-weight: 600;
}

.mfw-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px 24px;
}

.mfw-faq-item {
  border-bottom: 1px solid #f0f0f0;
  padding: 14px 0;
}
.mfw-faq-item:last-child { border-bottom: none; }
.mfw-faq-q {
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  list-style: none;
  position: relative;
  padding-right: 24px;
  outline: none;
}
.mfw-faq-q::-webkit-details-marker { display: none; }
.mfw-faq-q::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--mfw-primary, #c9a84c);
  transition: transform 0.2s;
}
.mfw-faq-item[open] .mfw-faq-q::after {
  content: '−';
}
.mfw-faq-a {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: #444;
}
.mfw-faq-a a { color: var(--mfw-primary, #c9a84c); }

.mfw-modal-footer {
  padding: 16px 24px;
  background: #fafafa;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.mfw-footer-hint {
  margin: 0;
  font-size: 14px;
  color: #666;
}
.mfw-cta-btn {
  background: var(--mfw-primary, #c9a84c);
  color: #000;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.15s;
}
.mfw-cta-btn:hover { transform: translateY(-1px); }

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
  .mfw-modal-panel {
    background: #1e1e1e;
    color: #f0f0f0;
  }
  .mfw-modal-header { border-bottom-color: rgba(255,255,255,0.08); }
  .mfw-close { color: #aaa; }
  .mfw-close:hover { background: rgba(255,255,255,0.06); color: #fff; }
  .mfw-search {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
    color: #fff;
  }
  .mfw-cat { background: rgba(255,255,255,0.06); color: #ddd; }
  .mfw-cat:hover { background: rgba(255,255,255,0.1); }
  .mfw-faq-item { border-bottom-color: rgba(255,255,255,0.06); }
  .mfw-faq-a { color: #ccc; }
  .mfw-modal-footer { background: rgba(255,255,255,0.03); border-top-color: rgba(255,255,255,0.06); }
}
