/* ═══════════════════════════════════════════════════════════
   summary-export.css
   Styles for the email modal, download button, and share UX.
   Uses semantic tokens from main stylesheet for light and dark themes.
   ═══════════════════════════════════════════════════════════ */

/* ── Download PDF button ───────────────────────────────────── */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-download svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Share actions row ─────────────────────────────────────── */
.shareActions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* ── Modal overlay ─────────────────────────────────────────── */
.email-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  padding: 1rem;
}

.email-modal-overlay[hidden] {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

/* ── Modal card ────────────────────────────────────────────── */
.email-modal {
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
}

/* ── Modal header ──────────────────────────────────────────── */
.email-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.email-modal__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.email-modal__hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
  line-height: 1.5;
}

/* Close X button */
.email-modal__close-x {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-subtle);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.email-modal__close-x:hover {
  background: var(--surface-2);
  color: var(--text);
}

.email-modal__close-x:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ── Modal fields ──────────────────────────────────────────── */
.email-modal__field {
  margin-bottom: 0.75rem;
}

.email-modal__field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.email-modal__field input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  box-sizing: border-box;
}

.email-modal__field input[type="text"]:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
  border-color: var(--primary);
}

.email-modal__field textarea {
  width: 100%;
  min-height: 220px;
  padding: 0.6rem 0.65rem;
  font-size: 0.82rem;
  font-family: 'Courier New', Courier, monospace;
  line-height: 1.5;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  resize: vertical;
  box-sizing: border-box;
}

.email-modal__field textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
  border-color: var(--primary);
}

/* ── Modal actions ─────────────────────────────────────────── */
.email-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  align-items: center;
}

.email-modal__actions .btn {
  min-height: 44px;
}

.email-modal__feedback {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--success);
  margin-left: 0.5rem;
}

.email-modal__feedback.hidden {
  display: none;
}

/* ── Privacy note ──────────────────────────────────────────── */
.email-modal__privacy {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .email-modal {
    padding: 1rem;
    max-height: 95vh;
  }

  .email-modal__field textarea {
    min-height: 160px;
    font-size: 0.78rem;
  }

  .email-modal__actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ── Print: hide modal entirely ────────────────────────────── */
@media print {
  .email-modal-overlay {
    display: none !important;
  }
}
