/* ============================================
   TEECENTS Happy Customer Poster Generator - Styles
   Fashion That Empowers – Mobile-first, WhatsApp-friendly layout
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --color-bg: #2B2A4C;
  --color-surface: #35346a;
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-border: #334155;
  --color-success: #22c55e;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body {
  margin: 0;
  padding: 20px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 500px;
  margin: 0 auto;
  padding: 0;
}

/* Form & Controls */
.controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Upload Zone - drag and drop */
.upload-zone {
  position: relative;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 140px;
  overflow: hidden;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.08);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-content {
  pointer-events: none;
}

.upload-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.upload-content p {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.upload-preview {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.upload-zone.has-image .upload-content {
  display: none;
}

.upload-zone.has-image .upload-preview {
  display: flex;
}

.upload-preview img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
  border-radius: 8px;
}

/* Input Group */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.9rem;
  font-weight: 600;
}

.input-group input[type="text"] {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
}

.input-group input::placeholder {
  color: var(--color-text-muted);
}

.input-group input:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* Buttons - large for mobile */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  position: relative;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 2px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-border);
}

.btn-whatsapp {
  background: #25d366;
  color: white;
}

.btn-whatsapp:hover:not(:disabled) {
  background: #1da851;
}

/* Step layout */
.step {
  margin-bottom: 1.5rem;
}

.step[hidden] {
  display: none !important;
}

/* ============ Landing Page ============ */
.step-landing {
  min-height: calc(100vh - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
}

.landing-content {
  width: 100%;
  max-width: 400px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.landing-logo {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  animation: fadeInDown 0.6s ease-out;
}

.landing-brand {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text);
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.landing-tagline {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.landing-name-group {
  width: 100%;
  max-width: 280px;
  margin: 1.25rem 0 0.5rem;
  animation: fadeInUp 0.6s ease-out 0.25s both;
}

.landing-name-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid white;
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  text-align: center;
  transition: border-color 0.2s;
}

.landing-name-input::placeholder {
  color: var(--color-text-muted);
}

.landing-name-input:focus {
  outline: none;
  border-color: white;
}

.location-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.location-btn:disabled:hover {
  transform: none;
  border-color: var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.location-gota:disabled:hover {
  border-color: var(--color-border);
  background: var(--color-surface);
}

.location-ghodasar:disabled:hover {
  border-color: var(--color-border);
  background: var(--color-surface);
}

.landing-subtitle {
  margin: 1rem 0 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: fadeInUp 0.6s ease-out 0.35s both;
}

.landing-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.5rem;
  animation: fadeInUp 0.6s ease-out 0.45s both;
}

.location-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  -webkit-tap-highlight-color: transparent;
}

.location-btn:hover {
  transform: scale(1.05);
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.15);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.25);
}

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

.location-btn .location-btn-text {
  display: block;
}

.location-gota {
  border-color: #6366f1;
}

.location-gota:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.2);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.3);
}

.location-ghodasar {
  border-color: #ec4899;
}

.location-ghodasar:hover {
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.2);
  box-shadow: 0 6px 24px rgba(236, 72, 153, 0.3);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.step-2 .step2-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Floating action buttons - centered, above safe area (mobile-friendly) */
.fab-group {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 20px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  pointer-events: none;
  gap: 16px;
  background: linear-gradient(to top, rgba(43, 42, 76, 0.95) 0%, rgba(43, 42, 76, 0.7) 70%, transparent 100%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.fab-group:not([hidden]) {
  display: flex !important;
}

.fab-group[hidden] {
  display: none !important;
}

.fab-group > * {
  pointer-events: auto;
}

.fab-icon-btn {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.fab-icon-btn:active {
  transform: scale(0.95);
}

.fab-create {
  background: var(--color-surface);
  color: var(--color-text);
  border: 2px solid var(--color-border);
}

.fab-create:hover {
  background: var(--color-border);
}

.fab-change-photo {
  background: var(--color-surface);
  color: var(--color-text);
  border: 2px solid var(--color-border);
}

.fab-change-photo:hover {
  background: var(--color-border);
}

.fab-icon-camera {
  font-size: 1.5rem;
}

.fab-download {
  background: var(--color-primary);
  color: white;
}

.fab-download:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.fab-icon-btn .fab-icon {
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  display: block;
}

/* Share bottom sheet */
.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.share-sheet[hidden] {
  display: none !important;
}

.share-sheet[hidden] .share-sheet-backdrop,
.share-sheet[hidden] .share-sheet-content {
  pointer-events: none;
}

.share-sheet:not([hidden]) {
  pointer-events: auto;
}

.share-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.share-sheet-content {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: var(--color-surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.share-sheet-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.share-sheet-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.share-sheet-btn {
  margin-top: 0.25rem;
}

/* Loading state */
.btn.loading .btn-text {
  visibility: hidden;
}

.btn.loading .btn-loader {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Back button on poster screen */
.back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin-bottom: 0.75rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.back-btn:hover {
  color: var(--color-primary);
}

.back-btn-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* Preview Area */
.preview-wrapper {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.preview-inner {
  position: relative;
  width: 100%;
  max-width: 100%;
  /* 12" × 18" frame aspect ratio */
  aspect-ratio: 12 / 18;
  overflow: hidden;
  border-radius: 8px;
  background: #2B2A4C;
  cursor: pointer;
  touch-action: none;
}

.preview-inner.has-photo {
  cursor: grab;
}

.preview-inner.has-photo:active {
  cursor: grabbing;
}

.preview-inner canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  display: block;
}

.preview-hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0.75rem 0 0;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  body {
    padding: 12px;
  }

  .step-landing {
    min-height: calc(100vh - 24px);
    padding: 1rem 0;
  }

  .landing-logo {
    width: 110px;
    height: 110px;
  }

  .landing-brand {
    font-size: 1.75rem;
  }

  .landing-tagline {
    font-size: 0.9rem;
  }

.landing-buttons {
  flex-direction: row;
  gap: 1rem;
  margin-top: 1rem;
  }

  .location-btn {
    width: 120px;
    height: 120px;
    font-size: 1rem;
  }

  .title {
    font-size: 1.1rem;
  }

  .btn {
    padding: 1.1rem 1.25rem;
    font-size: 1.05rem;
  }
}

