/* ==========================================================================
   TIMEOPERA MODERN MINIMALIST FEEDBACK COMPONENT
   Clean 2026 SaaS aesthetic with physical handwriting & luxury fountain pen
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&display=swap');

/* --------------------------------------------------------------------------
   FLOATING FEEDBACK TRIGGER (Bottom Left)
   -------------------------------------------------------------------------- */
.mf-floating-trigger {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 990;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 650;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.mf-floating-trigger:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.mf-floating-trigger:active {
  transform: translateY(0) scale(0.98);
}

.mf-trigger-icon {
  font-size: 16px;
  line-height: 1;
  display: inline-block;
  transition: transform 0.2s ease;
}

.mf-floating-trigger:hover .mf-trigger-icon {
  transform: rotate(-10deg) scale(1.15);
}

@media (max-width: 640px) {
  .mf-floating-trigger {
    bottom: 16px;
    left: 16px;
    padding: 8px 14px 8px 12px;
    font-size: 12.5px;
  }
}

/* --------------------------------------------------------------------------
   SLEEK FLOATING MODAL OVERLAY & BACKDROP
   -------------------------------------------------------------------------- */
.mf-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: visibility 0.25s ease, opacity 0.25s ease;
}

.mf-modal-overlay.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.mf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mf-modal-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 530px;
  transform: scale(0.95) translateY(14px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 92vh;
  overflow-y: auto;
}

.mf-modal-overlay.is-open .mf-modal-container {
  transform: scale(1) translateY(0);
}

/* Modal Close Button */
.mf-modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 20;
}

.mf-modal-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
  transform: rotate(90deg);
}

/* Modern Card Canvas */
.modern-feedback-card {
  max-width: 530px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.03);
  padding: 30px 26px;
  box-sizing: border-box;
  position: relative;
  transition: box-shadow 0.2s ease;
}

.modern-feedback-card:hover {
  box-shadow: 0 16px 36px -12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.03);
}

/* Minimal Header */
.mf-header {
  text-align: center;
  margin-bottom: 16px;
}

.mf-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  margin: 0 0 4px 0;
  line-height: 1.25;
}

.mf-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 450;
  margin: 0;
  line-height: 1.4;
}

/* Form Container */
.mf-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* --------------------------------------------------------------------------
   MODERN FLOATING STAR RATING
   -------------------------------------------------------------------------- */
.mf-stars-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.mf-stars-row {
  display: inline-flex;
  gap: 6px;
}

.mf-star-btn {
  background: none;
  border: none;
  padding: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 6px;
}

.mf-star-btn:hover {
  transform: scale(1.18);
}

.mf-star-btn svg {
  width: 25px;
  height: 25px;
  fill: #e2e8f0;
  transition: fill 0.15s ease;
}

.mf-star-btn.is-active svg,
.mf-star-btn.is-hovered svg {
  fill: #f59e0b;
  filter: drop-shadow(0 1px 4px rgba(245, 158, 11, 0.35));
}

.mf-rating-label {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  height: 16px;
  transition: color 0.15s ease;
}

.mf-rating-label.active {
  color: #f59e0b;
}

/* --------------------------------------------------------------------------
   LINEAR / macOS STYLE SEGMENTED CONTROL
   -------------------------------------------------------------------------- */
.mf-segment-track {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  gap: 3px;
}

.mf-segment-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 550;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-align: center;
}

.mf-segment-btn:hover {
  color: #0f172a;
}

.mf-segment-btn.is-active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* --------------------------------------------------------------------------
   LINED FEEDBACK TEXT BOX & CURSIVE FOUNTAIN PEN
   -------------------------------------------------------------------------- */
.mf-paper-sheet {
  position: relative;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mf-paper-sheet.is-focused {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12), 0 1px 4px rgba(15, 23, 42, 0.06);
}

/* Textarea Container */
.mf-textarea-container {
  position: relative;
  overflow: hidden;
}

/* Lined Textarea with Cursive Ink Font & Same Line Visibility */
.mf-textarea-paper {
  width: 100%;
  border: none;
  background: #ffffff;
  padding: 10px 14px 10px 14px;
  /* Genuine Cursive Ink Pen Font */
  font-family: 'Caveat', cursive, var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  color: #1e3a8a; /* Classic Royal Fountain Pen Blue Ink */
  line-height: 26px;
  letter-spacing: 0.02em;
  min-height: 92px;
  resize: vertical;
  box-sizing: border-box;
  background-image: repeating-linear-gradient(transparent, transparent 25px, #f1f5f9 25px, #f1f5f9 26px);
  background-attachment: local;
  outline: none;
  display: block;
}

.mf-textarea-paper::placeholder {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: #94a3b8;
  letter-spacing: 0;
}

/* --------------------------------------------------------------------------
   THE ANIMATED PHYSICAL FOUNTAIN PEN (Realistic Hand Kinematics & Rotation)
   -------------------------------------------------------------------------- */
.mf-pen-actor {
  position: absolute;
  left: 0;
  top: 0;
  width: 54px;
  height: 81px;
  margin-left: -2px;
  margin-top: -81px; /* Positions golden nib tip exactly at (x, y) */
  pointer-events: none;
  z-index: 15;
  transform-origin: 2px 81px; /* Exact nib tip pivot */
  transition: transform 0.14s cubic-bezier(0.2, 0.8, 0.25, 1), opacity 0.25s ease;
  will-change: transform;
  opacity: 0;
}

/* Visible when user focuses or writes */
.mf-paper-sheet.is-focused .mf-pen-actor {
  opacity: 0.98;
}

.mf-paper-sheet.is-writing .mf-pen-actor {
  opacity: 1;
}

/* Realistic Hand/Wrist Palm Shadow resting on the paper */
.mf-hand-shadow {
  position: absolute;
  left: 12px;
  top: 42px;
  width: 140px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 35% 35%, rgba(15, 23, 42, 0.12) 0%, rgba(15, 23, 42, 0.04) 45%, transparent 75%);
  filter: blur(8px);
  pointer-events: none;
  transform-origin: 0% 0%;
  transition: transform 0.2s ease, opacity 0.25s ease;
  opacity: 0.65;
}

.mf-paper-sheet.is-writing .mf-hand-shadow {
  opacity: 0.85;
  transform: translate(2px, 1px) scale(1.02);
}

/* Sharp ground contact shadow directly under the golden nib tip */
.mf-nib-contact-shadow {
  position: absolute;
  left: -2px;
  bottom: -2px;
  width: 10px;
  height: 5px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.5);
  filter: blur(1px);
  pointer-events: none;
  transition: transform 0.12s ease, opacity 0.15s ease;
  transform: translate(0, 0);
}

.mf-paper-sheet.is-writing .mf-nib-contact-shadow {
  transform: scale(0.95);
  opacity: 0.9;
}

/* Main Pen Wrapper */
.mf-pen-motion {
  position: relative;
  width: 54px;
  height: 81px;
  transform-origin: 2px 81px;
  will-change: transform;
}

/* High-res Urushi Fountain Pen Image with realistic directional ambient shadow */
.mf-pen-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(6px 14px 7px rgba(15, 23, 42, 0.28));
  transform-origin: 2px 81px;
  transition: filter 0.15s ease;
}

.mf-paper-sheet.is-writing .mf-pen-img {
  filter: drop-shadow(4px 10px 5px rgba(15, 23, 42, 0.35));
}

/* Royal Blue Wet Ink Droplet at Nib Tip (Gleams only during actual ink laydown) */
.mf-ink-sparkle {
  position: absolute;
  left: 0px;
  bottom: 0px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1e3a8a;
  box-shadow: 0 0 6px rgba(30, 58, 138, 0.9), 0 0 10px rgba(59, 130, 246, 0.5);
  opacity: 0;
  pointer-events: none;
  filter: blur(0.3px);
  transition: opacity 0.15s ease;
}

.mf-paper-sheet.is-writing .mf-ink-sparkle {
  opacity: 0.9;
}

/* Bottom Row: Submit Button */
.mf-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.mf-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--accent-teal);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.mf-submit-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(13, 148, 136, 0.25);
}

.mf-submit-btn:active {
  transform: translateY(0);
}

/* Inline Form Alert */
.mf-alert {
  font-size: 12px;
  font-weight: 550;
  color: #ef4444;
  text-align: center;
  padding: 4px;
}

/* --------------------------------------------------------------------------
   MODERN MINIMAL SUCCESS STATE
   -------------------------------------------------------------------------- */
.mf-success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 12px 14px;
}

.mf-success-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 0 0 6px #f0fdf4;
}

.mf-success-icon svg {
  width: 22px;
  height: 22px;
}

.mf-success-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.mf-success-text {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 0 16px;
  line-height: 1.45;
}

.mf-reset-btn {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s ease;
}

.mf-reset-btn:hover {
  text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 520px) {
  .modern-feedback-card {
    padding: 22px 16px;
    border-radius: 12px;
  }

  .mf-bottom-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .mf-submit-btn {
    width: 100%;
    justify-content: center;
    padding: 10px;
  }
}
