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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-container { width: 100%; max-width: 700px; padding: 2rem; }

h1 {
  text-align: center; font-size: 2.8rem; margin-bottom: .3rem;
  background: linear-gradient(90deg, #f857a6, #ff5858, #ffc371);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  font-weight: 800; letter-spacing: -0.02em;
}

.subtitle { 
  text-align: center; color: rgba(255,255,255,.6); margin-bottom: 2rem; font-size: 1rem; font-weight: 400; letter-spacing: 0.01em;
}

/* card */
.card {
  background: rgba(255,255,255,.07); backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 24px;
  padding: 2.5rem; box-shadow: 0 8px 32px rgba(0,0,0,.35);
}

/* drop zone */
.drop-zone {
  border: 2px dashed rgba(255,255,255,.2); border-radius: 18px;
  padding: 3rem 1.5rem; text-align: center; cursor: pointer; transition: .3s; position: relative; overflow: hidden;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: #f857a6; background: rgba(248,87,166,.08); }
.drop-zone-icon { font-size: 3rem; margin-bottom: .6rem; }
.drop-zone p { color: rgba(255,255,255,.7); font-size: 1.05rem; font-weight: 500; }
.drop-zone span.hint { display: block; margin-top: .4rem; font-size: .85rem; color: rgba(255,255,255,.4); }
#file-input { display: none; }

/* thumbnail */
.thumbnail-wrap { position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 1.5rem; box-shadow: 0 4px 20px rgba(0,0,0,.3); }
.thumbnail-wrap img { width: 100%; display: block; border-radius: 16px; }
.remove-btn {
  position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  border: none; color: #fff; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; transition: .2s; opacity: 0.7;
}
.remove-btn:hover { background: #ff5858; opacity: 1; }

/* actions */
.actions-label { font-size: .9rem; color: rgba(255,255,255,.6); margin-bottom: .8rem; font-weight: 500; letter-spacing: 0.03em; text-transform: uppercase; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; margin-bottom: 1.2rem; }

/* UPDATED ACTION BUTTONS */
.action-btn {
  background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: .9rem .6rem;
  border-radius: 14px;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 500;
  transition: all .3s ease;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 4px 6px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

.action-btn::before {
  content: '';
  position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: .5s;
}

.action-btn:hover { 
  background: linear-gradient(145deg, rgba(255,255,255,0.15), rgba(255,255,255,0.08));
  border-color: #f857a6;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.2);
}

.action-btn:hover::before { left: 100%; }

.action-btn.selected { 
  background: linear-gradient(135deg, #f857a6, #ff5858);
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(248,87,166,.4), inset 0 -2px 4px rgba(0,0,0,0.1);
  transform: translateY(-1px);
  font-weight: 600;
}

/* textarea */
.other-area { margin-bottom: 1.5rem; display: none; }
.other-area.visible { display: block; animation: fadeUp .3s ease; }
.other-area label { font-size: .9rem; color: rgba(255,255,255,.6); margin-bottom: .5rem; display: block; font-weight: 500; }
.other-area textarea {
  width: 100%; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,.15); color: #fff;
  padding: 1rem; border-radius: 12px; font-size: .95rem; resize: vertical; min-height: 80px; outline: none; transition: .2s;
  font-family: inherit;
}
.other-area textarea:focus { border-color: #f857a6; box-shadow: 0 0 0 3px rgba(248,87,166,.1); }

/* apply */
.apply-btn {
  width: 100%; padding: 1rem; border: none; border-radius: 14px; font-size: 1.05rem; font-weight: 600; cursor: pointer;
  background: linear-gradient(135deg, #f857a6, #ff5858); color: #fff; box-shadow: 0 4px 20px rgba(248,87,166,.35); transition: .25s;
  position: relative; overflow: hidden; letter-spacing: 0.02em;
}
.apply-btn::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); transition: .5s;
}
.apply-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(248,87,166,.5); }
.apply-btn:hover::after { left: 100%; }
.apply-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* loading */
.loading-state { display: none; text-align: center; padding: 2rem 0; }
.loading-state.visible { display: block; animation: fadeUp .4s ease; }
.spinner { width: 56px; height: 56px; margin: 0 auto 1.2rem; border: 4px solid rgba(255,255,255,.1); border-top-color: #f857a6; border-radius: 50%; animation: spin .8s linear infinite; }
.loading-state p { color: rgba(255,255,255,.7); margin-bottom: 1rem; font-size: 1.05rem; font-weight: 500; }

/* UPDATED CANCEL BUTTON */
.cancel-btn { 
  background: rgba(255,255,255,0.08); 
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15); 
  color: #fff; 
  padding: .7rem 2rem; 
  border-radius: 12px; 
  cursor: pointer; 
  font-size: .95rem; 
  font-weight: 500;
  transition: all .3s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.cancel-btn:hover { 
  background: rgba(255,88,88,.15); 
  border-color: #ff5858; 
  box-shadow: 0 4px 12px rgba(255,88,88,.15), inset 0 1px 0 rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

/* result */
.result-state { display: none; text-align: center; padding: 1rem 0; }
.result-state.visible { display: block; animation: fadeUp .4s ease; }
.result-label { font-size: .85rem; color: rgba(255,255,255,.5); margin-bottom: 1.2rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }

/* result image wrapper with overlay */
.result-img-wrap { position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 1.5rem; box-shadow: 0 4px 24px rgba(0,0,0,.3); cursor: pointer; min-width: 100%; min-height: 320px; background: rgba(0,0,0,.15); }
.result-img-wrap img { width: 100%; min-height: 320px; display: block; border-radius: 16px; transition: transform .3s ease; object-fit: contain; }
.result-img-wrap:hover img { transform: scale(1.02); }

/* fullscreen toggle button - top right corner */
.fullscreen-btn {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.2); color: #fff;
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  font-size: 1.25rem; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: .2s;
}
.fullscreen-btn:hover { background: #f857a6; border-color: #f857a6; }

/* before / after comparison - visible only in fullscreen */
.result-img-wrap .compare-before-img,
.result-img-wrap .compare-divider,
.result-img-wrap .compare-slider { display: none; }
.result-img-wrap.fullscreen .compare-before-img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain; border-radius: 0;
  clip-path: inset(0 50% 0 0);
  pointer-events: none;
  display: block;
}
.result-img-wrap.fullscreen .compare-divider {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; transform: translateX(-50%);
  background: rgba(255,255,255,.85);
  box-shadow: 0 0 8px rgba(0,0,0,.6);
  pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
}
.result-img-wrap.fullscreen .compare-divider span { font-size: .7rem; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.result-img-wrap.fullscreen .compare-slider {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  width: 60%; z-index: 6; accent-color: #f857a6; cursor: pointer;
  display: block;
}

/* fullscreen state - image takes full viewport */
.result-img-wrap.fullscreen { position: fixed; inset: 0; z-index: 1000; margin: 0; border-radius: 0; min-height: 0; background: rgba(0,0,0,.92); }
.result-img-wrap.fullscreen img { min-height: 0; height: 100%; object-fit: contain; border-radius: 0; }
.result-img-wrap.fullscreen:hover img { transform: none; }
.result-img-wrap.fullscreen .fullscreen-btn { opacity: 1; }
.result-img-wrap.fullscreen .result-overlay { display: none; }

/* overlay buttons on result image - positioned at bottom */
.overlay-btns { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.result-overlay { 
  position: absolute; 
  bottom: 0; 
  left: 0; 
  right: 0; 
  background: linear-gradient(to top, rgba(0,0,0,.8) 0%, transparent 100%);
  backdrop-filter: blur(4px); 
  display: flex; 
  align-items: flex-end; 
  justify-content: center; 
  padding: 1.5rem; 
  opacity: 0; 
  transition: opacity .3s ease; 
}
.result-img-wrap:hover .result-overlay,
.result-img-wrap.active .result-overlay { opacity: 1; }

/* TOS modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: none; justify-content: center; align-items: center; z-index: 100; }
.modal-overlay.visible { display: flex; animation: fadeIn .25s ease; }
.modal-box { background: linear-gradient(145deg, #1e1b3a, #2d2956); border: 1px solid rgba(255,255,255,.1); border-radius: 20px; padding: 2.5rem; max-width: 480px; width: 90%; box-shadow: 0 16px 48px rgba(0,0,0,.5); }
.modal-box h2 { margin-bottom: 1rem; font-size: 1.5rem; background: linear-gradient(90deg,#f857a6,#ffc371); -webkit-background-clip:text; -webkit-text-fill-color:transparent; font-weight: 700; }
.tos-text { max-height: 240px; overflow-y: auto; color: rgba(255,255,255,.65); font-size: .9rem; line-height: 1.7; margin-bottom: 1.5rem; padding-right: .3rem; }
.tos-text::-webkit-scrollbar { width: 4px; }
.tos-text::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.modal-actions { display: flex; gap: .8rem; justify-content: flex-end; }

/* UPDATED MODAL BUTTONS */
.modal-btn { padding: .7rem 2rem; border-radius: 12px; font-size: .95rem; cursor: pointer; color: #fff; transition: all .3s ease; position: relative; overflow: hidden; font-weight: 500; }

.modal-btn.accept { 
  background: linear-gradient(135deg,#f857a6,#ff5858); 
  box-shadow:0 4px 14px rgba(248,87,166,.3), inset 0 -2px 4px rgba(0,0,0,0.1);
  border: none;
}

.modal-btn.cancel { 
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 4px 6px rgba(0,0,0,0.1);
}

.modal-btn:hover { transform: translateY(-1px); }
.modal-btn.accept:hover { box-shadow: 0 8px 20px rgba(248,87,166,.5), inset 0 -2px 4px rgba(0,0,0,0.1); }
.modal-btn.cancel:hover { background: linear-gradient(145deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06)); border-color: #f857a6; }

/* Age verification modal */
.age-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: center; z-index: 9999; animation: fadeIn .3s ease; }
.age-modal-box { background: linear-gradient(145deg, #1a1630, #2d2956); border: 1px solid rgba(255,88,88,.25); border-radius: 24px; padding: 3rem; max-width: 500px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 40px rgba(248,87,166,.1); text-align: center; }
.age-modal-box h2 { margin-bottom: 1rem; font-size: 1.6rem; background: linear-gradient(90deg,#ff5858,#f857a6); -webkit-background-clip:text; -webkit-text-fill-color:transparent; font-weight: 700; }
.age-modal-box .warning-icon { font-size: 3rem; margin-bottom: 1rem; display: block; }
.age-modal-box p { color: rgba(255,255,255,.7); font-size: .95rem; line-height: 1.6; margin-bottom: 2rem; }
.age-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* FULL PAGE MAINTENANCE OVERLAY */
.maintenance-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  display: none; justify-content: center; align-items: center;
}
.maintenance-overlay.visible {
  display: flex; animation: fadeIn .4s ease;
}
.maintenance-card {
  text-align: center; max-width: 560px; width: 90%; padding: 3rem 2.5rem;
  background: rgba(255,255,255,.06); backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.1); border-radius: 28px;
  box-shadow: 0 16px 64px rgba(0,0,0,.45);
}
.maintenance-icon-lg {
  font-size: 4.5rem; display: block; margin-bottom: 1.5rem;
  filter: drop-shadow(0 2px 8px rgba(248,87,166,.3));
}
.maintenance-title {
  font-size: 2.2rem; margin-bottom: 1.2rem; font-weight: 700;
  background: linear-gradient(90deg,#f857a6,#ffc371);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.maintenance-desc {
  color: rgba(255,255,255,.7); font-size: 1.1rem; line-height: 1.8; margin-bottom: .6rem;
}
.maintenance-note {
  color: rgba(255,255,255,.35); font-size: .95rem; margin-top: 1.5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

@media (max-width:520px) {
  .app-container { padding: 1rem; }
  .card { padding: 1.3rem; }
  h1 { font-size: 2rem; }
  .action-grid { grid-template-columns: repeat(2,1fr); }
  .overlay-btns { flex-direction: column; width: 100%; }
  .overlay-btns .action-btn { width: 100%; }
}
