/* --- FROM css/image-compressor.css --- */

/* ═══════════════════════════════════════════════
   Image Compressor Styles
   Matches existing dark theme
   ═══════════════════════════════════════════════ */

/* Back Link */
.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.back-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* Compressor Hero */
.compressor-hero {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem 3rem;
  position: relative;
}

.compressor-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.3;
  text-align: center;
}

/* Upload Area */
.upload-area {
  width: 100%;
  max-width: 500px;
  min-height: 200px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--red);
  background: var(--surface-3);
}

.upload-content {
  text-align: center;
  padding: 2rem;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.upload-text {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.upload-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.upload-loading {
  text-align: center;
  padding: 2rem;
}

.upload-loading .loader {
  width: 40px;
  height: 40px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Quality Control - FIXED TRACK VISIBILITY */
.quality-control {
  width: 100%;
  max-width: 400px;
  margin: 1rem 0;
  text-align: center;
}

.quality-control label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.quality-control label span {
  color: var(--red);
  font-weight: 600;
}

/* Range input - complete styling */
.quality-control input[type="range"] {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  outline: none;
}

/* Track (the line) */
.quality-control input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  background: var(--surface-3);
  border-radius: 4px;
  border: none;
}

.quality-control input[type="range"]::-moz-range-track {
  width: 100%;
  height: 8px;
  background: var(--surface-3);
  border-radius: 4px;
}

/* Thumb (red dot) */
.quality-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--red);
  border-radius: 50%;
  cursor: pointer;
  margin-top: -5px;
  transition: transform var(--transition);
}

.quality-control input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.quality-control input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--red);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Result Area */
.result-area {
  width: 100%;
  max-width: 700px;
  margin-top: 1.5rem;
  animation: fade-in-up 0.5s ease both;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.preview-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.preview-card h3 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  text-align: center;
}

.preview-img-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.preview-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.file-size {
  font-size: 0.85rem;
  color: var(--text);
  text-align: center;
  font-weight: 500;
}

.savings {
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  margin-top: 0.25rem;
}

/* Download Button */
.btn-download-compressed {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-download-compressed:hover:not(:disabled) {
  background: #22c55e;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.btn-download-compressed:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* History Section (yeni) */
.history-section {
  margin-top: 2rem;
  width: 100%;
  max-width: 500px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.history-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.history-clear:hover {
  color: var(--text);
  background: var(--surface-2);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.history-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-filename {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.history-savings {
  color: var(--green);
  font-weight: 600;
}

.history-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* Error Message */
.error-msg {
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 1rem;
  text-align: center;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .preview-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .upload-area {
    min-height: 160px;
  }

  .upload-icon {
    font-size: 2.5rem;
  }

  .history-filename {
    max-width: 120px;
  }
}
/* ── Mobilde Header Düzenlemesi (Ana Sayfa yazısı kaybolmasın) ── */
/* Mobilde Ana Sayfa linkini gizle */
@media (max-width: 600px) {
  .back-link {
    display: none;
  }
}


/* ─── SHARED INFO & FAQ SECTION ─── */

/* ─── INFO SECTION — tüm sayfalara yapıştır ────────────────────────── */
.info-section {
  width: 100%;
  padding: 4rem 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.info-inner {
  max-width: 900px;
  margin: 0 auto;
}

.info-inner h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.info-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.info-card:hover {
  border-color: var(--red);
  background: var(--surface-3);
  transform: translateY(-3px);
}

.info-icon {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.15rem;
}

.info-card h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.info-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ─── SSS / FAQ Section ──────────────────────────────────────────────── */
.faq-section {
  padding: 4rem 1.5rem;
}

.faq-inner {
  max-width: 720px;
  margin: 0 auto;
}

.faq-inner h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.faq-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.6rem;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item[open] {
  border-color: var(--red);
}

.faq-item summary {
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--red);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-body {
  padding: 0 1.25rem 1rem;
}

.faq-body p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }
}

@media (max-width: 480px) {
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
  }
  .info-section {
    padding: 2.5rem 1rem;
  }
  .info-inner h2,
  .faq-inner h2 {
    font-size: 1.25rem;
  }
  .info-card {
    padding: 1rem 0.75rem;
    border-radius: 12px;
  }
  .info-icon { font-size: 1.5rem; }
  .info-card h3 { font-size: 0.78rem; }
  .info-card p { font-size: 0.7rem; }
}
/* --- FROM css/image-converter.css --- */

/* ─── NexToolsX · image-converter.css ──────────────────────────────── */

/* Hero */
.converter-hero {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem 3rem;
  position: relative;
}

.converter-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.3;
  text-align: center;
}

/* Format şeridi */
.format-strip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0.75rem 0 1.25rem;
}

.fmt-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
}

.fmt-arrow {
  color: var(--red);
  font-size: 1rem;
  font-weight: 700;
}

/* Upload */
.upload-area {
  width: 100%;
  max-width: 500px;
  min-height: 180px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0 1rem;
}

.upload-area:hover,
.upload-area.dragover,
.upload-area:focus-visible {
  border-color: var(--red);
  background: var(--surface-3);
  outline: none;
}

.upload-content,
.upload-loading {
  text-align: center;
  padding: 1.5rem;
}

.upload-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.upload-text { font-size: 1rem; margin-bottom: 0.25rem; }
.upload-hint { font-size: 0.75rem; color: var(--text-muted); }

.loader {
  width: 40px;
  height: 40px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Kontroller */
.convert-controls {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.source-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.source-label { font-weight: 600; }
.source-format { color: var(--red); font-weight: 700; }

/* Format Seçici */
.selector-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.format-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.fmt-btn {
  flex: 1;
  min-width: 70px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text);
  letter-spacing: 0.03em;
}

.fmt-btn:hover:not(:disabled) {
  border-color: var(--red);
  background: var(--surface-3);
  transform: translateY(-1px);
}

.fmt-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.25);
}

.fmt-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Kalite */
.quality-control {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quality-control label {
  font-size: 0.8rem;
  font-weight: 600;
}

.quality-control input[type="range"] {
  width: 100%;
  height: 5px;
  -webkit-appearance: none;
  background: var(--surface-3);
  border-radius: 3px;
  outline: none;
}

.quality-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--red);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s;
}

.quality-control input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.quality-control input[type="range"]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.quality-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Dönüştür Butonu */
.btn-convert {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-convert:hover:not(:disabled) {
  background: var(--red-dim);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.3);
}

.btn-convert:disabled { opacity: 0.5; cursor: not-allowed; }

/* Sonuç */
.result-area {
  width: 100%;
  max-width: 680px;
  margin-top: 1rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.preview-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.8rem;
}

.preview-card.highlight {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red), 0 4px 16px rgba(255, 0, 0, 0.15);
}

.preview-card h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.preview-img-wrap {
  aspect-ratio: 1 / 1;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.preview-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.file-info {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.savings {
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  margin-top: 0.25rem;
  color: var(--green);
}

.convert-arrow {
  font-size: 1.5rem;
  color: var(--red);
  font-weight: 700;
  text-align: center;
}

/* Aksiyon Butonları */
.result-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-download-converted {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 0.7rem 1.8rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-download-converted:hover:not(:disabled) {
  background: #22c55e;
  transform: translateY(-2px);
}

.btn-download-converted:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-convert-another {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-convert-another:hover {
  border-color: var(--red);
  background: var(--surface-3);
}

/* Geçmiş */
.history-section {
  width: 100%;
  max-width: 520px;
  margin-top: 1.5rem;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  gap: 0.5rem;
}

.history-filename {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  color: var(--text-muted);
}

.history-conversion {
  color: var(--red);
  font-weight: 700;
  white-space: nowrap;
}

.history-savings {
  font-weight: 700;
  white-space: nowrap;
}

/* Hata */
.error-msg {
  color: var(--red);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}


/* --- FROM css/image-cropper.css --- */

/* ─── NexToolsX · image-cropper.css (FIXED) ────────────────────────── */

/* ─── Upload Area ───────────────────────────────────────────────────── */
.upload-area {
  width: 100%;
  max-width: 500px;
  min-height: 180px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0 1rem;
}
.upload-area:hover,
.upload-area.dragover,
.upload-area:focus-visible {
  border-color: var(--red);
  background: var(--surface-3);
  outline: none;
}
.upload-content { text-align: center; padding: 1.5rem; }
.upload-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.upload-text { font-size: 1rem; margin-bottom: 0.25rem; }
.upload-hint { font-size: 0.75rem; color: var(--text-muted); }

/* Cropper Hero */
.cropper-hero {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem 3rem;
  position: relative;
}

.cropper-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.3;
  text-align: center;
}

/* ─── Crop Workspace ────────────────────────────────────────────────── */
.crop-workspace {
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* ─── Ratio Bar ─────────────────────────────────────────────────────── */
.ratio-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.ratio-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill, 999px);
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text);
  letter-spacing: 0.02em;
}
.ratio-btn:hover {
  border-color: var(--red);
  background: var(--surface-3);
}
.ratio-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 3px 10px rgba(255,0,0,0.25);
}

/* ─── Canvas Wrapper (FIX: was .canvas-container in old CSS) ─────────── */
.canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 700px;
  background: var(--surface-3, #111);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  user-select: none;
  touch-action: none;
  cursor: crosshair;
  /* Height set dynamically via JS */
}

#cropCanvas {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* ─── Crop Overlay  (FIX: was completely missing) ───────────────────── */
.crop-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none; /* children override this */
}

/* ─── Dark Masks (FIX: was completely missing) ──────────────────────── */
.mask {
  position: absolute;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
/* top / bottom span full width; left/right fill gap between them */
.mask-top    { top: 0; left: 0; right: 0; }
.mask-bottom { bottom: 0; left: 0; right: 0; }
.mask-left   { left: 0; }
.mask-right  { right: 0; }

/* ─── Crop Box ──────────────────────────────────────────────────────── */
.crop-box {
  position: absolute;
  border: 2px solid #fff;
  cursor: move;
  box-sizing: border-box;
  pointer-events: all;
}

/* ─── Grid Lines ────────────────────────────────────────────────────── */
.grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.gl-v, .gl-h {
  position: absolute;
  background: rgba(255,255,255,0.2);
}
.gl-v {
  width: 1px;
  height: 100%;
}
.gl-v:nth-child(1) { left: 33.33%; }
.gl-v:nth-child(2) { left: 66.66%; }
.gl-h {
  width: 100%;
  height: 1px;
}
.gl-h:nth-child(3) { top: 33.33%; }
.gl-h:nth-child(4) { top: 66.66%; }

/* ─── Handles  (FIX: HTML uses .h-nw .h-ne etc., old CSS used .tl .tr) */
.handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--red);
  border-radius: 2px;
  z-index: 10;
  pointer-events: all;
}
/* Corners */
.h-nw { top: -6px;    left: -6px;   cursor: nw-resize; }
.h-ne { top: -6px;    right: -6px;  cursor: ne-resize; }
.h-sw { bottom: -6px; left: -6px;   cursor: sw-resize; }
.h-se { bottom: -6px; right: -6px;  cursor: se-resize; }
/* Edges */
.h-n  { top: -6px;    left: 50%; transform: translateX(-50%); cursor: n-resize; }
.h-s  { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.h-w  { top: 50%;     left: -6px;   transform: translateY(-50%); cursor: w-resize; }
.h-e  { top: 50%;     right: -6px;  transform: translateY(-50%); cursor: e-resize; }

/* ─── Dimensions Label ──────────────────────────────────────────────── */
.crop-dims {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}

/* ─── Output Controls ───────────────────────────────────────────────── */
.output-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.2rem;
  width: 100%;
}

.oc-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.oc-group select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.3rem 0.6rem;
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
}

.oc-group input[type="range"] {
  width: 90px;
  height: 4px;
  -webkit-appearance: none;
  background: var(--surface-3);
  border-radius: 2px;
  cursor: pointer;
}
.oc-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--red);
  border-radius: 50%;
  cursor: pointer;
}

.oc-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.btn-crop {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 0.6rem 1.6rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-crop:hover {
  opacity: 0.85;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(255,0,0,0.3);
}

.btn-reset {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-reset:hover {
  border-color: var(--red);
  background: var(--surface-3);
}

/* ─── Result Area ───────────────────────────────────────────────────── */
.result-area {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
}
@media (max-width: 500px) {
  .preview-grid { grid-template-columns: 1fr; }
}

.preview-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
}
.preview-card.highlight {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red), 0 4px 20px rgba(255,0,0,0.15);
}
.preview-card h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.preview-img-wrap {
  max-height: 220px;
  overflow: hidden;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  margin-bottom: 0.6rem;
}
.preview-img-wrap img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
}
.file-info {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.result-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.btn-download-cropped {
  background: #16a34a;
  color: #fff;
  border: none;
  padding: 0.7rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-download-cropped:hover {
  background: #22c55e;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(34,197,94,0.3);
}

.btn-crop-another {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-crop-another:hover {
  border-color: var(--red);
  background: var(--surface-3);
}

/* ─── History ───────────────────────────────────────────────────────── */
.history-section {
  width: 100%;
  max-width: 600px;
  margin-top: 1rem;
}
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.history-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.history-clear {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.history-clear:hover { border-color: var(--red); color: var(--red); }
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  gap: 0.5rem;
}
.history-filename {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  color: var(--text-muted);
}
.history-dims {
  color: var(--red);
  font-weight: 700;
  white-space: nowrap;
}

/* ─── Error & Back Link ─────────────────────────────────────────────── */
.error-msg {
  color: var(--red);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}
.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.back-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .output-controls { flex-direction: column; align-items: stretch; }
  .oc-actions { margin-left: 0; }
  .btn-crop, .btn-reset { width: 100%; }
  .result-actions { flex-direction: column; }
  .btn-download-cropped,
  .btn-crop-another { width: 100%; text-align: center; }
  .back-link { display: none; }
}

/* --- FROM css/image-resizer.css --- */

/* Image Resizer Styles - Consistent with dark/light theme */

.resizer-hero {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem 3rem;
  position: relative;
}

.resizer-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.3;
  text-align: center;
}

.upload-area {
  width: 100%;
  max-width: 500px;
  min-height: 180px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--red);
  background: var(--surface-3);
}
.upload-content, .upload-loading { text-align: center; padding: 1.5rem; }
.upload-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.upload-text { font-size: 1rem; margin-bottom: 0.25rem; }
.upload-hint { font-size: 0.75rem; color: var(--text-muted); }
.loader { width: 40px; height: 40px; border: 3px solid var(--surface-3); border-top-color: var(--red); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }

.resize-controls {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}
.preset-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  color: aliceblue;
}
.preset-btn:hover {
  border-color: var(--red);
  background: var(--surface-3);
  transform: translateY(-1px);
}
.custom-size {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: flex-end;
}
.size-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-2);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.size-input-group label { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }
.size-input-group input {
  width: 90px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}
.size-input-group .unit { font-size: 0.7rem; color: var(--text-muted); }
.aspect-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}
.format-quality {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.format-quality select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-md);
  color: var(--text);
}
.quality-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.quality-slider-wrapper input[type="range"] {
  width: 120px;
  height: 5px;
  -webkit-appearance: none;
}
.quality-slider-wrapper input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--red);
  border-radius: 50%;
  cursor: pointer;
}
.btn-resize {
  background: var(--red);
  color: white;
  border: none;
  padding: 0.7rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-resize:hover {
  background: var(--red-dim);
  transform: translateY(-2px);
}
.result-area {
  width: 100%;
  max-width: 700px;
  margin-top: 1rem;
}
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.preview-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.8rem;
}
.preview-img-wrap {
  aspect-ratio: 1/1;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
.preview-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.file-size, .dimensions {
  font-size: 0.75rem;
  text-align: center;
  color: var(--text-muted);
}
.savings {
  font-size: 0.8rem;
  text-align: center;
  font-weight: bold;
  color: var(--green);
}
.btn-download-resized {
  display: block;
  width: 100%;
  max-width: 250px;
  margin: 1rem auto 0;
  background: var(--green);
  color: white;
  border: none;
  padding: 0.7rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-download-resized:hover:not(:disabled) {
  background: #22c55e;
  transform: translateY(-2px);
}
.btn-download-resized:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.history-section {
  width: 100%;
  max-width: 500px;
  margin-top: 1.5rem;
}
.history-item {
  display: flex;
  justify-content: space-between;
  background: var(--surface-2);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
}
.history-filename {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.history-dims {
  color: var(--red);
  font-weight: 600;
}
.error-msg {
  color: var(--red);
  font-size: 0.8rem;
  margin-top: 0.5rem;
}
@media (max-width: 600px) {
  .preview-grid { grid-template-columns: 1fr; }
  .custom-size { flex-direction: column; align-items: stretch; }
  .size-input-group { justify-content: space-between; }
  .format-quality { flex-direction: column; align-items: stretch; }
  .back-link { display: none; } /* Mobilde ana sayfa linki gizli */
}
.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.back-link:hover {
  color: var(--text);
  background: var(--surface-2);
}


/* FIX: Scope converter preview grid to avoid 1fr 1fr override */
.converter-hero .preview-grid {
  grid-template-columns: 1fr auto 1fr !important;
}
@media (max-width: 600px) {
  .converter-hero .preview-grid {
    grid-template-columns: 1fr !important;
  }
}
