/* Reset and base styles */
:root {
  --canvas-max: 520px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Upload and Preview areas */
#uploadArea,
#previewArea {
  width: 80vw;
  max-width: var(--canvas-max);
  margin: 0 auto 16px;
}

/* FilePond */
#uploadArea .filepond--root {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 auto !important;
}

#uploadArea .filepond--panel-root,
#uploadArea .filepond--panel[data-scalable="false"] {
  background: #f8fafb !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 16px !important;
}
#uploadArea .filepond--drop-label,
#uploadArea .filepond--panel-root,
#uploadArea .filepond--root * {
  border-style: none !important;
  outline: none !important;
}
#uploadArea .filepond--root::before,
#uploadArea .filepond--root::after,
#uploadArea .filepond--panel-root::before,
#uploadArea .filepond--panel-root::after {
  content: none !important;
}

#uploadArea .filepond--list-scroller,
#uploadArea .filepond--list {
  margin: 0 !important;
  padding: 0 !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #1F8E88;
  min-height: 100vh;
  min-height: 100dvh;
  color: #333;
}

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

/* Header */
header {
  text-align: center;
  margin-bottom: 20px;
  color: white;
}

header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin: 4px 0 8px !important;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Main content */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}


.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 16px;
  margin: 0 auto;
}

.filepond--credits { display: none !important; }



#previewArea {
  display: flex;
  flex-direction: column;
  gap: 12px;
}


#preview {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  image-rendering: pixelated;
  background: #ffffff;
  border-radius: 12px;
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  width: 100%;
  max-width: var(--canvas-max);
  margin: 0 auto;
}

@media (max-width: 767px) {
  .controls { 
    flex-direction: column; 
  }
  .controls .btn { 
    width: 100%; 
  }
}

@media (min-width: 768px) {
  .controls { 
    flex-direction: row; 
  }
}

/* Buttons */
.btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

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

.btn.primary {
  background: #3B66FF;
  color: #fff;
  box-shadow: 0 6px 16px rgba(59,102,255,0.25);
}

.btn.primary:hover:not([disabled]) {
  background: #2952E6;
}

.btn.secondary {
  background: #e9eef2;
  color: #111827;
}

.btn.secondary:hover:not([disabled]) {
  background: #d1d9e0;
}



/* Hide raw file input until FilePond initializes */
input.filepond {
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  color: white;
}

.spinner { width: 32px; height: 32px; border: 4px solid #ccc; border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }


.elapsed-time {
  font-size: 1.2rem;
  opacity: 0.8;
}

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

/* Hide FilePond preview when error overlay is active */
body.error-mode .filepond--root {
  visibility: hidden;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  header h1 {
    font-size: 2.5rem;
  }
  
  header p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 2rem;
  }
}

.disclaimer {
  color: rgba(255,255,255,0.82);
  font-size: clamp(11px, 1.6vw, 12px);
  line-height: 1.2;
  text-align: center;
  margin: 16px auto 0;
  max-width: 85%;
  opacity: 0.9;
}

/* Instagram CTA (homepage only, below disclaimer) */
.insta-cta {
  display: block;
  width: 30px;              /* desktop */
  margin: 12px auto 0;      /* keep vertical rhythm under 16px gap */
  opacity: 0.82;            /* match disclaimer tone */
  transition: opacity .2s ease, transform .1s ease;
}
.insta-cta img { display: block; width: 100%; height: auto; }
.insta-cta:hover, .insta-cta:focus { opacity: 1; transform: scale(1.02); outline: none; }
@media (max-width: 767px) {
  .insta-cta { width: 24px; }  /* ~20% smaller for mobile */
}