@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;600;700;800&display=swap");

:root {
  --primary-color: #ff477e;
  --primary-gradient: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-color: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg:
    0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  --shadow-glow: 0 10px 25px -5px rgba(255, 71, 126, 0.3);
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-pill: 50px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: var(--bg-color);
  background-image:
    radial-gradient(at 0% 0%, rgba(255, 117, 140, 0.15) 0px, transparent 50%),
    radial-gradient(
      at 100% 100%,
      rgba(255, 126, 179, 0.15) 0px,
      transparent 50%
    );
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Hide unused old background animations and custom background features */
.background-animation,
.overlay,
#imgQrBtn,
#customBgBtn,
#customBgModal {
  display: none !important;
}

/* Card Container */
.glass-panel {
  background: var(--card-bg);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 40px;
  width: 100%;
  max-width: 700px;
  text-align: center;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  color: var(--text-color);
  margin-top: 10px;
  margin-bottom: 35px;
  font-size: clamp(1.8em, 4vw, 2.5em);
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

/* Form Inputs Container */
.input-group {
  margin-bottom: 24px;
  text-align: left;
  position: relative;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-color);
  font-weight: 600;
  font-size: 0.95rem;
}

.input-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: block;
}

input[type="text"],
select {
  width: 100%;
  padding: 14px 18px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-color);
  font-size: 1rem;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
  box-shadow: var(--shadow-sm) inset;
  appearance: none;
}

input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 71, 126, 0.15);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' 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 14px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

/* Template group and buttons */
.template-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.template-btn {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
}

.template-btn:hover {
  background: #e2e8f0;
  color: var(--text-color);
}

.template-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-glow);
}

/* Result Buttons Container */
div[style*="margin-top: 25px"] {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px !important;
}

.download-btn {
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-pill);
  color: white;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  box-shadow: var(--shadow-glow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px -5px rgba(255, 71, 126, 0.4);
}

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

/* Heart & QR Display Area */
.heart-container {
  position: relative;
  width: min(90vw, 400px);
  height: min(90vw, 400px);
  margin: 40px auto;
  display: none;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(var(--shadow-md));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.heart-container:hover {
  transform: scale(1.02);
}

.qr-diamond {
  position: absolute;
  top: 53.7%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 40%;
  height: 40%;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.qr-code {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Caption under QR */
#captionDisplay {
  font-size: 2.2em;
  color: var(--primary-color);
  word-break: break-word;
  margin-top: 25px;
  font-weight: 700;
  text-align: center;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 450px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  animation: modalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-content h2 {
  color: var(--text-color) !important;
  font-family: "Poppins", sans-serif;
  margin-bottom: 15px;
}

.modal-content p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.close-modal-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal-btn:hover {
  background: #e2e8f0;
  color: var(--text-color);
}

.goog-te-banner-frame,
.goog-te-balloon-frame,
.goog-te-menu-value,
.skiptranslate,
#google_translate_element,
.goog-te-gadget-icon,
.VIpgJd-Zvi9ab-OR9Uu-AS1p-wa {
  display: none !important;
  visibility: hidden !important;
}

[class*="pgJd"] {
  display: none !important;
}

#goog-gt-tt,
.goog-te-balloon-frame {
  display: none !important;
}
.goog-text-highlight {
  background: none !important;
  box-shadow: none !important;
}

.title-heart {
  display: inline-block;
  animation: popIn 0.6s ease-out;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .glass-panel {
    padding: 30px 20px;
    border-radius: 16px;
  }

  body {
    padding: 15px;
  }

  h1 {
    font-size: 1.8em;
  }

  .heart-container {
    width: min(90vw, 320px);
    height: min(90vw, 320px);
  }

  .modal-content {
    padding: 30px 20px;
  }

  .title-heart {
    font-size: 1.4em !important;
  }
}

/* View switch floating control (consistent position for quick-switch between views) */
.view-switch {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
}
.view-switch__btn {
  background: rgba(255, 77, 148, 0.95);
  color: #fff;
  padding: 8px 12px;
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  display: inline-block;
}
.view-switch__btn:active {
  transform: translateY(1px);
}
@media (max-width: 480px) {
  .view-switch {
    right: 10px;
    top: 10px;
  }
  .view-switch__btn {
    padding: 7px 10px;
    font-size: 13px;
  }
}
