/* Reset and CSS Variables */
:root {
  --primary-color: hsl(340, 85%, 60%);
  --primary-hover: hsl(340, 90%, 50%);
  --primary-glow: hsla(340, 85%, 60%, 0.4);
  --bg-gradient: linear-gradient(135deg, #18091e 0%, #08030c 100%);
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-color: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --tg-theme-bg-color: #08030c; /* fallback */
}

/* Custom fonts styling override if TG theme colors are used */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Canvas background for animated floating hearts */
#heart-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Main app container */
.app-container {
  width: 100%;
  max-width: 440px;
  padding: 20px;
  z-index: 1;
}

/* Views toggling */
.view {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Premium Glassmorphic Card */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(25px) saturate(160%);
  -webkit-backdrop-filter: blur(25px) saturate(160%);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 30px;
  box-shadow: var(--glass-shadow);
  width: 100%;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(255, 77, 121, 0.25);
  box-shadow: 0 8px 32px 0 rgba(255, 77, 121, 0.1);
}

/* Builder & Form Styles */
.builder-card {
  padding: 35px 25px;
}

.card-header {
  text-align: center;
  margin-bottom: 25px;
}

.icon-circle {
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.08);
  width: 65px;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 0 auto 15px auto;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.card-header h2 {
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  background: linear-gradient(to right, #ffffff, var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.form-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.input-group input[type="text"],
.input-group textarea {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
  width: 100%;
}

.input-group input[type="text"]:focus,
.input-group textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 12px var(--primary-glow);
  background: rgba(0, 0, 0, 0.5);
}

.input-help {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

.accent-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

.accent-link:hover {
  text-decoration: underline;
}

/* Tags / Pills inputs for Custom Places & Times */
.tags-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

.tag-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-color);
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.tag-pill.active {
  background: rgba(255, 77, 121, 0.15);
  border-color: var(--primary-color);
  color: #fff;
}

.tag-remove {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 2px;
  font-weight: bold;
}

.tag-remove:hover {
  color: #ff4d79;
}

.btn-add-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-tag:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: #fff;
}

/* Primary Button Styling */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, #e0285a 100%);
  border: none;
  color: white;
  padding: 16px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 77, 121, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 77, 121, 0.45);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  transition: 0.75s;
  opacity: 0;
}

.btn-primary:hover::after {
  left: 125%;
  opacity: 1;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 14px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Result URL Copy Area */
.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 10px 0;
}

.result-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 10px;
  animation: fadeIn 0.4s ease forwards;
}

.result-container h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.url-copy-box {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 6px;
  align-items: center;
}

.url-copy-box input {
  background: none;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 8px 12px;
  flex: 1;
  outline: none;
  min-width: 0;
}

.btn-copy {
  background: var(--primary-color);
  border: none;
  color: white;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: var(--primary-hover);
}

.share-buttons-container {
  display: flex;
  gap: 10px;
}

.btn-share-tg {
  background: #24A1DE;
  border: none;
  color: white;
  padding: 14px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
}

.btn-share-tg:hover {
  background: #1d82b3;
  transform: translateY(-1px);
}

/* ---------------------------------------------------- */
/* INVITATION CARD SPECIFIC STYLES */
/* ---------------------------------------------------- */
.invitation-card {
  text-align: center;
  padding: 40px 30px;
}

.envelope-container {
  font-size: 3.5rem;
  margin-bottom: 20px;
  animation: pulse 2s infinite;
  display: inline-block;
}

.invitation-header .subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 12px;
}

.cursive-name {
  font-family: 'Great Vibes', cursive;
  font-size: 3.8rem;
  font-weight: 400;
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 77, 121, 0.4);
  margin-bottom: 8px;
}

.heart-divider {
  font-size: 1.2rem;
  margin-bottom: 25px;
  color: var(--primary-color);
  animation: heartbeat 1.5s infinite;
}

.quote-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px 20px;
  margin-bottom: 30px;
}

.quote-box p {
  font-style: italic;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.question-text {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 25px;
  line-height: 1.4;
  color: #fff;
}

.actions-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 15px;
  position: relative;
  min-height: 60px; /* space for button jumps */
}

/* Custom interactive action buttons */
.btn-action {
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  outline: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.yes-btn {
  background: linear-gradient(135deg, var(--primary-color) 0%, #d82354 100%);
  color: white;
  padding: 14px 28px;
  box-shadow: 0 4px 15px rgba(255, 77, 121, 0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.yes-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(255, 77, 121, 0.45);
}

/* Flying button wrapper */
.no-btn-wrapper {
  display: inline-block;
}

.no-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  padding: 14px 28px;
  transition: all 0.2s ease;
  position: relative;
  z-index: 100;
}

/* Class added when running away */
.no-btn.escaped {
  position: absolute; /* so it can escape anywhere inside the relative card */
  z-index: 1000;
  background: #15081b; /* Opaque solid dark background matching theme */
  border: 2px solid var(--primary-color); /* Glowing rose border */
  box-shadow: 0 8px 30px rgba(255, 77, 121, 0.35); /* Glow shadow */
  color: #fff;
  transition: top 0.25s cubic-bezier(0.25, 1, 0.5, 1), left 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.invitation-footer {
  margin-top: 30px;
}

.signature {
  font-family: 'Great Vibes', cursive;
  font-size: 2.2rem;
  color: var(--text-secondary);
}

/* Floating bottom builder backlink button */
.backlink-pill {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin: 25px auto 0 auto;
  display: block;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.backlink-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: translateY(-1px);
}

/* ---------------------------------------------------- */
/* COORDINATION SCREEN STYLES */
/* ---------------------------------------------------- */
.coordination-card {
  padding: 35px 25px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 15px;
}

/* Make grid layout flexible for 3 items (Kafe, Resto, Kino) */
.options-grid :only-child {
  grid-column: span 2;
}

.options-grid :nth-child(3):last-child {
  grid-column: span 2;
}

.option-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 16px;
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.option-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-2px);
}

.option-btn.selected {
  background: linear-gradient(135deg, rgba(255, 77, 121, 0.2) 0%, rgba(255, 77, 121, 0.35) 100%);
  border-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 77, 121, 0.2);
  transform: translateY(0);
}

.coordination-footer {
  margin-top: 35px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------------------------------------------------- */
/* SUCCESS CARD STYLES */
/* ---------------------------------------------------- */
.success-card {
  text-align: center;
  padding: 45px 30px;
}

.success-icon-circle {
  font-size: 3rem;
  background: rgba(77, 255, 166, 0.1);
  border: 1px solid rgba(77, 255, 166, 0.3);
  color: #4dffa6;
  width: 85px;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 0 auto 20px auto;
  box-shadow: 0 4px 20px rgba(77, 255, 166, 0.15);
}

.success-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 25px;
}

.summary-details {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.summary-item .label {
  color: var(--text-secondary);
  font-weight: 500;
}

.summary-item .value {
  color: #fff;
  font-weight: 700;
}

/* ---------------------------------------------------- */
/* STATUS TIMELINE & DASHBOARD STYLES */
/* ---------------------------------------------------- */
.status-timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  margin-top: 25px;
  text-align: left;
}

.status-timeline::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 20px;
  width: 2px;
  height: calc(100% - 20px);
  background: rgba(255, 255, 255, 0.1);
  z-index: 0;
}

.timeline-item {
  display: flex;
  gap: 15px;
  position: relative;
  z-index: 1;
}

.timeline-icon {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.timeline-content {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 14px 18px;
  flex-grow: 1;
}

.timeline-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.timeline-content p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

.timeline-item.active .timeline-icon {
  background: rgba(255, 77, 121, 0.15);
  border-color: var(--primary-color);
  box-shadow: 0 0 15px var(--primary-glow);
  transform: scale(1.1);
}

.timeline-item.active .timeline-content {
  border-color: rgba(255, 77, 121, 0.25);
  background: rgba(255, 77, 121, 0.04);
}

.timeline-item.active .timeline-content h4 {
  color: #fff;
}

.accent-text {
  color: var(--primary-color);
  font-weight: 700;
}

/* ---------------------------------------------------- */
/* MODAL DIALOG STYLES */
/* ---------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-backdrop.hidden {
  display: none;
  opacity: 0;
}

.modal-card {
  width: 90%;
  max-width: 360px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: scaleUp 0.3s ease forwards;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 25px;
}

/* Keyframe animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); text-shadow: 0 0 20px rgba(255, 77, 121, 0.6); }
  100% { transform: scale(1); }
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  20% { transform: scale(1.2); }
  40% { transform: scale(1); }
  60% { transform: scale(1.2); }
  80% { transform: scale(1); }
  100% { transform: scale(1); }
}

/* Responsive: Small height screens */
@media (max-height: 600px) {
  .cursive-name {
    font-size: 3rem;
  }
  .envelope-container {
    font-size: 2.8rem;
    margin-bottom: 12px;
  }
  .glass-card {
    padding: 20px;
  }
}

/* Responsive: Very small phones (320px and below) */
@media (max-width: 360px) {
  .app-container {
    padding: 10px;
  }
  .glass-card {
    padding: 18px 14px;
    border-radius: 20px;
  }
  .cursive-name {
    font-size: 2.5rem;
  }
  .card-header h2 {
    font-size: 1.3rem;
  }
  .icon-circle {
    width: 50px;
    height: 50px;
    font-size: 1.6rem;
  }
  .btn-primary, .btn-secondary, .btn-share-tg {
    padding: 12px 16px;
    font-size: 0.85rem;
  }
  .btn-action {
    padding: 14px 28px;
    font-size: 1rem;
  }
  .quote-box {
    padding: 14px;
    font-size: 0.9rem;
  }
  .envelope-container {
    font-size: 2.5rem;
  }
  .options-grid {
    gap: 8px;
  }
  .option-btn {
    padding: 10px 14px;
    font-size: 0.85rem;
  }
}

/* Responsive: Standard phones (361px - 480px) */
@media (min-width: 361px) and (max-width: 480px) {
  .app-container {
    padding: 14px;
  }
  .glass-card {
    padding: 24px 18px;
  }
  .cursive-name {
    font-size: 3.2rem;
  }
}

/* Responsive: Large phones and small tablets (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .app-container {
    max-width: 500px;
    padding: 20px;
  }
  .glass-card {
    padding: 35px 28px;
  }
  .cursive-name {
    font-size: 4rem;
  }
  .btn-action {
    padding: 18px 50px;
    font-size: 1.2rem;
  }
}

/* Responsive: Landscape orientation on phones */
@media (max-height: 450px) and (orientation: landscape) {
  body {
    align-items: flex-start;
  }
  .app-container {
    padding: 10px;
    max-width: 90%;
  }
  .glass-card {
    padding: 16px;
    border-radius: 18px;
  }
  .cursive-name {
    font-size: 2.2rem;
  }
  .envelope-container {
    font-size: 2rem;
    margin-bottom: 8px;
  }
  .card-header {
    margin-bottom: 12px;
  }
  .invitation-header {
    margin-bottom: 10px;
  }
  .quote-box {
    padding: 10px;
    margin: 10px 0;
  }
  .actions-container {
    margin-top: 12px;
  }
}

/* Global utility classes */
.hidden {
  display: none !important;
}
