/* --------------------------------------------------------------- fonty ---
   Te same pliki, których używał next/font (Geist, subset latin) — lokalnie,
   więc strona działa również bez internetu.                                */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/geist-latin.woff2') format('woff2');
  unicode-range: u+00??, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc,
    u+0304, u+0308, u+0329, u+2000-206f, u+20ac, u+2122, u+2191, u+2193, u+2212,
    u+2215, u+feff, u+fffd;
}

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/geist-latin-ext.woff2') format('woff2');
  unicode-range: u+0100-02ba, u+02bd-02c5, u+02c7-02cc, u+02ce-02d7, u+02dd-02ff,
    u+0304, u+0308, u+0329, u+1d00-1dbf, u+1e00-1e9f, u+1ef2-1eff, u+2020,
    u+20a0-20ab, u+20ad-20c0, u+2113, u+2c60-2c7f, u+a720-a7ff;
}

@font-face {
  font-family: 'Geist Fallback';
  src: local('Arial');
  ascent-override: 95.94%;
  descent-override: 28.16%;
  line-gap-override: 0%;
  size-adjust: 104.76%;
}

/* ============================================================================
   styles.css — odpowiednik Tailwind + shadcn/ui z oryginału (Next.js).
   Zmienne kolorów 1:1 z src/app/globals.css (motyw jasny + .dark).
   ========================================================================= */

:root {
  --background: 0 0% 98%;
  --foreground: 0 0% 20%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 20%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 20%;
  --primary: 180 100% 25.1%;
  --primary-foreground: 0 0% 98%;
  --secondary: 0 0% 92%;
  --secondary-foreground: 0 0% 20%;
  --muted: 0 0% 90%;
  --muted-foreground: 0 0% 45.1%;
  --accent: 180 100% 25.1%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 0 0% 88%;
  --input: 0 0% 88%;
  --ring: 180 100% 30.1%;
  --radius: 0.5rem;

  /* globals.css: body { font-family: var(--font-geist-sans); } */
  --font-sans: 'Geist', 'Geist Fallback', ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    'Liberation Mono', 'Courier New', monospace;
}

.dark {
  --background: 220 10% 10%;
  --foreground: 0 0% 95%;
  --card: 220 10% 12%;
  --card-foreground: 0 0% 95%;
  --popover: 220 10% 10%;
  --popover-foreground: 0 0% 95%;
  --primary: 180 70% 50%;
  --primary-foreground: 0 0% 10%;
  --secondary: 220 10% 18%;
  --secondary-foreground: 0 0% 95%;
  --muted: 220 10% 18%;
  --muted-foreground: 0 0% 60%;
  --accent: 180 70% 50%;
  --accent-foreground: 0 0% 10%;
  --destructive: 0 70% 50%;
  --destructive-foreground: 0 0% 98%;
  --border: 220 10% 20%;
  --input: 220 10% 20%;
  --ring: 180 70% 55%;
}

/* --------------------------------------------------------------- reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid hsl(var(--border));
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
pre,
ul {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

ul {
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
  font-size: 100%;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
  background-color: transparent;
  cursor: pointer;
}

svg {
  display: block;
  flex-shrink: 0;
}

[hidden] {
  display: none !important;
}

/* ----------------------------------------------------------- layout ----- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

/* flex items-center justify-between p-3 md:p-4 border-b bg-card shadow-sm h-16 shrink-0 */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  height: 4rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .app-header {
    padding: 1rem;
  }
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-code {
  height: 1.5rem;
  width: 1.5rem;
  color: hsl(var(--primary));
}

.header-title {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .icon-code {
    height: 1.75rem;
    width: 1.75rem;
  }
  .header-title {
    font-size: 1.25rem;
  }
  .header-actions {
    gap: 0.75rem;
  }
}

.app-main {
  flex-grow: 1;
  overflow: hidden;
}

/* ------------------------------------------- ResizablePanelGroup -------- */
.panel-group {
  display: flex;
  height: 100%;
  width: 100%;
}

.panel {
  overflow: hidden;
}

.resize-handle {
  position: relative;
  display: flex;
  width: 1px;
  align-items: center;
  justify-content: center;
  background-color: hsl(var(--border));
  cursor: col-resize;
  outline: none;
  flex-shrink: 0;
}

.resize-handle::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 0.25rem;
  transform: translateX(-50%);
}

.resize-grip {
  z-index: 10;
  display: flex;
  height: 1rem;
  width: 0.75rem;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--border));
}

.resize-grip svg {
  height: 0.625rem;
  width: 0.625rem;
}

/* -------------------------------------------------------- edytor -------- */
.editor-wrapper {
  height: 100%;
  padding: 0.375rem;
  padding-top: 0;
}

.editor-shell {
  position: relative;
  height: 100%;
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.monaco-host {
  height: 100%;
  width: 100%;
}

.editor-skeleton {
  position: absolute;
  inset: 0;
}

.skeleton {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--muted));
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ------------------------------------------------------ ResultsPanel ---- */
.results-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.375rem;
  padding-left: 0;
}

.results-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: hsl(var(--card));
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.tabs {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 0.75rem;
  min-height: 0;
}

/* grid w-full grid-cols-3 mb-3 shrink-0 + TabsList */
.tabs-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--muted));
  padding: 0.25rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.tabs-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 4px);
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.tabs-trigger.is-active {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.scroll-area {
  flex-grow: 1;
  overflow-y: auto;
  min-height: 0;
}

.tabs-content {
  outline: none;
}

.tabs-content:not(.is-active) {
  display: none;
}

/* --------------------------------------------------------------- card --- */
.card {
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.card + .card {
  margin-top: 1rem;
}

.card-header {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  padding-bottom: 0.75rem;
}

.card-header-full {
  padding-bottom: 1.5rem;
}

.card-header > * + * {
  margin-top: 0.375rem;
}

.card-header-row {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-header-row > * + * {
  margin-top: 0;
}

@media (min-width: 640px) {
  .card-header-row {
    align-items: center;
  }
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-title-row svg {
  height: 1.25rem;
  width: 1.25rem;
  color: hsl(var(--primary));
}

.card-title {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.card-description {
  font-size: 0.75rem;
  line-height: 1rem;
  color: hsl(var(--muted-foreground));
  padding-top: 0.25rem;
  padding-left: 2rem;
}

.card-content {
  padding: 0 1.5rem 1.5rem;
}

.card-content-indent {
  padding-left: 2rem;
}

.result-pre {
  white-space: pre-wrap;
  font-size: 0.75rem;
  line-height: 1.625;
  font-family: var(--font-mono);
  background-color: hsl(var(--muted));
  padding: 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--foreground));
}

.result-pre-lg {
  padding: 1rem;
}

@media (min-width: 768px) {
  .result-pre {
    font-size: 0.875rem;
  }
}

.result-empty {
  font-size: 0.75rem;
  line-height: 1rem;
  color: hsl(var(--muted-foreground));
}

@media (min-width: 768px) {
  .result-empty {
    font-size: 0.875rem;
  }
}

/* ------------------------------------------------------- pusty stan ----- */
.empty-state {
  text-align: center;
  color: hsl(var(--muted-foreground));
  padding: 2.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-state svg {
  height: 3rem;
  width: 3rem;
  margin-bottom: 1rem;
  color: hsl(var(--primary));
}

.empty-title {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 500;
}

.empty-text {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* ------------------------------------------------------------ button --- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  outline: none;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.button svg {
  height: 1rem;
  width: 1rem;
  pointer-events: none;
}

.button:focus-visible {
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.button:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.button-default {
  height: 2.5rem;
  padding: 0.5rem 1rem;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.button-default:hover {
  background-color: hsl(var(--primary) / 0.9);
}

.button-outline {
  height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
}

.button-outline:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.button-ghost:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.button-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  flex-shrink: 0;
}

.button-destructive:hover {
  background-color: hsl(var(--destructive) / 0.9);
}

.button-destructive svg {
  margin-right: 0.25rem;
}

@media (min-width: 640px) {
  .button-destructive svg {
    margin-right: 0.5rem;
  }
}

/* text-xs md:text-sm px-2 md:px-3 */
.button-header {
  font-size: 0.75rem;
  line-height: 1rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.button-header svg {
  margin-right: 0.25rem;
}

.button-header .button-label {
  display: none;
}

@media (min-width: 640px) {
  .button-header .button-label {
    display: inline;
  }
}

@media (min-width: 768px) {
  .button-header {
    font-size: 0.875rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .button-header svg {
    margin-right: 0.5rem;
  }
}

.button-theme {
  position: relative;
  height: 2rem;
  width: 2rem;
}

@media (min-width: 768px) {
  .button-theme {
    height: 2.25rem;
    width: 2.25rem;
  }
}

.button-theme svg {
  transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-moon {
  position: absolute;
  transform: rotate(90deg) scale(0);
}

.dark .icon-sun {
  transform: rotate(-90deg) scale(0);
}

.dark .icon-moon {
  transform: rotate(0) scale(1);
}

.button-load {
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

.button-load svg {
  margin-right: 0.25rem;
}

.button-dialog {
  height: 2.5rem;
  padding: 0.5rem 1rem;
}

/* ------------------------------------------------------------ select --- */
.select {
  position: relative;
}

.select-trigger {
  display: flex;
  height: 2.5rem;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1rem;
  outline: none;
}

.select-trigger-language {
  width: 120px;
}

@media (min-width: 768px) {
  .select-trigger-language {
    width: 150px;
    font-size: 0.875rem;
    line-height: 1.25rem;
  }
}

.select-trigger:focus-visible {
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.select-chevron {
  height: 1rem;
  width: 1rem;
  opacity: 0.5;
}

.select-content {
  position: absolute;
  z-index: 50;
  top: calc(100% + 0.25rem);
  left: 0;
  min-width: 100%;
  max-height: 24rem;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  animation: select-in 150ms ease-out;
}

@keyframes select-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-0.5rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.select-viewport {
  padding: 0.25rem;
}

.select-item {
  position: relative;
  display: flex;
  width: 100%;
  cursor: default;
  user-select: none;
  align-items: center;
  border-radius: calc(var(--radius) - 4px);
  padding: 0.375rem 0.5rem 0.375rem 2rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  outline: none;
  white-space: nowrap;
}

.select-item:hover,
.select-item.is-active {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.select-item-indicator {
  position: absolute;
  left: 0.5rem;
  display: flex;
  height: 0.875rem;
  width: 0.875rem;
  align-items: center;
  justify-content: center;
}

.select-item-indicator svg {
  height: 1rem;
  width: 1rem;
  visibility: hidden;
}

.select-item.is-selected .select-item-indicator svg {
  visibility: visible;
}

/* ------------------------------------------------------------- badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid transparent;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-default {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.badge-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

/* ----------------------------------------------------------- historia -- */
.history-list > li + li {
  margin-top: 0.5rem;
}

.history-item {
  padding: 0.625rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item:hover {
  background-color: hsl(var(--muted) / 0.5);
}

.history-row {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .history-row {
    flex-direction: row;
    align-items: center;
  }
}

.history-main {
  flex-grow: 1;
  overflow: hidden;
}

.history-date {
  font-size: 0.75rem;
  line-height: 1rem;
  color: hsl(var(--muted-foreground));
  display: block;
  margin-bottom: 0.125rem;
}

.history-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.history-scroll {
  height: 400px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* ----------------------------------------------------- AlertDialog ----- */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlay-in 150ms ease-out;
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dialog-content {
  width: 100%;
  max-width: 32rem;
  display: grid;
  gap: 1rem;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border-radius: var(--radius);
  animation: dialog-in 150ms ease-out;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dialog-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
}

@media (min-width: 640px) {
  .dialog-header {
    text-align: left;
  }
}

.dialog-title {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
}

.dialog-description {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

.dialog-footer {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .dialog-footer {
    flex-direction: row;
    justify-content: flex-end;
    gap: 0.5rem;
  }
}

/* -------------------------------------------------------------- toast -- */
.toast-viewport {
  position: fixed;
  top: 0;
  z-index: 100;
  display: flex;
  max-height: 100vh;
  width: 100%;
  flex-direction: column-reverse;
  padding: 1rem;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .toast-viewport {
    bottom: 0;
    right: 0;
    top: auto;
    flex-direction: column;
  }
}

@media (min-width: 768px) {
  .toast-viewport {
    max-width: 420px;
  }
}

.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  padding: 1.5rem 2rem 1.5rem 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  animation: toast-in 150ms ease-out;
}

.toast > * + * {
  margin-left: 1rem;
}

.toast.is-destructive {
  border-color: hsl(var(--destructive));
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.toast.is-closing {
  animation: toast-out 150ms ease-in forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast-body > * + * {
  margin-top: 0.25rem;
}

.toast-title {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
}

.toast-description {
  font-size: 0.875rem;
  line-height: 1.25rem;
  opacity: 0.9;
}

.toast-close {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.25rem;
  color: hsl(var(--foreground) / 0.5);
  opacity: 0;
  transition: opacity 150ms, color 150ms;
}

.toast:hover .toast-close {
  opacity: 1;
}

.toast-close:hover {
  color: hsl(var(--foreground));
}

.toast.is-destructive .toast-close {
  color: rgb(252 165 165);
}

.toast-close svg {
  height: 1rem;
  width: 1rem;
}
