/**
 * drop-zone.css — PDF Platform Tool UI v2.0
 * Smallpdf/ilovePDF kalitesinde araç UI bileşenleri
 *
 * İçerik:
 *  1. Drop Zone
 *  2. Status / Progress Bar
 *  3. Thumbnail Grid
 *  4. Result Screen
 *  5. Toolbar (buttons, inputs, selects)
 *  6. Mode Toggle (free vs pro)
 *  7. Trust Widget
 *  8. Info Box / Note
 *  9. Responsive
 */

/* ─── 0. Tool App Root ──────────────────────────────────────── */

#tool-app,
.tool-app {
  --tz-primary:   #6366f1;
  --tz-success:   #10b981;
  --tz-danger:    #ef4444;
  --tz-warning:   #f59e0b;
  --tz-info:      #3b82f6;
  --tz-bg:        #ffffff;
  --tz-bg2:       #f7f8fc;
  --tz-bg3:       #eef0f7;
  --tz-border:    #e3e6f0;
  --tz-text:      #0d0f1a;
  --tz-muted:     #64748b;
  --tz-radius:    14px;
  --tz-radius-sm: 8px;
  --tz-shadow:    0 8px 32px rgba(0,0,0,.35);

  max-width: 860px;
  margin: 0 auto 2rem;
  padding: 1.25rem;
  color: var(--tz-text);
  font-family: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ─── 1. Drop Zone ──────────────────────────────────────────── */

.tp-dropzone {
  position: relative;
  border: 2px dashed var(--tz-border);
  border-radius: var(--tz-radius);
  background: #ffffff;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

.tp-dropzone:hover,
.tp-dropzone:focus-visible {
  border-color: var(--tz-primary);
  background: #f5f3ff;
}

.tp-dropzone:focus-visible {
  outline: 2px solid var(--tz-primary);
  outline-offset: 2px;
}

.tp-dropzone--over {
  border-color: var(--tz-primary) !important;
  background: #ede9fe !important;
  transform: scale(1.01);
}

.tp-dropzone--compact {
  padding: 1rem 1.5rem;
  border-style: solid;
  border-color: rgba(99,102,241,.4);
  margin-bottom: .5rem;
}

.tp-dropzone--compact .tp-dropzone__icon,
.tp-dropzone--compact .tp-dropzone__formats {
  display: none;
}

.tp-dropzone--compact .tp-dropzone__label {
  font-size: .9rem;
  color: var(--tz-muted);
}

.tp-dropzone--compact .tp-dropzone__sub {
  display: none;
}

.tp-dropzone--hidden {
  display: none !important;
}

.tp-dropzone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.tp-dropzone__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--tz-primary);
  opacity: .7;
  transition: opacity .2s, transform .2s;
}

.tp-dropzone:hover .tp-dropzone__icon {
  opacity: 1;
  transform: translateY(-3px);
}

.tp-dropzone__label {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .4rem;
  color: var(--tz-text);
}

.tp-dropzone__sub {
  font-size: .85rem;
  color: var(--tz-muted);
  margin-bottom: .6rem;
}

.tp-dropzone__formats {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--tz-primary);
  background: rgba(99,102,241,.12);
  border-radius: 6px;
  padding: .2rem .6rem;
  letter-spacing: .04em;
}

/* ─── 2. Status ─────────────────────────────────────────────── */

.tp-status {
  border-radius: var(--tz-radius-sm);
  padding: .65rem 1rem;
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: .75rem;
  border: 1px solid transparent;
  transition: all .2s;
}

.tp-status--hidden {
  display: none;
}

.tp-status--info {
  background: rgba(59,130,246,.12);
  border-color: rgba(59,130,246,.3);
  color: #1d4ed8;
}

.tp-status--success {
  background: rgba(16,185,129,.12);
  border-color: rgba(16,185,129,.3);
  color: #15803d;
}

.tp-status--error {
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.3);
  color: #b91c1c;
}

.tp-status--warning {
  background: #fefce8;
  border-color: #fde68a;
  color: #92400e;
}

/* ─── 2b. Progress Bar ──────────────────────────────────────── */

.tp-progress {
  position: relative;
  background: #eef0f7;
  border: 1px solid var(--tz-border);
  border-radius: 100px;
  height: 28px;
  overflow: hidden;
  margin-bottom: .75rem;
}

.tp-progress--hidden {
  display: none;
}

.tp-progress__fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--tz-primary), #818cf8);
  border-radius: 100px;
  width: 0%;
  transition: width .4s ease-out;
}

/* Shimmer animation on fill */
.tp-progress__fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,.15) 50%,
    transparent 100%
  );
  animation: tp-shimmer 1.6s linear infinite;
}

@keyframes tp-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.tp-progress__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  z-index: 1;
  pointer-events: none;
}

/* ─── 3. Thumbnails ─────────────────────────────────────────── */

.tp-thumb-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
}

.tp-thumb-grid--hidden {
  display: none;
}

.tp-single-thumb {
  display: flex;
  gap: .75rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.tp-single-thumb--hidden {
  display: none;
}

.tp-thumb {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  background: #ffffff;
  border: 1px solid var(--tz-border);
  border-radius: var(--tz-radius-sm);
  padding: .6rem;
  width: 130px;
  transition: border-color .15s;
  animation: tp-thumb-in .2s ease-out;
}

@keyframes tp-thumb-in {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}

.tp-thumb:hover {
  border-color: rgba(99,102,241,.5);
}

.tp-thumb__placeholder {
  width: 100%;
  aspect-ratio: 0.707;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f8fc;
  border-radius: 4px;
  overflow: hidden;
}

.tp-thumb__canvas {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.tp-thumb__name {
  font-size: .72rem;
  color: var(--tz-muted);
  text-align: center;
  word-break: break-all;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tp-thumb__size {
  font-size: .68rem;
  color: rgba(139,148,158,.7);
}

.tp-thumb__pages {
  position: absolute;
  top: .3rem;
  left: .3rem;
  background: rgba(13,15,26,.75);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.tp-thumb__remove {
  position: absolute;
  top: -.3rem;
  right: -.3rem;
  width: 20px;
  height: 20px;
  background: var(--tz-danger);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform .15s, background .15s;
  z-index: 2;
}

.tp-thumb__remove:hover {
  transform: scale(1.2);
  background: #dc2626;
}

/* ─── 4. Result Screen ──────────────────────────────────────── */

.tp-result {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: #ffffff;
  border: 1px solid rgba(16,185,129,.35);
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  border-radius: var(--tz-radius);
  animation: tp-result-in .35s cubic-bezier(.34,1.56,.64,1);
}

@keyframes tp-result-in {
  from { opacity: 0; transform: scale(.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.tp-result__icon {
  font-size: 3.5rem;
  margin-bottom: .6rem;
  animation: tp-bounce .6s cubic-bezier(.34,1.56,.64,1) .1s both;
}

@keyframes tp-bounce {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.tp-result__title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: .5rem;
  color: var(--tz-text);
}

.tp-result__savings {
  font-size: .95rem;
  color: #15803d;
  margin-bottom: 1.25rem;
  font-weight: 600;
}

.tp-result__download {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 2rem;
  background: var(--tz-success);
  color: #fff;
  border: none;
  border-radius: var(--tz-radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  margin-bottom: .75rem;
}

.tp-result__download:hover {
  background: #059669;
  transform: translateY(-1px);
}

.tp-result__download:active {
  transform: translateY(0);
}

.tp-result__again {
  display: block;
  margin: .5rem auto 0;
  background: transparent;
  border: 1px solid var(--tz-border);
  color: var(--tz-muted);
  padding: .55rem 1.4rem;
  border-radius: var(--tz-radius-sm);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.tp-result__again:hover {
  border-color: var(--tz-text);
  color: var(--tz-text);
}

/* ─── Success Upsell Card ───────────────────────────────────── */

.tp-upsell {
  margin-top: 1.5rem;
  border-radius: 16px;
  overflow: hidden;
  animation: tp-result-in .4s cubic-bezier(.34,1.56,.64,1) .15s both;
  font-family: 'Figtree', sans-serif;
}

/* Header strip */
.tp-upsell__header {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  padding: 1.25rem 1.5rem 1rem;
  text-align: center;
}

.tp-upsell__badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(255,255,255,.15);
  color: #c7d2fe;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .2rem .65rem;
  border-radius: 100px;
  margin-bottom: .6rem;
}

.tp-upsell__headline {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: .2rem;
}

.tp-upsell__sub {
  font-size: .8rem;
  color: rgba(199,210,254,.7);
}

/* Feature grid */
.tp-upsell__features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f7f8fc;
  border-left: 1px solid #e3e6f0;
  border-right: 1px solid #e3e6f0;
}

.tp-upsell__feat {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid #e3e6f0;
  border-right: 1px solid #e3e6f0;
}

.tp-upsell__feat:nth-child(2n) {
  border-right: none;
}

.tp-upsell__feat:nth-last-child(-n+2) {
  border-bottom: none;
}

.tp-upsell__feat-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #ede9fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .75rem;
  color: #6d28d9;
}

.tp-upsell__feat-text {
  font-size: .78rem;
  line-height: 1.4;
}

.tp-upsell__feat-title {
  font-weight: 700;
  color: #0d0f1a;
  display: block;
}

.tp-upsell__feat-desc {
  color: #64748b;
}

/* CTA footer */
.tp-upsell__footer {
  background: #fff;
  border: 1px solid #e3e6f0;
  border-top: none;
  border-radius: 0 0 16px 16px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.tp-upsell__price {
  font-size: .82rem;
  color: #64748b;
  line-height: 1.45;
}

.tp-upsell__price strong {
  color: #0d0f1a;
  font-weight: 800;
}

.tp-upsell__cta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: #4f46e5;
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  padding: .65rem 1.4rem;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}

.tp-upsell__cta:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

.tp-upsell__dismiss {
  display: block;
  text-align: center;
  font-size: .72rem;
  color: #94a3b8;
  margin-top: .5rem;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  padding: .25rem;
  font-family: inherit;
}

.tp-upsell__dismiss:hover { color: #64748b; }

@media (max-width: 480px) {
  .tp-upsell__features { grid-template-columns: 1fr; }
  .tp-upsell__feat { border-right: none; }
  .tp-upsell__feat:nth-last-child(-n+2) { border-bottom: 1px solid #e3e6f0; }
  .tp-upsell__feat:last-child { border-bottom: none; }
  .tp-upsell__footer { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ─── 5. Buttons / Inputs / Selects ─────────────────────────── */

.tp-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.5rem;
  border: none;
  border-radius: var(--tz-radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s, opacity .15s;
  margin-top: .75rem;
  width: 100%;
  justify-content: center;
}

.tp-btn--primary {
  background: var(--tz-primary);
  color: #fff;
}

.tp-btn--primary:hover:not(:disabled) {
  background: #4f46e5;
  transform: translateY(-1px);
}

.tp-btn--primary:active:not(:disabled) {
  transform: translateY(0);
}

.tp-btn--secondary {
  background: #f7f8fc;
  color: var(--tz-text);
  border: 1px solid var(--tz-border);
}

.tp-btn--secondary:hover:not(:disabled) {
  background: #eef0f7;
}

.tp-btn--success {
  background: var(--tz-success);
  color: #fff;
}

.tp-btn--success:hover:not(:disabled) {
  background: #059669;
}

.tp-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
}

.tp-btn--hidden {
  display: none !important;
}

.tp-optbox {
  background: #f7f8fc;
  border: 1px solid var(--tz-border);
  border-radius: var(--tz-radius-sm);
  padding: 1rem;
  margin-top: .75rem;
}

.tp-optbox--hidden {
  display: none;
}

.tp-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--tz-muted);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.tp-input,
.tp-select {
  width: 100%;
  padding: .7rem .85rem;
  background: var(--tz-bg2);
  border: 1px solid var(--tz-border);
  border-radius: var(--tz-radius-sm);
  color: var(--tz-text);
  font-size: .95rem;
  transition: border-color .15s;
  margin-bottom: .65rem;
  outline: none;
}

.tp-input::placeholder {
  color: var(--tz-muted);
  opacity: .7;
}

.tp-input:focus,
.tp-select:focus {
  border-color: var(--tz-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.tp-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b949e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.tp-select option {
  background: #ffffff;
  color: var(--tz-text);
}

/* ─── 6. Mode Toggle (Free vs Pro) ──────────────────────────── */

.tp-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: .75rem;
}

.tp-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .15rem;
  padding: .85rem 1rem;
  background: #ffffff;
  border: 2px solid var(--tz-border);
  border-radius: var(--tz-radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: left;
}

.tp-mode-btn:hover {
  border-color: var(--tz-primary);
  background: #f5f3ff;
}

.tp-mode-btn--active {
  border-color: var(--tz-primary) !important;
  background: rgba(99,102,241,.1) !important;
}

.tp-mode-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 800;
  background: rgba(99,102,241,.2);
  color: #4f46e5;
  padding: .15rem .5rem;
  border-radius: 4px;
  letter-spacing: .04em;
  margin-bottom: .1rem;
}

.tp-mode-badge--pro {
  background: #fef3c7;
  color: #92400e;
}

.tp-mode-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--tz-text);
}

.tp-mode-sub {
  font-size: .75rem;
  color: var(--tz-muted);
}

/* ─── 7. Trust Widget ────────────────────────────────────────── */

.tp-trust {
  background: #f7f8fc;
  border: 1px solid var(--tz-border);
  border-radius: var(--tz-radius-sm);
  padding: 1rem 1.1rem;
  margin-top: 1.5rem;
  font-size: .85rem;
}

.tp-trust__row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.tp-trust__title {
  font-weight: 700;
  margin-bottom: .3rem;
  color: var(--tz-text);
}

.tp-trust__desc {
  color: var(--tz-muted);
  line-height: 1.5;
  margin-bottom: .6rem;
}

.tp-trust__actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.tp-trust__link {
  font-size: .78rem;
  font-weight: 600;
  color: var(--tz-muted);
  text-decoration: none;
  border: 1px solid var(--tz-border);
  border-radius: 6px;
  padding: .25rem .6rem;
  transition: border-color .15s, color .15s;
}

.tp-trust__link:hover {
  border-color: var(--tz-text);
  color: var(--tz-text);
}

.tp-trust__links {
  min-width: 180px;
  flex: 1;
}

.tp-trust__links-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tz-muted);
  margin-bottom: .5rem;
}

.tp-trust__lnk {
  display: block;
  color: #1d4ed8;
  text-decoration: none;
  font-size: .82rem;
  margin-bottom: .25rem;
  transition: color .15s;
}

.tp-trust__lnk:hover {
  color: #bfdbfe;
  text-decoration: underline;
}

/* ─── 8. Info Box / Note ─────────────────────────────────────── */

.tp-info-box {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: var(--tz-radius-sm);
  padding: .8rem 1rem;
  font-size: .85rem;
  color: #92400e;
  margin-top: .75rem;
  line-height: 1.5;
}

.tp-note {
  font-size: .78rem;
  color: var(--tz-muted);
  margin-top: .5rem;
  line-height: 1.5;
}

/* ─── 9. Responsive ──────────────────────────────────────────── */

@media (max-width: 640px) {
  #tool-app,
  .tool-app {
    padding: .75rem;
  }

  .tp-dropzone {
    padding: 2rem 1rem;
  }

  .tp-thumb {
    width: 100px;
  }

  .tp-mode-toggle {
    grid-template-columns: 1fr;
  }

  .tp-result {
    padding: 1.75rem 1rem;
  }

  .tp-result__download {
    width: 100%;
    justify-content: center;
  }

  .tp-trust__row {
    flex-direction: column;
    gap: .75rem;
  }
}

@media (max-width: 480px) {
  .tp-dropzone__label {
    font-size: .95rem;
  }

  .tp-btn {
    font-size: .92rem;
    padding: .8rem 1rem;
  }
}

/* ─── 10. Light Mode Override ────────────────────────────────── */
/* Eğer site light mode kullanıyorsa bu bloğu aktif et */
/*
@media (prefers-color-scheme: light) {
  #tool-app, .tool-app {
    --tz-bg:     #f9fafb;
    --tz-bg2:    #ffffff;
    --tz-bg3:    #f3f4f6;
    --tz-border: #e5e7eb;
    --tz-text:   #111827;
    --tz-muted:  #6b7280;
  }

  .tp-dropzone {
    background: #ffffff;
  }

  .tp-result {
    background: #fff;
    border-color: rgba(16,185,129,.35);
  }

  .tp-trust {
    background: #fff;
  }
}
*/

/* ─── 11. Animation helpers ──────────────────────────────────── */

.tp-fade-in {
  animation: tp-fade-in .25s ease-out;
}

@keyframes tp-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── 12. Credit badge ───────────────────────────────────────── */

[data-credit-display] {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

[data-credit-display].credit-low {
  color: var(--tz-warning);
  font-weight: 700;
}
