/* =======================================================
   LOVE CALCULATOR STYLE
   ======================================================= */

:root {
  --love-pink: #ff4d6d;
  --love-red: #d90429;
  --love-light: #fff0f3;
  --love-gradient: linear-gradient(135deg, #ff4d6d 0%, #ff758f 40%, #8b5cf6 100%);
  --love-shadow-glow: 0 0 30px rgba(255, 77, 109, 0.35);
}

[data-theme="dark"] {
  --love-light: #250914;
  --love-shadow-glow: 0 0 40px rgba(255, 77, 109, 0.25);
}

/* Main Layout Container */
.love-calc-main {
  min-height: 85vh;
  display: flex;
  flex-direction: column;
}



/* Back Link styling */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 20px;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--purple-500);
}

.back-icon {
  background-color: currentColor;
}

.gradient-text-love {
  background: var(--love-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Heartbeat Animation */
@keyframes heartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.12); }
  28% { transform: scale(1); }
  42% { transform: scale(1.12); }
  70% { transform: scale(1); }
}

.pulse-heart {
  animation: heartbeat 1.4s infinite ease-in-out;
  display: inline-block;
}

/* Glass Card */
.love-calculator-card {
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.love-calculator-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,77,109,0.06) 0%, transparent 60%);
  pointer-events: none;
}

@media (max-width: 480px) {
.love-calculator-card {
    padding: 24px 16px;
  }
}

/* Calculator Inputs Layout */
.calculator-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.inputs-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

@media (max-width: 768px) {
.inputs-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .heart-divider-wrapper {
    margin: 10px 0;
  }
}

/* Input Fields styling */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  position: relative;
}

.input-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-field-wrapper input {
  width: 100%;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
}

.input-field-wrapper input:focus {
  border-color: var(--love-pink);
  box-shadow: 0 0 0 4px rgba(255, 77, 109, 0.12);
  background: var(--bg-secondary);
}

.input-field-wrapper input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

/* Heart Divider */
.heart-divider-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.heart-badge {
  background: var(--love-gradient);
  color: white;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--love-shadow-glow);
  z-index: 2;
  border: 4px solid #ffffff;
}

.heart-badge .icon-heart {
  width: 24px;
  height: 24px;
  background-color: white;
}

/* Select Box custom style */
.select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.custom-select {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  background-size: 16px;
  transition: all var(--transition-fast);
}

[data-theme="dark"] .custom-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.custom-select:focus {
  border-color: var(--love-pink);
  box-shadow: 0 0 0 4px rgba(255, 77, 109, 0.12);
}

/* Calculate Button */
.btn-calculate {
  background: var(--love-gradient);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 16px 32px;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(255, 77, 109, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.btn-calculate:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 4px 12px rgba(255, 77, 109, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-calculate:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(255, 77, 109, 0.15);
}

/* Loader Animation */
.loading-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 30px 0;
  min-height: 170px;
  box-sizing: border-box;
}

.heart-radar {
  position: relative;
  width: 80px;
  height: 80px;
}

.radar-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px solid var(--love-pink);
  border-radius: 50%;
  animation: radarPulse 1.8s infinite cubic-bezier(0.215, 0.610, 0.355, 1);
  opacity: 0;
}

.radar-ring:nth-child(2) {
  animation-delay: 0.6s;
}

.radar-ring:nth-child(3) {
  animation-delay: 1.2s;
}

.radar-center-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.radar-center-heart .icon-heart {
  width: 36px;
  height: 36px;
  background-color: var(--love-pink);
  animation: heartbeat 0.8s infinite;
}

@keyframes radarPulse {
  0% { transform: scale(0.3); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.loading-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--love-pink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.45;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 480px;
  padding: 0 12px;
  box-sizing: border-box;
  animation: flashText 1.4s infinite alternate;
}

@keyframes flashText {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Results panel */
.results-wrapper {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Circular Compatibility Gauge */
.compatibility-gauge {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gauge-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.gauge-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 12;
}

.gauge-fill {
  fill: none;
  stroke: url(#love-grad);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 502; /* 2 * PI * r = 2 * 3.14159 * 80 = 502.6 */
  stroke-dashoffset: 502;
  transition: stroke-dashoffset 1.8s cubic-bezier(0.1, 0.8, 0.25, 1);
}

.gauge-content {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-percentage {
  font-family: var(--font-heading);
  font-size: 3.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.gauge-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--love-pink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Result Title and Description card */
.result-card {
  width: 100%;
  padding: 24px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.result-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--love-pink);
  margin-bottom: 8px;
}

.result-desc {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ── Triple Special Scores Section (Numerology, Astrology, AI Score) ── */
.triple-scores-section {
  width: 100%;
}

.triple-scores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.triple-score-card {
  background: var(--bg-primary);
  border: 1.5px solid rgba(255, 77, 109, 0.25);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

[data-theme="dark"] .triple-score-card {
  border-color: rgba(255, 77, 109, 0.35);
  background: var(--bg-primary);
}

.triple-score-card:hover {
  transform: translateY(-2px);
  border-color: var(--love-pink);
  box-shadow: var(--shadow-md);
}

.triple-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.triple-card-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.triple-card-label {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.triple-card-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--love-pink);
  line-height: 1;
}

/* ── Love Vibe Cards Grid Section (8 Mini Cards) ── */
.vibe-insights-section {
  width: 100%;
}

.vibe-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.vibe-card {
  background: var(--bg-primary);
  border: 1.5px solid rgba(255, 77, 109, 0.22);
  border-radius: var(--radius-md);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

[data-theme="dark"] .vibe-card {
  border-color: rgba(255, 77, 109, 0.3);
  background: var(--bg-primary);
}

.vibe-card:hover {
  transform: translateY(-2px);
  border-color: var(--love-pink);
  box-shadow: var(--shadow-md);
}

.vibe-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.vibe-card-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.vibe-card-label {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--love-pink);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.vibe-card-value {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  word-break: break-word;
}

/* Detailed Relationship Breakdown Card */
.relationship-breakdown-card {
  width: 100%;
  padding: 24px 28px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-sizing: border-box;
}

.breakdown-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 20px 0;
  text-align: left;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.breakdown-label {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.breakdown-icon {
  color: var(--love-pink);
  background-color: var(--love-pink);
  width: 18px;
  height: 18px;
}

.breakdown-val {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--love-pink);
}

.breakdown-progress-track {
  width: 100%;
  height: 14px;
  background: rgba(255, 77, 109, 0.12);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

[data-theme="dark"] .breakdown-progress-track {
  background: rgba(255, 77, 109, 0.2);
}

.breakdown-progress-fill {
  height: 100%;
  background: var(--love-gradient);
  border-radius: 999px;
  width: 0%;
  transition: width 1.4s cubic-bezier(0.1, 0.8, 0.25, 1);
}

/* Result actions buttons */
.result-actions-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.btn-secondary-calc {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 24px;
  height: 48px;
  box-sizing: border-box;
  min-width: 160px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-secondary-calc:hover {
  border-color: var(--love-pink);
  background: var(--bg-tertiary);
}

.btn-secondary-calc .icon {
  width: 16px;
  height: 16px;
}

.btn-share {
  background: var(--love-gradient);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 8px rgba(255, 77, 109, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.btn-share:hover {
  filter: brightness(1.08);
  background: var(--love-gradient);
  border: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 77, 109, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-share:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(255, 77, 109, 0.15);
}

.hidden-element {
  display: none !important;
}

/* Canvas element for image creation (hidden) */
#canvas-share {
  display: none;
}

/* ── What Your Score Actually Means Section ── */
.score-guide-section {
  margin: 50px 0;
  text-align: left;
}

.score-guide-header {
  margin-bottom: 28px;
  text-align: center;
}

.score-guide-header h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.score-guide-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin: 0;
}

.score-guide-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.score-card {
  padding: 24px 28px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.score-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Left Accent Line */
.score-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
}

.tier-soulmates::before {
  background: linear-gradient(to bottom, #ff4d6d, #ff758f);
}

.tier-compatible::before {
  background: linear-gradient(to bottom, #ff758f, #ffb703);
}

.tier-opposites::before {
  background: linear-gradient(to bottom, #8b5cf6, #c084fc);
}

.tier-growing::before {
  background: linear-gradient(to bottom, #3b82f6, #06b6d4);
}

.score-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.score-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-soulmates {
  background: rgba(255, 77, 109, 0.12);
  color: #ff4d6d;
}

.badge-compatible {
  background: rgba(255, 117, 143, 0.15);
  color: #e63946;
}

.badge-opposites {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.badge-growing {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

[data-theme="dark"] .badge-soulmates {
  background: rgba(255, 77, 109, 0.22);
  color: #ff758f;
}

[data-theme="dark"] .badge-compatible {
  background: rgba(255, 183, 3, 0.18);
  color: #ffb703;
}

[data-theme="dark"] .badge-opposites {
  background: rgba(192, 132, 252, 0.22);
  color: #c084fc;
}

[data-theme="dark"] .badge-growing {
  background: rgba(59, 130, 246, 0.22);
  color: #60a5fa;
}

.score-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.score-card-desc {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

@media (max-width: 480px) {
  .score-card {
    padding: 16px 18px;
  }
  
  .score-card-header {
    gap: 10px;
  }

  .result-card {
    padding: 12px 14px;
    border-radius: 8px;
  }

  .result-title {
    font-size: 1.1rem;
    margin-bottom: 4px;
  }

  .result-desc {
    font-size: 0.85rem;
    line-height: 1.4;
  }
}

/* ── Mobile Layout & Typography Optimizations (Decent Viewport Sizes) ── */
@media (max-width: 768px) {
.love-calculator-card {
    padding: 24px 16px;
    margin-bottom: 24px;
  }

  .calculator-form {
    gap: 20px;
  }

  .input-field-wrapper input {
    padding: 12px 16px;
    font-size: 0.98rem;
  }

  .custom-select {
    padding: 12px 16px;
    font-size: 0.95rem;
    background-position: right 16px center;
  }

  .btn-calculate {
    padding: 14px 28px;
    font-size: 1.05rem;
  }

  .score-guide-header h2 {
    font-size: 1.4rem !important;
    margin-bottom: 16px;
  }

  .score-guide-subtitle {
    font-size: 0.95rem;
  }

  .score-card {
    padding: 16px 20px;
  }

  .score-badge {
    padding: 4px 12px;
    font-size: 0.82rem;
  }

  .score-card-title {
    font-size: 1.1rem;
  }

  .score-card-desc {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .results-wrapper {
    gap: 18px;
    margin-top: 16px;
  }

  .result-card {
    padding: 14px 16px;
    border-radius: 10px;
  }

  .result-title {
    font-size: 1.18rem;
    margin-bottom: 6px;
  }

  .result-desc {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .loading-wrapper {
    min-height: 170px;
    margin: 20px 0;
  }

  .loading-text {
    font-size: 0.88rem;
    line-height: 1.4;
    min-height: 58px;
    padding: 0 8px;
  }

  .triple-scores-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .triple-score-card {
    padding: 12px 6px;
    gap: 6px;
  }

  .triple-card-label {
    font-size: 0.65rem;
    letter-spacing: 0.02em;
  }

  .triple-card-value {
    font-size: 1.35rem;
  }

  .vibe-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .vibe-card {
    padding: 12px 8px;
    gap: 6px;
  }

  .vibe-card-label {
    font-size: 0.68rem;
  }

  .vibe-card-value {
    font-size: 0.98rem;
  }

  .relationship-breakdown-card {
    padding: 16px 14px;
  }

  .breakdown-title {
    font-size: 1.1rem;
    margin-bottom: 14px;
  }

  .breakdown-list {
    gap: 14px;
  }

  .result-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    width: 100%;
  }

  .btn-secondary-calc {
    height: 44px;
    padding: 0 18px;
    font-size: 0.92rem;
    min-width: 140px;
    box-sizing: border-box;
    border-radius: 8px;
  }
}

/* ── Mobile Phone Only Button Layout (<= 540px) ── */
@media (max-width: 540px) {
  .result-actions-row {
    gap: 10px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
  }

  .btn-calc-share {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    box-sizing: border-box;
  }

  .btn-calc-share .btn-copy-text {
    display: none;
  }

  .btn-share {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 10px;
    font-size: 0.88rem;
    white-space: nowrap;
    border-radius: 8px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .btn-calc-reset {
    flex-basis: 100%;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    font-size: 0.92rem;
    border-radius: 8px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
}

