/* Modern CSS Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Vietnamese Typography Optimization */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Support for Vietnamese diacritics */
body, input, textarea, button {
  font-feature-settings: "kern" 1, "liga" 1, "dlig" 1;
  text-rendering: optimizeLegibility;
}

/* Romantic Variables */
:root {
  --primary-color: #ff6b9d;
  --primary-dark: #e91e63;
  --secondary-color: #ff8fab;
  --accent-color: #ffb3d1;
  --success-color: #ff69b4;
  --love-color: #ff1744;
  --bg-color: #fff0f5;
  --card-bg: #ffffff;
  --text-primary: #4a0e2d;
  --text-secondary: #8e4a6b;
  --border-color: #ffb3d1;
  --shadow: 0 8px 25px rgba(255, 105, 180, 0.3);
  --shadow-lg: 0 15px 35px rgba(255, 105, 180, 0.4);
  --border-radius: 20px;
  --border-radius-lg: 25px;
  --spacing-xs: 6px;
  --spacing-sm: 12px;
  --spacing-md: 20px;
  --spacing-lg: 30px;
  --spacing-xl: 40px;
}

/* Dark mode with romantic twist */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #2d1b26;
    --card-bg: #4a1e3a;
    --text-primary: #ffccd5;
    --text-secondary: #ff8fab;
    --border-color: #8e4a6b;
  }
}

/* Animated Hearts Background */
.hearts-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.hearts-background::before,
.hearts-background::after {
  content: '💕';
  position: absolute;
  font-size: 20px;
  animation: floatingHearts 8s infinite linear;
  opacity: 0.3;
}

.hearts-background::before {
  left: 10%;
  animation-delay: 0s;
}

.hearts-background::after {
  content: '💖';
  left: 80%;
  animation-delay: 4s;
}

@keyframes floatingHearts {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* Base Styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  padding: var(--spacing-md);
  position: relative;
}

/* Container */
.container {
  max-width: 650px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 179, 209, 0.3);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 179, 209, 0.1), transparent);
  animation: shimmer 3s infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(30deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(30deg); }
}

/* Header */
.header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  position: relative;
}

.header::before {
  content: '🌹';
  position: absolute;
  top: -10px;
  left: 20%;
  font-size: 30px;
  animation: gentle-float 3s ease-in-out infinite;
}

.header::after {
  content: '🌹';
  position: absolute;
  top: -10px;
  right: 20%;
  font-size: 30px;
  animation: gentle-float 3s ease-in-out infinite reverse;
}

@keyframes gentle-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--love-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-sm);
  text-shadow: 2px 2px 4px rgba(255, 105, 180, 0.3);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  letter-spacing: -0.02em;
}

.header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-style: italic;
  margin-top: var(--spacing-sm);
}

/* Form Elements */
.form-group {
  margin-bottom: var(--spacing-lg);
  position: relative;
}

label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

input, textarea, select {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(255, 179, 209, 0.1);
  line-height: 1.6;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.15), inset 0 2px 4px rgba(255, 179, 209, 0.2);
  transform: translateY(-2px);
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.8;
}

/* Forever Note Special Section */
.forever-note {
  background: linear-gradient(135deg, rgba(255, 179, 209, 0.2), rgba(255, 139, 171, 0.2));
  border: 2px solid var(--accent-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  margin: var(--spacing-lg) 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  position: relative;
  overflow: hidden;
}

.forever-note::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: sparkle 2s infinite;
}

@keyframes sparkle {
  0% { left: -100%; }
  100% { left: 100%; }
}

.forever-icon {
  font-size: 3rem;
  animation: heartbeat 2s infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.forever-text h3 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.forever-text p {
  color: var(--text-secondary);
  font-style: italic;
  margin: 0;
}

/* File input */
.file-input {
  position: relative;
  display: inline-block;
  width: 100%;
}

.file-input input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-input-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  background: rgba(255, 179, 209, 0.1);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.file-input-label:hover {
  border-color: var(--primary-color);
  background: rgba(255, 179, 209, 0.2);
  transform: translateY(-2px);
}

.file-input-label::before {
  content: "💕";
  margin-right: var(--spacing-sm);
  font-size: 1.3em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transition: all 0.6s ease;
  transform: translate(-50%, -50%);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--love-color));
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(255, 105, 180, 0.4);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.btn-full {
  width: 100%;
}

.btn-large {
  padding: 20px 40px;
  font-size: 1.2rem;
}

/* Output */
.output {
  background: linear-gradient(135deg, rgba(255, 179, 209, 0.15), rgba(255, 139, 171, 0.15));
  border: 2px solid var(--success-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  margin-top: var(--spacing-lg);
  word-break: break-word;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  position: relative;
}

.output::before {
  content: '💖';
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.output.error {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.15), rgba(233, 30, 99, 0.15));
  border-color: var(--love-color);
}

.output.error::before {
  content: '💔';
}

.output.empty {
  display: none;
}

/* Markdown formatting in output */
.output h1, .output h2, .output h3 {
  font-weight: 600;
  margin-top: 1.2em;
  margin-bottom: 0.6em;
  color: var(--primary-color);
}

.output h1 { font-size: 1.6em; }
.output h2 { font-size: 1.4em; }
.output h3 { font-size: 1.2em; }

.output p {
  margin-bottom: 1em;
}

.output ul, .output ol {
  margin: 0.8em 0 0.8em 2em;
}

.output li {
  margin-bottom: 0.4em;
}

.output code {
  background: rgba(255, 179, 209, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9em;
}

.output a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 2px solid rgba(255, 107, 157, 0.3);
  transition: all 0.3s ease;
}

.output a:hover {
  color: var(--love-color);
  border-bottom-color: var(--love-color);
}

/* Alert boxes */
.alert {
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-md);
  font-size: 0.95rem;
  position: relative;
}

.alert-info {
  background: linear-gradient(135deg, rgba(255, 179, 209, 0.2), rgba(255, 139, 171, 0.2));
  border: 2px solid rgba(255, 107, 157, 0.4);
  color: var(--primary-dark);
}

.alert-love {
  background: linear-gradient(135deg, rgba(255, 23, 68, 0.1), rgba(255, 107, 157, 0.1));
  border: 2px solid rgba(255, 23, 68, 0.3);
  color: var(--love-color);
}

.alert::before {
  content: '✨';
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.2rem;
}

.alert-love::before {
  content: '💕';
}

/* Loading state */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  margin: auto;
  border: 3px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  body {
    padding: var(--spacing-sm);
  }
  
  .container {
    padding: var(--spacing-md);
  }
  
  .card {
    padding: var(--spacing-lg);
  }
  
  .header h1 {
    font-size: 2rem;
  }
  
  .forever-note {
    flex-direction: column;
    text-align: center;
  }
  
  .btn {
    padding: 14px 24px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.8rem;
  }
  
  .btn {
    padding: 12px 20px;
    font-size: 1rem;
  }
}

/* Output Success Styles */
.output-success-header {
  text-align: center; 
  margin-bottom: 20px;
  font-weight: 600;
  color: var(--primary-color);
}

.output-url-container {
  background: rgba(255, 179, 209, 0.15); 
  padding: 16px; 
  border-radius: var(--border-radius); 
  margin: 16px 0;
  border: 1px solid var(--border-color);
}

.output-url-label {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.output-url-link {
  color: var(--primary-color); 
  word-break: break-all; 
  font-size: 1.1em; 
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid rgba(255, 107, 157, 0.3);
  transition: all 0.3s ease;
}

.output-url-link:hover {
  color: var(--love-color);
  border-bottom-color: var(--love-color);
}

.output-copy-container {
  text-align: center; 
  margin-top: 20px;
}

.output-copy-btn {
  background: linear-gradient(135deg, var(--success-color), var(--primary-color)); 
  color: white; 
  border: none; 
  padding: 12px 24px; 
  border-radius: var(--border-radius); 
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.output-copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 105, 180, 0.4);
}

.output-warning {
  margin-top: 16px; 
  font-size: 0.9rem; 
  color: var(--text-secondary);
  font-style: italic;
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color), #e91e63) !important;
}

.btn-error {
  background: linear-gradient(135deg, var(--love-color), #c62828) !important;
}

/* Shortcode Loading/Error States */
.shortcode-container {
  text-align: center; 
  padding: 60px; 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.shortcode-container h1 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.shortcode-container p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: var(--text-secondary);
  font-style: italic;
}

.shortcode-container a {
  color: var(--primary-color); 
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 107, 157, 0.3);
  transition: all 0.3s ease;
}

.shortcode-container a:hover {
  color: var(--love-color);
  border-bottom-color: var(--love-color);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-small { font-size: 0.9rem; }
.text-muted { color: var(--text-secondary); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* Special romantic effects */
@keyframes romantic-glow {
  0%, 100% { 
    box-shadow: 0 0 5px rgba(255, 107, 157, 0.5), 0 0 10px rgba(255, 107, 157, 0.3); 
  }
  50% { 
    box-shadow: 0 0 10px rgba(255, 107, 157, 0.8), 0 0 20px rgba(255, 107, 157, 0.5); 
  }
}

.card:hover {
  animation: romantic-glow 3s ease-in-out infinite;
}
