/* ==========================================================================
   RizeTab — Shared styles (used by root, /tr/, /en/)
   Compiled Tailwind utilities handle layout; this file holds shared components:
   glassmorphism, custom range slider, dropzone states, modal + accordion fx.
   ========================================================================== */

html, body {
  background: #0E1A16;
}

/* Language gateway: center when space allows, flow and scroll on short screens. */
.rt-language-page {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}

:focus-visible {
  outline: 2px solid #4FBE8C;
  outline-offset: 2px;
}

/* ---- Glass panels ---- */
.glass {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* ---- Ambient blobs (signature background element) ---- */
@keyframes rt-float {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(0, -18px); }
}
.rt-blob { animation: rt-float 11s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .rt-blob { animation: none; }
}

/* ---- Dropzone (Image Compressor & future file-based tools) ---- */
.dropzone { transition: border-color .2s ease, background-color .2s ease; }
.dropzone.drag-active {
  border-color: #4FBE8C;
  background-color: rgba(79, 190, 140, 0.08);
}

/* ---- Custom range slider ---- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, #4FBE8C var(--val, 80%), rgba(255,255,255,0.12) var(--val, 80%));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #4FBE8C;
  border: 3px solid #0E1A16;
  box-shadow: 0 0 0 1px rgba(79,190,140,0.5);
  cursor: pointer;
  margin-top: -1px;
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #4FBE8C;
  border: 3px solid #0E1A16;
  cursor: pointer;
}
input[type="range"]:disabled::-webkit-slider-thumb { background: #5b6b65; }

.fmt-btn[aria-pressed="true"] {
  background: rgba(79, 190, 140, 0.12);
  border-color: rgba(79, 190, 140, 0.5);
  color: #4FBE8C;
}

/* ---- Spinner ---- */
@keyframes rt-spin { to { transform: rotate(360deg); } }
.spinner { animation: rt-spin .8s linear infinite; }

/* ---- Tool catalog cards ---- */
.tool-card[data-status="soon"] {
  cursor: not-allowed;
}
.tool-card[data-status="active"]:hover {
  border-color: rgba(79, 190, 140, 0.4);
  transform: translateY(-2px);
}
.tool-card {
  transition: transform .18s ease, border-color .18s ease;
}

/* ---- Category filter pills ---- */
.cat-pill[aria-pressed="true"] {
  background: #4FBE8C;
  color: #0E1A16;
  border-color: #4FBE8C;
}

/* ---- Modal ---- */
.rt-modal-overlay {
  background: rgba(6, 12, 10, 0.72);
  backdrop-filter: blur(4px);
}
.rt-modal-panel {
  animation: rt-modal-in .22s ease-out;
}
@keyframes rt-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .rt-modal-panel { animation: none; }
}

/* ---- Transparency checkerboard (Background Remover previews) ---- */
.bg-checker {
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.06) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: rgba(255,255,255,0.02);
}

/* ---- Before/after comparison slider (Background Remover) ----
   isolation:isolate pins a fresh stacking context on the widget itself, so a parent
   z-index (modal, sticky header, later-added card chrome, etc.) can never sandwich the
   handle between the two images again — the internal z-index values below always win. */
.rt-compare {
  position: relative;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  isolation: isolate;
  contain: layout paint;
  max-width: 100%;
}
.rt-compare img {
  display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none;
  -webkit-user-drag: none;
}
.rt-compare .rt-compare-before,
.rt-compare .rt-compare-after {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.rt-compare .rt-compare-before { z-index: 2; will-change: clip-path; }
.rt-compare .rt-compare-after { overflow: hidden; }
.rt-compare .rt-compare-handle {
  position: absolute; top: 0; bottom: 0; width: 0;
  cursor: ew-resize;
  z-index: 3;
  /* Invisible 32px hit-slop centered on the 2px line — the visible line stays thin,
     but fingers/cursors get a real target instead of missing by a pixel. */
  padding: 0 16px;
  margin-left: -16px;
  box-sizing: content-box;
}
.rt-compare .rt-compare-line {
  position: absolute; top: 0; bottom: 0; left: 16px; width: 2px;
  background: #4FBE8C; box-shadow: 0 0 0 1px rgba(79,190,140,0.35);
  transform: translateX(-1px);
  pointer-events: none;
}
.rt-compare .rt-compare-grip {
  position: absolute; top: 50%; left: 16px; transform: translate(-50%, -50%);
  height: 34px; width: 34px; border-radius: 50%;
  background: #4FBE8C; color: #0E1A16;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  pointer-events: none;
}
.rt-compare .rt-compare-tag {
  position: absolute; bottom: 10px; font-size: 11px; font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase; letter-spacing: 0.04em;
  background: rgba(6,12,10,0.65); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px; padding: 3px 10px; color: #93A79E; pointer-events: none;
  z-index: 4;
}
.rt-compare .rt-compare-tag.rt-tag-before { left: 10px; }
.rt-compare .rt-compare-tag.rt-tag-after { right: 10px; }

/* Below ~380px (small phones inside the tool modal) shrink the grip and tags slightly
   so they don't visually collide with a narrow image frame. */
@media (max-width: 380px) {
  .rt-compare .rt-compare-grip { height: 28px; width: 28px; }
  .rt-compare .rt-compare-tag { font-size: 10px; padding: 2px 8px; bottom: 8px; }
}

/* ---- Custom select (rt-select.js) — shared by İletişim (#cf-topic) and
   File Converter (#rt-fc-mode). Progressively enhances a native <select>:
   if the script fails to load, the native select underneath still works,
   nothing here ever applies, and the page degrades gracefully. ---- */
.rt-select-native-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.rt-select { position: relative; }
.rt-select-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #EAF3EE;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.rt-select-btn:hover { border-color: rgba(79, 190, 140, 0.35); }
.rt-select.is-open .rt-select-btn,
.rt-select-btn:focus-visible {
  border-color: rgba(79, 190, 140, 0.5);
  outline: none;
}
.rt-select-btn-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-select-chevron {
  height: 1rem;
  width: 1rem;
  color: #93A79E;
  flex-shrink: 0;
  transition: transform .18s ease, color .18s ease;
}
.rt-select.is-open .rt-select-chevron { transform: rotate(180deg); color: #4FBE8C; }
.rt-select-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  max-height: 260px;
  overflow-y: auto;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #142722;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 0.375rem;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.rt-select.is-open .rt-select-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .rt-select-panel { transition: none; }
}
.rt-select-option {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #EAF3EE;
  cursor: pointer;
}
.rt-select-option.is-active { background: rgba(79, 190, 140, 0.12); }
.rt-select-option.is-selected { color: #4FBE8C; font-weight: 600; }

/* ---- Skip to content link (WCAG 2.4.1) ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: #4FBE8C;
  color: #0E1A16;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0 0 0.5rem 0;
}
.skip-link:focus {
  left: 0;
}

/* ---- FAQ accordion (native <details>) ---- */
details.faq-item > summary {
  list-style: none;
  cursor: pointer;
}
details.faq-item > summary::-webkit-details-marker { display: none; }
details.faq-item .faq-chevron {
  transition: transform .2s ease;
}
details.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

/* ---- Consent preferences (basic analytics consent; not a certified CMP) ---- */
.rt-consent {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  background: rgba(6, 12, 10, 0.66);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.rt-consent-panel {
  width: min(100%, 46rem);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  background: #142722;
  color: #EAF3EE;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
  padding: 1.25rem;
}
.rt-consent-panel h2 {
  margin: 0 0 .5rem;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
}
.rt-consent-panel > p {
  margin: 0;
  color: #B5C5BD;
  font-size: .9rem;
  line-height: 1.6;
}
.rt-consent-links { margin-top: .6rem !important; }
.rt-consent-links a { color: #7FD1A9; text-decoration: underline; text-underline-offset: 3px; }
.rt-consent-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; margin-top: 1rem; }
.rt-consent-actions button { min-height: 44px; border-radius: .6rem; padding: .65rem 1rem; font-size: .85rem; font-weight: 600; }
.rt-consent-reject { border: 1px solid rgba(255,255,255,.18); color: #EAF3EE; background: transparent; }
.rt-consent-accept { border: 1px solid #4FBE8C; color: #0E1A16; background: #4FBE8C; }

@media (min-width: 640px) {
  .rt-consent { align-items: flex-end; padding: 1.5rem; }
  .rt-consent-panel { padding: 1.5rem; }
}

/* Shared policy/article prose without relying on a typography plugin. */
.rt-prose p, .rt-prose li { color: #B5C5BD; line-height: 1.75; }
.rt-prose p + p { margin-top: 1rem; }
.rt-prose h2 { margin-top: 2.25rem; margin-bottom: .75rem; color: #EAF3EE; font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 1.35rem; font-weight: 600; }
.rt-prose h3 { margin-top: 1.5rem; margin-bottom: .5rem; color: #EAF3EE; font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 1.05rem; font-weight: 600; }
.rt-prose ul, .rt-prose ol { margin-top: .75rem; padding-left: 1.35rem; }
.rt-prose ul { list-style: disc; }
.rt-prose ol { list-style: decimal; }
.rt-prose li + li { margin-top: .45rem; }
.rt-prose a { color: #7FD1A9; text-decoration: underline; text-underline-offset: 3px; }
.rt-prose table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .875rem; }
.rt-prose th, .rt-prose td { border: 1px solid rgba(255,255,255,.12); padding: .7rem; text-align: left; vertical-align: top; }
.rt-prose th { color: #EAF3EE; background: rgba(255,255,255,.04); }
.rt-table-wrap { overflow-x: auto; }
