/* ---------------Fonts------------------*/
@font-face {
  font-family: 'FlowerLabel';
  src: url('Font/Flower_label/Sunflower.ttf') format('truetype');
  font-weight:normal;
  font-style: normal;
  font-display:swap;
}

@font-face {
  font-family: 'FlowerMessage';
  src: url('Font/Message/Flower.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/*Base styles*/
*,
*::after,
*::before {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

:root {
  --dark-color: #000;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --card-bg: rgba(255, 255, 255, 0.95);
  --border-radius: 30px;
  --transition-speed: 0.3s;
  --tulip-red: #dc143c;
  --tulip-pink: #ff6b9d;
  --tulip-light: #ff9ed4;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: url('hearts-bg.jpg') center center / cover no-repeat fixed;
  background-color: #e8b4d9; /*incase the bg doesnt load make the bg this color*/
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------------layout styles------------------*/

.app-container {
  height:100vh;
  padding:10px;
  overflow: hidden;
}

.editing-mode {
  display:grid;
  grid-template-columns: 300px 1fr;
  grid-template-rows: 1fr auto;
  gap: 15px;
  max-width: 100%;
  margin: 0 auto;
  padding:10px;
  height: 100%;
  overflow: hidden;
}

.config-panel {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  grid-row: 1;
  grid-column: 1;
}

.config-panel h1 {
  font-size: 1.1rem;
  margin: 0 0 5px 0;
  color: #333;
  text-align: center;
  flex-shrink: 0;
}

.section-label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  color: #555;
  font-size: 2 rem;
}

.preview-panel {
  background: #000;
  border-radius: var(--border-radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  grid-row: 1;
  grid-column: 2;
}

.preview-screen {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* scaling container 4 preview */
.preview-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  max-width: 100%;
  max-height: 100%;
}

/*Shrink flowers and grass in preview*/
.preview-viewport .flowers-preview {
  transform-origin: bottom center;
  transform: translate(-50%, 8%) scale(0.75);
  position: relative;
  z-index: 1; /*flower behind the test*/
}

/* ---------------flower type selector------------------*/


.flower-type-selector {
  flex-shrink: 0;
}

.type-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.type-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  background: white;
}

.type-option:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
  transform: translateX(5px);
}

.type-option input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #667eea;
}

.type-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  object-fit: contain;
  background: white;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.type-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.type-name {
  font-family: 'FlowerLabel', sans-serif;
  font-weight: normal;
  color: #333;
  font-size: 1.2rem;
}

.type-description {
  font-size: 0.7rem;
  color: #888;
}

/* ---------------color picker------------------*/
.color-section {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-input {
  width: 100%;
  height: 38px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color var(--transition-speed);
  padding: 3px;
}

.color-input:hover {
  border-color: #667eea;
}

.color-hex {
  font-size: 0.9rem;
  color: #666;
  font-family: monospace;
  text-align: center;
}

/* ---------------message inprt------------------*/
.message-section {
  flex:1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.message-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.message-textarea {
  width: 100%;
  min-height:60px;
  max-height: 80px;
  flex: 1;
  padding: 10px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: 'FlowerMessage','Pacifico', cursive;
  resize: none;
  transition: border-color var(--transition-speed);
}

.message-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.char-count {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.75rem;
  color: #999;
  background: white;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---------------generate button area------------------*/
.generate-section {
  padding: 12px;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  height: fit-content;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  grid-row: 2;
  grid-column: 1 / -1;
}

.generate-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 2rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.generate-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

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

.link-modal {
  padding: 12px;
  background: #f9f9f9;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
}

.link-header {
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.link-header,
.copy-btn,
.close-modal {
  font-family: 'FlowerLabel', sans-serif;
  font-size: 1rem;
  font-weight: normal;
}

.link-wrapper {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.link-input {
  flex: 1;
  padding: 10px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: monospace;
}

.copy-btn {
  padding: 10px 20px;
  background: #9c27b0;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: #7b1fa2;
}

.close-modal {
  width: 100%;
  padding: 10px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.close-modal:hover {
  background: #e8e8e8;
}

/* ---------------flower animationss------------------*/
.flower {
  position: absolute;
  bottom: 10vmin;
  transform-origin: bottom center;
  z-index: 10;
  animation: moving-flower 4s linear infinite;
}

.flower__leafs {
  position: relative;
  animation: blooming-flower 2s backwards;
}

/*(glow effect for the flowers*/
.flower__leafs::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -100%);
  width: 8vmin;
  height: 8vmin;
  background-color: #6bf0ff;
  filter: blur(10vmin);
}

/*tulip glow(*/
.flower__leafs--tulip::after {
  width: 10vmin;
  height: 10vmin;
  background-color: rgba(255, 255, 255, 0.9);
  filter: blur(8vmin);
  mix-blend-mode: screen;
}

.flower__leaf {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 8vmin;
  height: 11vmin;
  border-radius: 51% 49% 47% 53%/44% 45% 55% 69%;
  transform-origin: bottom center;
  opacity: 0.9;
  box-shadow: inset 0 0 2vmin rgba(255, 255, 255, 0.5);
}

.flower__leaf--1 {
  transform: translate(-10%, 1%) rotateY(40deg) rotateX(-50deg);
}

.flower__leaf--2 {
  transform: translate(-50%, -4%) rotateX(40deg);
}

.flower__leaf--3 {
  transform: translate(-90%, 0%) rotateY(45deg) rotateX(50deg);
}

.flower__leaf--4 {
  width: 8vmin;
  height: 8vmin;
  transform-origin: bottom left;
  border-radius: 4vmin 10vmin 4vmin 4vmin;
  transform: translate(0%, 18%) rotateX(70deg) rotate(-43deg);
  z-index: 1;
  opacity: 0.8;
}

/*Flower type specific delays*/
.flower__leafs--rose {
  animation-delay: 1.1s;
}

.flower__leafs--tulip {
  animation-delay: 1.4s;
}

.flower__leafs--lily {
  animation-delay: 1.7s;
}


/*White circle center*/
.flower__white-circle {
  position: absolute;
  left: -3.5vmin;
  top: -3vmin;
  width: 9vmin;
  height: 4vmin;
  border-radius: 50%;
  background-color: #fff;
}

.flower__white-circle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 60%;
  border-radius: inherit;
  background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.03) 0px, rgba(0, 0, 0, 0.03) 1px, transparent 1px, transparent 12px),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.03) 0px, rgba(0, 0, 0, 0.03) 1px, transparent 1px, transparent 12px),
    linear-gradient(90deg, rgb(127, 47, 21), rgb(255, 206, 0));
}

/*pollen light particles floating up from flower*/
.flower__light {
  position: absolute;
  bottom: 0vmin;
  width: 1vmin;
  height: 1vmin;
  background-color: rgb(255, 251, 0);
  border-radius: 50%;
  filter: blur(0.2vmin);
  animation: light-ans 4s linear infinite backwards;
}

.flower__light:nth-child(odd) {
  background-color: #f76baf;
}

.flower__light--1 {
  left: -2vmin;
  animation-delay: 1s;
}

.flower__light--2 {
  left: 3vmin;
  animation-delay: 0.5s;
}

.flower__light--3 {
  left: -6vmin;
  animation-delay: 0.3s;
}

.flower__light--4 {
  left: 6vmin;
  animation-delay: 0.9s;
}

.flower__light--5 {
  left: -1vmin;
  animation-delay: 1.5s;
}

.flower__light--6 {
  left: -4vmin;
  animation-delay: 3s;
}

.flower__light--7 {
  left: 3vmin;
  animation-delay: 2s;
}

.flower__light--8 {
  left: -6vmin;
  animation-delay: 3.5s;
}

/* ---------------ROSE flower designn------------------*/
.rose__petal {
  position: absolute;
  bottom: 0;
  left: 50%;
  border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  background-image: linear-gradient(to top, #c2185b, #e91e63, #ff6b9d);
  transform-origin: bottom center;
  opacity: 0.95;
  box-shadow: inset 0 0 2vmin rgba(255, 255, 255, 0.3),
              inset 0 0 0.5vmin rgba(0, 0, 0, 0.4),
              0 0 0.3vmin rgba(0, 0, 0, 0.3);
}

/*Outer ring (largest petals) :p*/
.rose__petal--1 {
  width: 9vmin;
  height: 12vmin;
  transform: translate(-50%, -2%) rotateX(45deg);
  z-index: 1;
}

.rose__petal--2 {
  width: 9vmin;
  height: 12vmin;
  transform: translate(-50%, -2%) rotateY(72deg) rotateX(45deg);
  z-index: 1;
}

.rose__petal--3 {
  width: 9vmin;
  height: 12vmin;
  transform: translate(-50%, -2%) rotateY(144deg) rotateX(45deg);
  z-index: 1;
}

.rose__petal--4 {
  width: 9vmin;
  height: 12vmin;
  transform: translate(-50%, -2%) rotateY(216deg) rotateX(45deg);
  z-index: 1;
}

.rose__petal--5 {
  width: 9vmin;
  height: 12vmin;
  transform: translate(-50%, -2%) rotateY(288deg) rotateX(45deg);
  z-index: 1;
}

/* Middle ring (medium petals)*/
.rose__petal--6 {
  width: 7.5vmin;
  height: 10vmin;
  transform: translate(-50%, 0%) rotateY(36deg) rotateX(35deg);
  background-image: linear-gradient(to top, #ad1457, #e91e63, #ff6b9d);
  z-index: 2;
}

.rose__petal--7 {
  width: 7.5vmin;
  height: 10vmin;
  transform: translate(-50%, 0%) rotateY(108deg) rotateX(35deg);
  background-image: linear-gradient(to top, #ad1457, #e91e63, #ff6b9d);
  z-index: 2;
}

.rose__petal--8 {
  width: 7.5vmin;
  height: 10vmin;
  transform: translate(-50%, 0%) rotateY(180deg) rotateX(35deg);
  background-image: linear-gradient(to top, #ad1457, #e91e63, #ff6b9d);
  z-index: 2;
}

.rose__petal--9 {
  width: 7.5vmin;
  height: 10vmin;
  transform: translate(-50%, 0%) rotateY(252deg) rotateX(35deg);
  background-image: linear-gradient(to top, #ad1457, #e91e63, #ff6b9d);
  z-index: 2;
}

.rose__petal--10 {
  width: 7.5vmin;
  height: 10vmin;
  transform: translate(-50%, 0%) rotateY(324deg) rotateX(35deg);
  background-image: linear-gradient(to top, #ad1457, #e91e63, #ff6b9d);
  z-index: 2;
}

/*Inner ring (smaller petals) */
.rose__petal--11 {
  width: 6vmin;
  height: 8vmin;
  transform: translate(-50%, 2%) rotateY(0deg) rotateX(25deg);
  background-image: linear-gradient(to top, #880e4f, #c2185b, #e91e63);
  z-index: 3;
}

.rose__petal--12 {
  width: 6vmin;
  height: 8vmin;
  transform: translate(-50%, 2%) rotateY(90deg) rotateX(25deg);
  background-image: linear-gradient(to top, #880e4f, #c2185b, #e91e63);
  z-index: 3;
}

.rose__petal--13 {
  width: 6vmin;
  height: 8vmin;
  transform: translate(-50%, 2%) rotateY(180deg) rotateX(25deg);
  background-image: linear-gradient(to top, #880e4f, #c2185b, #e91e63);
  z-index: 3;
}

.rose__petal--14 {
  width: 6vmin;
  height: 8vmin;
  transform: translate(-50%, 2%) rotateY(270deg) rotateX(25deg);
  background-image: linear-gradient(to top, #880e4f, #c2185b, #e91e63);
  z-index: 3;
}

/*Center petals (tightly curled)*/
.rose__petal--15 {
  width: 4.5vmin;
  height: 6vmin;
  transform: translate(-50%, 3%) rotateY(45deg) rotateX(15deg);
  background-image: linear-gradient(to top, #4a0e2e, #880e4f, #c2185b);
  z-index: 4;
  border-radius: 50% 50% 48% 48% / 65% 65% 35% 35%;
}

.rose__petal--16 {
  width: 4.5vmin;
  height: 6vmin;
  transform: translate(-50%, 3%) rotateY(135deg) rotateX(15deg);
  background-image: linear-gradient(to top, #4a0e2e, #880e4f, #c2185b);
  z-index: 4;
  border-radius: 50% 50% 48% 48% / 65% 65% 35% 35%;
}

.rose__petal--17 {
  width: 4.5vmin;
  height: 6vmin;
  transform: translate(-50%, 3%) rotateY(225deg) rotateX(15deg);
  background-image: linear-gradient(to top, #4a0e2e, #880e4f, #c2185b);
  z-index: 4;
  border-radius: 50% 50% 48% 48% / 65% 65% 35% 35%;
}

.rose__petal--18 {
  width: 4.5vmin;
  height: 6vmin;
  transform: translate(-50%, 3%) rotateY(315deg) rotateX(15deg);
  background-image: linear-gradient(to top, #4a0e2e, #880e4f, #c2185b);
  z-index: 4;
  border-radius: 50% 50% 48% 48% / 65% 65% 35% 35%;
}

/* making it Very center*/
.rose__center {
  position: absolute;
  left: -1.5vmin;
  top: -1.5vmin;
  width: 3vmin;
  height: 3vmin;
  border-radius: 50%;
  background-image: radial-gradient(circle, #6d1b3e, #4a0e2e);
  z-index: 5;
}

.rose__light {
  position: absolute;
  bottom: 0vmin;
  width: 1vmin;
  height: 1vmin;
  border-radius: 50%;
  filter: blur(0.2vmin);
  animation: light-ans 4s linear infinite backwards;
}

.rose__light--1 {
  left: -2vmin;
  animation-delay: 1s;
}

.rose__light--2 {
  left: 3vmin;
  animation-delay: 0.5s;
}
.rose__light--3 {
  left: -6vmin;
  animation-delay: 0.3s;
}

.rose__light--4 {
  left: 6vmin;
  animation-delay: 0.9s;
}

.rose__light--5 {
  left: -1vmin;
  animation-delay: 1.5s;
}

.rose__light--6 {
  left: -4vmin;
  animation-delay: 3s;
}
.rose__light--7 {
  left: 3vmin;
  animation-delay: 2s;
}
.rose__light--8 {
  left: -6vmin;
  animation-delay: 3.5s;
}

/* ---------------TULIP flower styles------------------*/
/* Outer petals (sepals)*/
.tulip__petal-outer {
  position: absolute;
  bottom: 50%;
  left: 50%;
  width: 60px;
  height: 120px;
  background:linear-gradient(to top, var(--tulip-red), var(--tulip-pink));
  border-radius: 45% 45% 50% 50% / 60% 60% 40% 40%;
  transform-origin: bottom center;
  box-shadow: inset -5px 0 15px rgba(0, 0, 0, 0.3),
              inset 5px 0 15px rgba(255, 255, 255, 0.2),
              0 0 20px rgba(255, 105, 180, 0.4);
  animation: blooming-flower 2s backwards;
}

.tulip__petal-outer--1 {
  transform: translate(-50%, 0%) rotateY(0deg) rotateX(-25deg);
  animation-delay: 0.4s;
  z-index: 3;
}

.tulip__petal-outer--2 {
  transform: translate(-50%, 0%) rotateY(120deg) rotateX(-25deg);
  animation-delay: 0.5s;
  z-index: 2;
}

.tulip__petal-outer--3 {
  transform: translate(-50%, 0%) rotateY(240deg) rotateX(-25deg);
  animation-delay: 0.6s;
  z-index: 2;
}

/* Inner petals */
.tulip__petal-inner {
  position: absolute;
  bottom: 50%;
  left: 50%;
  width: 70px;
  height: 130px;
  background: linear-gradient(to top, var(--tulip-red) 20%, var(--tulip-pink) 60%, var(--tulip-light));
  border-radius: 50% 50% 48% 48% / 55% 55% 45% 45%;
  transform-origin: bottom center;
  box-shadow: inset -8px 0 20px rgba(0, 0, 0, 0.25),
              inset 8px 0 20px rgba(255, 255, 255, 0.3),
              0 0 25px rgba(255, 105, 180, 0.5);
  animation: blooming-flower 2s backwards;
}

.tulip__petal-inner--1 {
  transform: translate(-50%, 0%) rotateY(60deg) rotateX(-20deg);
  animation-delay: 0.2s;
  z-index: 4;
}

.tulip__petal-inner--2 {
  transform: translate(-50%, 0%) rotateY(180deg) rotateX(-20deg);
  animation-delay: 0.1s;
  z-index: 1;
}

.tulip__petal-inner--3 {
  transform: translate(-50%, 0%) rotateY(300deg) rotateX(-20deg);
  animation-delay: 0s;
  z-index: 4;
}

/*Center of tulip*/
.tulip__center {
  position: absolute;
  bottom: 40%;
  left: 50%;
  transform: translate(-50%, 0%);
  width: 30px;
  height: 30px;
  background: radial-gradient(circle, #2d1810, #1a0f0a);
  border-radius: 50%;
  z-index: 5;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  animation: blooming-flower 2s 0.7s backwards;
}

/*Stamens (for now it doesnt show up)*/ 
.tulip__stamen {
  position: absolute;
  bottom: 50%;
  left: 50%;
  width: 3px;
  height: 35px;
  background: linear-gradient(to top, #3d2817, #8b7355);
  transform-origin: bottom center;
  animation: blooming-flower 2s backwards;
}

.tulip__stamen--1 {
  transform: translate(-50%, 0%) rotate(-15deg);
  animation-delay: 0.8s;
  z-index: 5;
}

.tulip__stamen--2 {
  transform: translate(-50%, 0%) rotate(-5deg);
  animation-delay: 0.85s;
  z-index: 5;
}

.tulip__stamen--3 {
  transform: translate(-50%, 0%) rotate(5deg);
  animation-delay: 0.9s;
  z-index: 5;
}

.tulip__stamen--4 {
  transform: translate(-50%, 0%) rotate(15deg);
  animation-delay: 0.95s;
  z-index: 5;
}

/*Light particles*/
.tulip__light {
  position: absolute;
  bottom: 45%;
  width: 1vmin;
  height: 1vmin;
  border-radius: 50%;
  filter: blur(0.2vmin);
  animation: light-ans 4s linear infinite backwards;
}

.tulip__light--1 {
  left: 45%;
  animation-delay: 1.0s;
}

.tulip__light--2 {
  left: 55%;
  animation-delay: 1.2s;
}

.tulip__light--3 {
  left: 40%;
  animation-delay: 1.4s;
}

.tulip__light--4 {
  left: 60%;
  animation-delay: 1.6s;
}

.tulip__light--5 {
  left: 50%;
  animation-delay: 1.8s;
}

.tulip__light--6 {
  left: 48%;
  animation-delay: 2.0s;
}

.tulip__light--7 {
  left: 52%;
  animation-delay: 2.2s;
}

.tulip__light--8 {
  left: 46%;
  animation-delay: 2.4s;
}

/* ---------------LILLY style------------------*/
/*Lily tepals*/
.lily__petal {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 7vmin;
  height: 14vmin;
  border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
  background-image: linear-gradient(to top, #fff9c4, #ffffff);
  transform-origin: bottom center;
  opacity: 0.95;
  box-shadow: inset 0 0 2vmin rgba(255, 235, 59, 0.3);
}

/*Add spots/freckles to petals*/
.lily__petal::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 45% 30%, #ffffff 0.3vmin, transparent 0.3vmin),
    radial-gradient(circle at 55% 35%, #ffffff 0.25vmin, transparent 0.25vmin),
    radial-gradient(circle at 50% 40%, #f5f5f5 0.3vmin, transparent 0.3vmin),
    radial-gradient(circle at 42% 45%, #ffffff 0.2vmin, transparent 0.2vmin),
    radial-gradient(circle at 58% 45%, #ffffff 0.25vmin, transparent 0.25vmin),
    radial-gradient(circle at 50% 50%, #ffffff 0.2vmin, transparent 0.2vmin);
  border-radius: inherit;
}

/*6 tepals arranged in a like star way*/
.lily__petal--1 {
  transform: translate(-50%, -2%) rotateY(0deg) rotateX(25deg);
  z-index: 3;
}

.lily__petal--2 {
  transform: translate(-50%, -2%) rotateY(60deg) rotateX(25deg);
  z-index: 2;
}

.lily__petal--3 {
  transform: translate(-50%, -2%) rotateY(120deg) rotateX(25deg);
  z-index: 1;
}

.lily__petal--4 {
  transform: translate(-50%, -2%) rotateY(180deg) rotateX(25deg);
  z-index: 1;
}

.lily__petal--5 {
  transform: translate(-50%, -2%) rotateY(240deg) rotateX(25deg);
  z-index: 2;
}

.lily__petal--6 {
  transform: translate(-50%, -2%) rotateY(300deg) rotateX(25deg);
  z-index: 3;
}

/* Stamens (6 of them)*/
.lily__stamen {
  position: absolute;
  bottom: 2vmin;
  left: 50%;
  width: 0.4vmin;
  height: 9vmin;
  background: linear-gradient(to top, #c8e6c9, #a5d6a7, #66bb6a);
  transform-origin: bottom center;
  animation: blooming-flower 2s backwards;
  z-index: 5;
}

/*Anther at top of stamen*/
.lily__stamen::after {
  content: "";
  position: absolute;
  top: -1.2vmin;
  left: 50%;
  transform: translateX(-50%);
  width: 1vmin;
  height: 2.5vmin;
  background: linear-gradient(to top, #ff6f00, #ffa726);
  border-radius: 0.2vmin;
  box-shadow: 0 0 0.5vmin #ff6f00;
}

.lily__stamen--1 {
  transform: translate(-50%, 0%) rotate(-15deg);
  animation-delay: 1.8s;
}

.lily__stamen--2 {
  transform: translate(-50%, 0%) rotate(-8deg);
  animation-delay: 1.9s;
}

.lily__stamen--3 {
  transform: translate(-50%, 0%) rotate(-2deg);
  animation-delay: 2.0s;
}

.lily__stamen--4 {
  transform: translate(-50%, 0%) rotate(2deg);
  animation-delay: 2.1s;
}

.lily__stamen--5 {
  transform: translate(-50%, 0%) rotate(8deg);
  animation-delay: 2.2s;
}

.lily__stamen--6 {
  transform: translate(-50%, 0%) rotate(15deg);
  animation-delay: 2.3s;
}

/*Central pistil with 3 lobed stigma*/
.lily__pistil {
  position: absolute;
  bottom: 2vmin;
  left: 50%;
  transform: translateX(-50%);
  width: 0.5vmin;
  height: 11vmin;
  background: linear-gradient(to top, #c8e6c9, #81c784);
  animation: blooming-flower 2s 2.4s backwards;
  z-index: 6;
}

/*3-lobed stigma at top*/
.lily__pistil::after {
  content: "";
  position: absolute;
  top: -1.5vmin;
  left: 50%;
  transform: translateX(-50%);
  width: 0.5vmin;
  height: 1.5vmin;
  background: #2e7d32;
  border-radius: 50%;
  box-shadow:
    -0.6vmin -0.2vmin 0 0.1vmin #2e7d32,
    0.6vmin -0.2vmin 0 0.1vmin #2e7d32;
}

.lily__light {
  position: absolute;
  bottom: 0vmin;
  width: 1vmin;
  height: 1vmin;
  border-radius: 50%;
  filter: blur(0.2vmin);
  animation: light-ans 4s linear infinite backwards;
}

.lily__light--1 {
  left: -2vmin;
  animation-delay: 1s;
}

.lily__light--2 {
  left: 3vmin;
  animation-delay: 0.5s;
}

.lily__light--3 {
  left: -6vmin;
  animation-delay: 0.3s;
}

.lily__light--4 {
  left: 6vmin;
  animation-delay: 0.9s;
}

.lily__light--5 {
  left: -1vmin;
  animation-delay: 1.5s;
}

.lily__light--6 {
  left: -4vmin;
  animation-delay: 3s;
}

.lily__light--7 {
  left: 3vmin;
  animation-delay: 2s;
}

.lily__light--8 {
  left: -6vmin;
  animation-delay: 3.5s;
}

/* ---------------flower STEM------------------*/
.flower__line {
  width: 1.5vmin;
  background-image:
    linear-gradient(to left, rgba(0, 0, 0, 0.2), transparent, rgba(255, 255, 255, 0.2)),
    linear-gradient(to top, transparent 10%, #583e08, #944415);
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.5);
  animation: grow-flower-tree 4s backwards;
  position: relative;
}

/*Stem leaves*/
.flower__line__leaf {
  --w: 7vmin;
  --h: calc(var(--w) + 2vmin);
  position: absolute;
  top: 20%;
  left: 90%;
  width: var(--w);
  height: var(--h);
  border-top-right-radius: var(--h);
  border-bottom-left-radius: var(--h);
  background-image: linear-gradient(to top, rgba(20, 117, 122, 0.4), #095721);
}

.flower__line__leaf--1 {
  transform: rotate(70deg) rotateY(30deg);
  animation: blooming-leaf-right 0.3s 1.6s backwards;
}

.flower__line__leaf--2 {
  top: 45%;
  transform: rotate(70deg) rotateY(30deg);
  animation: blooming-leaf-right 0.3s 1.4s backwards;
}

.flower__line__leaf--3,
.flower__line__leaf--4,
.flower__line__leaf--6 {
  border-top-right-radius: 0;
  border-bottom-left-radius: 0;
  border-top-left-radius: var(--h);
  border-bottom-right-radius: var(--h);
  left: -460%;
  top: 12%;
  transform: rotate(-70deg) rotateY(30deg);
  animation: blooming-leaf-left 0.3s 1.2s backwards;
}

.flower__line__leaf--4 {
  top: 40%;
  animation: blooming-leaf-left 0.3s 1s backwards;
}

.flower__line__leaf--5 {
  top: 0;
  transform-origin: left;
  transform: rotate(70deg) rotateY(30deg) scale(0.6);
  animation: blooming-leaf-right 0.3s 1.8s backwards;
}

.flower__line__leaf--6 {
  top: -2%;
  left: -450%;
  transform-origin: right;
  transform: rotate(-70deg) rotateY(30deg) scale(0.6);
  animation: blooming-leaf-left 0.3s 2s backwards;
}

/* ---------------grass------------------*/
.flower__grass {
  --c: #04661f;
  --line-w: 1.5vmin;
  position: absolute;
  bottom: 12vmin;
  left: -7vmin;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 20;
  transform-origin: bottom center;
  transform: rotate(-48deg) rotateY(40deg);
}

.flower__grass--1 {
  animation: moving-grass 2s linear infinite;
}

.flower__grass--2 {
  left: 2vmin;
  bottom: 10vmin;
  transform: scale(0.5) rotate(75deg) rotateX(10deg) rotateY(-200deg);
  opacity: 0.8;
  z-index: 0;
  animation: moving-grass--2 1.5s linear infinite;
}

.flower__grass--top {
  width: 7vmin;
  height: 10vmin;
  border-top-right-radius: 100%;
  border-right: var(--line-w) solid var(--c);
  transform-origin: bottom center;
  transform: rotate(-2deg);
}

.flower__grass--bottom {
  margin-top: -2px;
  width: var(--line-w);
  height: 25vmin;
  background-image: linear-gradient(to top, transparent, var(--c));
}

.flower__grass__leaf {
  --size: 10vmin;
  position: absolute;
  width: calc(var(--size) * 2.1);
  height: var(--size);
  border-top-left-radius: var(--size);
  border-top-right-radius: var(--size);
  background-image: linear-gradient(to top, transparent, transparent 30%, var(--c));
  z-index: 100;
}

.flower__grass__leaf--1 {
  top: -6%;
  left: 30%;
  --size: 6vmin;
  transform: rotate(-20deg);
  animation: growing-grass-ans--1 2s 2.6s backwards;
}

@keyframes growing-grass-ans--1 {
  0% {
    transform-origin: bottom left;
    transform: rotate(-20deg) scale(0);
  }
}

.flower__grass__leaf--2 {
  top: -5%;
  left: -110%;
  --size: 6vmin;
  transform: rotate(10deg);
  animation: growing-grass-ans--2 2s 2.4s linear backwards;
}

@keyframes growing-grass-ans--2 {
  0% {
    transform-origin: bottom right;
    transform: rotate(10deg) scale(0);
  }
}

.flower__grass__leaf--3 {
  top: 5%;
  left: 60%;
  --size: 8vmin;
  transform: rotate(-18deg) rotateX(-20deg);
  animation: growing-grass-ans--3 2s 2.2s linear backwards;
}

@keyframes growing-grass-ans--3 {
  0% {
    transform-origin: bottom left;
    transform: rotate(-18deg) rotateX(-20deg) scale(0);
  }
}

.flower__grass__leaf--4 {
  top: 6%;
  left: -135%;
  --size: 8vmin;
  transform: rotate(2deg);
  animation: growing-grass-ans--4 2s 2s linear backwards;
}

@keyframes growing-grass-ans--4 {
  0% {
    transform-origin: bottom right;
    transform: rotate(2deg) scale(0);
  }
}

.flower__grass__leaf--5 {
  top: 20%;
  left: 60%;
  --size: 10vmin;
  transform: rotate(-24deg) rotateX(-20deg);
  animation: growing-grass-ans--5 2s 1.8s linear backwards;
}

@keyframes growing-grass-ans--5 {
  0% {
    transform-origin: bottom left;
    transform: rotate(-24deg) rotateX(-20deg) scale(0);
  }
}

.flower__grass__leaf--6 {
  top: 22%;
  left: -180%;
  --size: 10vmin;
  transform: rotate(10deg);
  animation: growing-grass-ans--6 2s 1.6s linear backwards;
}

@keyframes growing-grass-ans--6 {
  0% {
    transform-origin: bottom right;
    transform: rotate(10deg) scale(0);
  }
}

.flower__grass__leaf--7 {
  top: 39%;
  left: 70%;
  --size: 10vmin;
  transform: rotate(-10deg);
  animation: growing-grass-ans--7 2s 1.4s linear backwards;
}

@keyframes growing-grass-ans--7 {
  0% {
    transform-origin: bottom left;
    transform: rotate(-10deg) scale(0);
  }
}

.flower__grass__leaf--8 {
  top: 40%;
  left: -215%;
  --size: 11vmin;
  transform: rotate(10deg);
  animation: growing-grass-ans--8 2s 1.2s linear backwards;
}

@keyframes growing-grass-ans--8 {
  0% {
    transform-origin: bottom right;
    transform: rotate(10deg) scale(0);
  }
}

.flower__grass__overlay {
  position: absolute;
  top: -10%;
  right: 0%;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  filter: blur(1.5vmin);
  z-index: 100;
}

.growing-grass {
  animation: growing-grass-ans 1s 2s backwards;
}

@keyframes growing-grass-ans {
  0% {
    transform: scale(0);
  }
}

@keyframes moving-grass {
  0%, 100% {
    transform: rotate(-48deg) rotateY(40deg);
  }
  50% {
    transform: rotate(-50deg) rotateY(40deg);
  }
}

@keyframes moving-grass--2 {
  0%, 100% {
    transform: scale(0.5) rotate(75deg) rotateX(10deg) rotateY(-200deg);
  }
  50% {
    transform: scale(0.5) rotate(79deg) rotateX(10deg) rotateY(-200deg);
  }
}

/*grass blades*/
.grass {
  position: absolute;
  bottom: 0;
  width: 2vmin;
  height: 35vmin;
  background: linear-gradient(to top, transparent, #04661f);
  border-radius: 50% 50% 0 0;
  transform-origin: bottom center;
  animation: grass-sway 2s ease-in-out infinite;
  z-index: 5;
}

/* ---------------seed styles------------------*/
.seeds-container {
  position: absolute;
  bottom: 8%;
  left: 0;
  right: 0;
  width: 100%;
  height: 20%;
  z-index: 1000;
  pointer-events: none;
}

.seeds-container > * {
  pointer-events: auto;
}

.seed {
  position: absolute;
  width: 15px;
  height: 15px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: seedPulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.seed:hover {
  transform: scale(1.3);
  box-shadow: 0 0 20px rgba(255, 215, 0, 1);
}

/* ---------------typewriter text------------------*/

.typewriter-text {
  font-family: 'FlowerMessage';
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200; /*ensure the message text stays above preview visuals*/
  text-align: center;
  width: 90%;
  word-wrap: break-word;
  pointer-events: none;
}

.cursor {
  animation: blink 1s infinite;
  margin-left: 2px;
}

/* ---------------keyframe animartions------------------*/
@keyframes grow-flower-tree {
  0% {
    height: 0;
    border-radius: 1vmin;
  }
}

@keyframes blooming-flower {
  0% {
    transform: scale(0);
  }
}

@keyframes moving-flower {
  0%, 100% {
    transform: rotate(2deg);
  }
  50% {
    transform: rotate(-2deg);
  }
}

@keyframes grass-sway {
  0%, 100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
}

@keyframes seedPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
  }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes blooming-leaf-right {
  0% {
    transform-origin: left;
    transform: rotate(70deg) rotateY(30deg) scale(0);
  }
}

@keyframes blooming-leaf-left {
  0% {
    transform-origin: right;
    transform: rotate(-70deg) rotateY(30deg) scale(0);
  }
}

@keyframes light-ans {
  0% {
    opacity: 0;
    transform: translateY(0vmin);
  }
  25% {
    opacity: 1;
    transform: translateY(-5vmin) translateX(-2vmin);
  }
  50% {
    opacity: 1;
    transform: translateY(-15vmin) translateX(2vmin);
    filter: blur(0.2vmin);
  }
  75% {
    transform: translateY(-20vmin) translateX(-2vmin);
    filter: blur(0.2vmin);
  }
  100% {
    transform: translateY(-30vmin);
    opacity: 0;
    filter: blur(1vmin);
  }
}

@keyframes light-float {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  25% {
    opacity: 1;
    transform: translateY(-30px) translateX(-10px);
  }
  50% {
    opacity: 1;
    transform: translateY(-60px) translateX(10px);
  }
  75% {
    opacity: 0.5;
    transform: translateY(-90px) translateX(-5px);
  }
  100% {
    opacity: 0;
    transform: translateY(-120px);
    filter: blur(3px);
  }
}

/* ---------------shared view------------------*/
.shared-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 9999;
}

.flowers-preview {
  position: relative;
  width: 100%;
  height: 100%;
}

.shared-view .flowers-preview {
  transform-origin: bottom center;
  transform: translate(-50%, 0) scale(1);
  position: absolute; 
  bottom: 0;
  left: 50%;
  width: 100%;
  height: 70%;
  z-index: 1;
}


@media (max-width: 1024px) {
  .editing-mode {
    grid-template-columns: 250px 1fr;
    grid-template-rows: 1fr auto;
  }

  .config-panel {
    padding: 10px;
    gap: 6px;
  }

  .config-panel h1 {
    font-size: 1rem;
  }

  .type-option {
    padding: 6px;
  }

  .type-icon {
    width: 28px;
    height: 28px;
  }
}

/* ---------------mobile tab layout------------------*/
.mobile-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  padding: 0;
}

.mobile-tabs {
  display: flex;
  background: var(--card-bg);
  border-bottom: 2px solid #e0e0e0;
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  font-family: 'FlowerLabel', sans-serif;
  font-size: 1.1rem;
  cursor: pointer;
  color: #666;
  transition: all 0.3s ease;
  position: relative;
}

.tab-btn.active {
  color: #667eea;
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.mobile-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mobile-content .config-panel {
  height: 100%;
  border-radius: 0;
  overflow-y: auto;
}

.mobile-content .preview-panel {
  height: 100%;
  border-radius: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mobile-content .generate-section {
  border-radius: 0;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  body {
    overflow: hidden;
  }

  .app-container {
    padding: 0;
    height: 100vh;
  }

  .config-panel h1 {
    font-size: 0.9rem;
    margin-bottom: 2px;
  }

  .generate-btn {
    padding: 10px;
    font-size: 1.4rem;
  }

  .type-option {
    padding: 5px;
    gap: 5px;
  }

  .type-icon {
    width: 24px;
    height: 24px;
  }

  .type-name {
    font-size: 0.95rem;
  }

  .message-textarea {
    min-height: 40px;
    max-height: 50px;
    font-size: 0.85rem;
    padding: 8px;
  }

  .section-label {
    font-size: 0.85rem;
    margin-bottom: 3px;
  }

  .color-section {
    gap: 5px;
  }

  .color-input {
    height: 30px;
  }

  .color-hex {
    font-size: 0.8rem;
  }

  .char-count {
    font-size: 0.7rem;
    bottom: 5px;
    right: 10px;
  }

  .typewriter-text {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    top: 3%;
  }

  .link-modal {
    padding: 6px 8px;
    gap: 6px;
  }

  .link-header {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .link-wrapper {
    gap: 6px;
  }

  .link-input {
    padding: 6px 8px;
    font-size: 0.8rem;
  }

  .copy-btn,
  .close-modal {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .flower-type-selector,
  .color-section,
  .message-section {
    gap: 4px;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .config-panel {
    gap: 4px;
    padding: 8px;
  }

  .config-panel h1 {
    font-size: 0.95rem;
    margin-bottom: 3px;
  }

  .type-option {
    padding: 5px;
  }

  .type-icon {
    width: 24px;
    height: 24px;
  }

  .message-textarea {
    min-height: 40px;
    max-height: 50px;
  }

  .generate-section {
    max-height: 120px;
  }
}

/*motal code*/
.app-container,
.editing-mode,
.preview-panel,
.preview-screen,
.preview-viewport,
.generate-section {
  overflow: hidden !important;
}

.link-modal {
  max-height: 80vh;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 8px;
  position: relative;
  z-index: 1200;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.link-wrapper {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0; 
  flex: 1 1 0; 
}
.link-input {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 8px;
  margin: 0;
}

.close-modal {
  position: relative;
  order: 2; 
  width: auto; 
  margin: 0 0 0 0; 
  align-self: flex-start;
  padding: 8px 12px;
  margin-left: auto; 
}
