/* ShareLove.click - Mobile-First App-Like Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

:root {
  /* Dark Theme */
  --bg: #000000;
  --bg-secondary: #0d0d0d;
  --bg-card: #1a1a1a;
  --bg-elevated: #242424;
  --bg-input: #1a1a1a;

  /* Accent Colors */
  --accent: #ff375f;
  --accent-light: #ff6b8a;
  --accent-gradient: linear-gradient(135deg, #ff375f, #ff6b8a, #ff8fab);
  --purple: #bf5af2;
  --blue: #0a84ff;
  --green: #30d158;
  --orange: #ff9f0a;
  --cyan: #64d2ff;

  /* Text */
  --text: #ffffff;
  --text-secondary: #8e8e93;
  --text-tertiary: #48484a;

  /* Borders */
  --border: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.05);

  /* Sizing */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: 56px;
  --bottom-nav-height: 80px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 100px;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure hidden attribute works everywhere */
[hidden] {
  display: none !important;
}

/* ============ APP SHELL ============ */

/* Top App Bar - Compact */
.hero {
  background: var(--bg);
  padding: calc(var(--safe-top) + 16px) 20px 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

/* Horizontal Scroll Pills */
.occasion-nav {
  display: flex;
  gap: 8px;
  padding: 16px 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background: var(--bg);
  position: sticky;
  top: 85px;
  z-index: 99;
  -webkit-overflow-scrolling: touch;
}

.occasion-nav::-webkit-scrollbar {
  display: none;
}

.occasion-tab {
  scroll-snap-align: start;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: all 0.2s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.occasion-tab:active {
  transform: scale(0.96);
}

.occasion-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ============ MAIN CONTENT ============ */

.container {
  padding: 16px;
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 24px);
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

/* ============ TEMPLATE CARDS - FULL WIDTH ============ */

.template-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.template-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s ease;
}

.template-card:active {
  transform: scale(0.98);
}

.template-preview {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg-secondary);
}

.template-preview iframe {
  width: 100%;
  height: 100%;
  pointer-events: none;
  border: none;
}

.preview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, var(--bg-card));
}

.template-info {
  padding: 16px;
}

.template-info h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.template-info p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ============ BUTTONS - LARGE TOUCH TARGETS ============ */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-large {
  min-height: 56px;
  font-size: 17px;
  font-weight: 700;
  border-radius: var(--radius-lg);
  width: 100%;
}

/* ============ PAGE HEADER - iOS STYLE ============ */

.page-header {
  background: var(--bg);
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
  text-align: center;
  margin-right: 44px;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  border: 1px solid var(--border);
}

.back-btn:active {
  background: var(--bg-elevated);
  transform: scale(0.95);
}

/* ============ CREATOR FORM - MOBILE OPTIMIZED ============ */

.creator-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.creator-form {
  padding: 20px 16px;
  padding-bottom: 120px; /* Space for fixed bottom button */
}

.creator-preview {
  display: none; /* Hidden on mobile, show only on tablet+ */
}

@media (min-width: 768px) {
  .creator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
  }

  .creator-preview {
    display: block;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 20px;
    border: 1px solid var(--border);
    position: sticky;
    top: 80px;
    height: fit-content;
  }
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
  width: 100%;
  min-height: 50px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-tertiary);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  resize: none;
  min-height: 120px;
  line-height: 1.5;
}

.char-count {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* ============ PHOTO UPLOAD - TAP TARGET ============ */

.photo-upload {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  background: var(--bg-input);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-upload:active {
  background: var(--bg-elevated);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.upload-icon {
  font-size: 40px;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.photo-preview {
  max-width: 160px;
  max-height: 160px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.remove-photo {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 59, 48, 0.9);
  color: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============ GIF PICKER ============ */

.gif-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  min-height: 56px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.gif-toggle span:first-child {
  font-size: 24px;
  line-height: 1;
}

.gif-toggle span:last-child {
  color: var(--text-secondary);
}

.gif-toggle:hover {
  background: var(--bg-elevated);
}

.gif-toggle:active {
  background: var(--bg-elevated);
}

.gif-picker {
  margin-top: 12px;
  display: none;
}

.gif-picker.active {
  display: block;
}

.gif-search {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.gif-search input {
  flex: 1;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 15px;
  background: var(--bg-input);
  color: var(--text);
}

.gif-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
}

.gif-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.gif-grid img.selected {
  outline: 3px solid var(--accent);
}

.selected-gif {
  margin-top: 12px;
  position: relative;
  display: inline-block;
}

.selected-gif[hidden] {
  display: none !important;
}

.selected-gif img {
  max-width: 140px;
  border-radius: var(--radius-md);
}

.powered-by-giphy {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 8px;
}

/* ============ COLOR THEMES - GRID LAYOUT ============ */

.color-themes {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

@media (max-width: 400px) {
  .color-themes {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }
}

.color-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  border: 2px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.color-option:active {
  transform: scale(0.95);
}

.color-option input {
  display: none;
}

.color-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.color-swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.2);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.color-option input:checked + .color-swatch {
  border-color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.color-swatch.pink { background: linear-gradient(135deg, #ff375f, #ff6b8a); }
.color-swatch.red { background: linear-gradient(135deg, #ff3b30, #ff6b6b); }
.color-swatch.purple { background: linear-gradient(135deg, #bf5af2, #da8fff); }
.color-swatch.rose { background: linear-gradient(135deg, #ff2d55, #ff6482); }
.color-swatch.gold { background: linear-gradient(135deg, #ff9f0a, #ffc60a); }

.color-option span:last-child {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ============ OCCASION SELECTOR ============ */

.occasion-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}

.occasion-selector::-webkit-scrollbar {
  display: none;
}

.occasion-option {
  flex-shrink: 0;
}

.occasion-option input {
  display: none;
}

.occasion-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  min-height: 44px;
}

.occasion-option input:checked + .occasion-badge {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.occasion-badge-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--accent);
  font-size: 13px;
  font-weight: 600;
  color: white;
}

/* ============ CHECKBOX ============ */

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  min-height: 56px;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
}

/* ============ PREVIEW FRAME ============ */

.preview-frame {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  border: 1px solid var(--border);
}

.preview-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.creator-preview h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

/* ============ FIXED BOTTOM CTA ============ */

.creator-form .btn-large {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-radius: 0;
  min-height: 60px;
  padding-bottom: calc(var(--safe-bottom) + 16px);
  padding-top: 16px;
  background: var(--accent);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  font-size: 17px;
  letter-spacing: 0.3px;
}

.creator-form .btn-large:active {
  background: var(--accent-light);
}

@media (min-width: 768px) {
  .creator-form .btn-large {
    position: static;
    border-radius: var(--radius-lg);
    min-height: 56px;
    padding: 0 24px;
    box-shadow: none;
    margin-top: 16px;
  }
}

/* ============ PREVIEW PAGE ============ */

.preview-container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--nav-height));
}

.preview-main {
  padding: 16px;
}

.card-preview-large {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 16/10;
  border: 1px solid var(--border);
}

.card-preview-large iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.preview-sidebar {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: calc(var(--safe-bottom) + 24px);
}

@media (min-width: 768px) {
  .preview-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    padding: 24px;
  }

  .preview-main {
    padding: 0;
  }

  .preview-sidebar {
    padding: 0;
  }
}

.share-box {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

.share-box h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
}

.share-option {
  margin-bottom: 16px;
}

.share-option label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.share-link-box {
  display: flex;
  gap: 8px;
}

.share-link-box input {
  flex: 1;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--bg-input);
  color: var(--accent);
  font-family: 'SF Mono', monospace;
  font-weight: 500;
}

.copy-btn {
  min-width: 48px;
  min-height: 48px;
  padding: 0;
}

/* ============ SOCIAL SHARE - FULL WIDTH BUTTONS ============ */

.social-share {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: white;
  transition: transform 0.2s;
}

.share-btn:active {
  transform: scale(0.98);
}

.share-btn.whatsapp { background: #25D366; }
.share-btn.telegram { background: #0088cc; }
.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #000000; border: 1px solid var(--border); }
.share-btn.viber { background: #665CAC; }

.share-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.divider {
  text-align: center;
  margin: 20px 0;
  color: var(--text-tertiary);
  position: relative;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
}

.divider span {
  background: var(--bg-card);
  padding: 0 16px;
  position: relative;
}

.success-message {
  color: var(--green);
  font-size: 14px;
  padding: 14px;
  background: rgba(48, 209, 88, 0.1);
  border-radius: var(--radius-md);
  text-align: center;
}

.status-message {
  font-size: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  text-align: center;
}

.status-message.error {
  color: #ff453a;
  background: rgba(255, 69, 58, 0.1);
}

.status-message.success {
  color: var(--green);
  background: rgba(48, 209, 88, 0.1);
}

/* ============ CARD DETAILS ============ */

.card-details {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

.card-details h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
}

.card-details dl {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  align-items: center;
}

.card-details dt {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.card-details dd {
  font-size: 15px;
}

.theme-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
}

.theme-badge.pink { background: linear-gradient(135deg, #ff375f, #ff6b8a); }
.theme-badge.red { background: linear-gradient(135deg, #ff3b30, #ff6b6b); }
.theme-badge.purple { background: linear-gradient(135deg, #bf5af2, #da8fff); }
.theme-badge.rose { background: linear-gradient(135deg, #ff2d55, #ff6482); }
.theme-badge.gold { background: linear-gradient(135deg, #ff9f0a, #ffc60a); }

/* ============ CARD VIEW - FULL SCREEN ============ */

.card-view {
  background: var(--bg);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
}

.card-fullscreen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
}

.card-animation {
  width: 100%;
  max-width: 600px;
  min-height: 300px;
}

.card-photo {
  margin: 24px 0;
  text-align: center;
}

.card-photo img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px solid var(--accent);
  object-fit: cover;
  box-shadow: 0 8px 32px rgba(255, 55, 95, 0.3);
}

.card-gif {
  margin: 20px 0;
  text-align: center;
}

.card-gif img {
  max-width: 280px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.card-message-overlay {
  background: var(--bg-card);
  padding: 28px 24px;
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 100%;
  margin: 20px auto;
  text-align: center;
  border: 1px solid var(--border);
}

.message-to {
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 700;
}

.message-text {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.message-from {
  font-size: 18px;
  color: var(--accent-light);
  font-style: italic;
  font-weight: 600;
}

.music-toggle {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 24px);
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  font-size: 24px;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(255, 55, 95, 0.4);
}

.music-toggle:active {
  transform: scale(0.95);
}

/* ============ CARD FOOTER - BOTTOM FIXED ============ */

.card-footer {
  background: var(--bg-card);
  padding: 20px 16px calc(var(--safe-bottom) + 20px);
  text-align: center;
  border-top: 1px solid var(--border);
}

.card-footer .from-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.card-footer .from-label strong {
  color: var(--accent);
}

.create-own-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 16px;
}

.create-own-btn:active {
  transform: scale(0.98);
}

/* ============ POWERED BY ============ */

.powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.powered-by a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ============ FOOTER ============ */

footer {
  background: var(--bg-card);
  text-align: center;
  padding: 32px 16px calc(var(--safe-bottom) + 32px);
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.footer-occasions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.footer-occasions a {
  color: var(--text-tertiary);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  font-size: 13px;
}

.footer-occasions a:active {
  background: var(--bg-input);
}

/* ============ DESKTOP ENHANCEMENTS ============ */

@media (min-width: 768px) {
  .hero {
    padding: 24px 24px 20px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero .subtitle {
    font-size: 16px;
  }

  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    padding-bottom: 48px;
  }

  .template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
  }

  .section-title {
    font-size: 28px;
    margin-bottom: 24px;
  }

  .social-share {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .card-fullscreen {
    padding: 48px 24px;
  }

  .card-message-overlay {
    padding: 40px;
  }

  .message-to {
    font-size: 28px;
  }

  .message-text {
    font-size: 19px;
  }

  .occasion-nav {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* ============ SCROLLBAR ============ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 3px;
}

/* ============ SELECTION ============ */

::selection {
  background: var(--accent);
  color: white;
}

/* ============ LOADING ============ */

.loading {
  background: linear-gradient(90deg,
    var(--bg-card) 25%,
    var(--bg-elevated) 50%,
    var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ============ ANIMATIONS ============ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.template-card {
  animation: fadeIn 0.3s ease backwards;
}

.template-card:nth-child(1) { animation-delay: 0.05s; }
.template-card:nth-child(2) { animation-delay: 0.1s; }
.template-card:nth-child(3) { animation-delay: 0.15s; }
.template-card:nth-child(4) { animation-delay: 0.2s; }
.template-card:nth-child(5) { animation-delay: 0.25s; }

/* ============ DOWNLOAD BUTTON ============ */

.share-btn.download {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.share-btn.download:hover {
  background: linear-gradient(135deg, #7c3aed, #9333ea);
}

/* ============ MODAL ============ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 420px;
  width: 100%;
  border: 1px solid var(--border);
  position: relative;
  animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-elevated);
  border-radius: 50%;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--bg-input);
  color: var(--text);
}

.modal-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.download-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.download-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
}

.download-option label {
  font-size: 15px;
  font-weight: 500;
}

.download-option select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
}

.download-option input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions .btn {
  flex: 1;
  min-height: 50px;
}

.modal-note {
  margin-top: 20px;
  padding: 14px;
  background: rgba(255, 159, 10, 0.1);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--orange);
  text-align: center;
}

/* ============ PROGRESS BAR ============ */

.progress-container {
  margin-bottom: 24px;
}

.progress-bar {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.1s linear;
}

.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

/* ============ AUDIO TOGGLE ENHANCEMENTS ============ */

.music-toggle {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 100px);
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--bg-elevated);
  font-size: 24px;
  z-index: 50;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.music-toggle:hover {
  transform: scale(1.05);
}

.music-toggle:active {
  transform: scale(0.95);
}

.music-toggle.playing {
  background: var(--accent);
  animation: audioPlaying 1.5s ease-in-out infinite;
}

@keyframes audioPlaying {
  0%, 100% { box-shadow: 0 4px 16px rgba(255, 55, 95, 0.3); }
  50% { box-shadow: 0 4px 24px rgba(255, 55, 95, 0.6); }
}

.music-toggle.preview-audio {
  bottom: auto;
  top: calc(var(--safe-top) + 70px);
  right: 16px;
}

/* Card view specific positioning */
.card-view .music-toggle {
  bottom: calc(var(--safe-bottom) + 120px);
}

/* ============ AUDIO WAVE ANIMATION ============ */

.audio-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 24px;
}

.audio-wave span {
  width: 3px;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  animation: wave 0.8s ease-in-out infinite;
}

.audio-wave span:nth-child(1) { animation-delay: 0s; }
.audio-wave span:nth-child(2) { animation-delay: 0.1s; }
.audio-wave span:nth-child(3) { animation-delay: 0.2s; }
.audio-wave span:nth-child(4) { animation-delay: 0.3s; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

/* ============ LANGUAGE SELECTOR ============ */

.language-selector {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  right: 16px;
  z-index: 200;
}

.lang-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-toggle:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 160px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.lang-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--border-light);
}

.lang-option:last-child {
  border-bottom: none;
}

.lang-option:hover {
  background: var(--bg-elevated);
}

.lang-option.active {
  background: rgba(255, 55, 95, 0.1);
  color: var(--accent);
  font-weight: 600;
}

/* Header language selector (create/preview pages) */
.language-selector.header-lang {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
}

.language-selector.header-lang .lang-toggle {
  padding: 6px 8px;
  font-size: 22px;
}

.language-selector.header-lang .lang-dropdown {
  right: 0;
}

/* RTL Support */
html[dir="rtl"] .language-selector {
  right: auto;
  left: 16px;
}

html[dir="rtl"] .language-selector.header-lang {
  right: auto;
  left: 16px;
}

html[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}

html[dir="rtl"] .page-header .back-btn {
  right: auto;
  left: 16px;
}

html[dir="rtl"] .page-header h1 {
  text-align: right;
  padding-left: 0;
  padding-right: 48px;
}

/* RTL text alignment */
html[dir="rtl"] .message-text,
html[dir="rtl"] .message-to,
html[dir="rtl"] .message-from {
  text-align: right;
}

html[dir="rtl"] .card-details dl {
  text-align: right;
}

html[dir="rtl"] .form-group label {
  text-align: right;
}

html[dir="rtl"] .form-group input,
html[dir="rtl"] .form-group textarea {
  text-align: right;
}
