@font-face {
  font-display: swap;
  font-family: "PT Mono";
  font-style: normal;
  font-weight: 400;
  src: url("pt-mono-v13-latin-regular.woff2") format("woff2");
}

:root {
  --height-top-bar: 60px;
  --height-bottom-bar: 50px;
  --text-xs: clamp(1.11rem, calc(-0.29vw + 1.2rem), 0.79rem);
  --text-s: clamp(1.24rem, calc(-0.18vw + 1.3rem), 1.05rem);
  --text-m: clamp(1.4rem, calc(0vw + 1.4rem), 1.4rem);
  --text-l: clamp(1.57rem, calc(0.27vw + 1.49rem), 1.87rem);
  --text-xl: clamp(1.77rem, calc(0.66vw + 1.56rem), 2.49rem);
  --text-2xl: clamp(1.99rem, calc(1.22vw + 1.6rem), 3.32rem);
  --text-3xl: clamp(2.24rem, calc(2.02vw + 1.6rem), 4.42rem);
  --text-4xl: clamp(2.52rem, calc(3.12vw + 1.52rem), 5.89rem);
  --text-5xl: clamp(2.84rem, calc(4.64vw + 1.35rem), 7.85rem);
}

:root[data-theme="light"] {
  --input-text-color: #000;
  --select-color: #f8f94a;
  --select-text-color: #333;
  --select-hover-color: #f2f3f3;
  --bg-color: #ffffff;
  --bg-topbar-color: #fafafa;
  --text-color: #333;
  --link-color: #020712;
  --link-hover-color: #aeaeae;
  --link-active-color: #fafafa;
  --placeholder-color: #e1e1e1;
  --border-color: #f2f3f3;
  --footer-text-color: #333;
}

:root[data-theme="dark"] {
  --input-text-color: #fff;
  --select-color: #f8f94a;
  --select-text-color: #333;
  --select-hover-color: #1c1c1c;
  --bg-color: #121212;
  --bg-topbar-color: #181818;
  --text-color: #e0e0e0;
  --link-color: #e0e0e0;
  --link-hover-color: #515151;
  --link-active-color: #181818;
  --placeholder-color: #2a2a2a;
  --border-color: #1c1c1c;
  --footer-text-color: #515151;
}

* {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: "PT Mono", monospace;
  font-size: var(--text-m);
  font-weight: 400;
  font-style: normal;
}
html,
body {
  font-size: 62.5%;
  overflow-x: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  height: var(--height-top-bar);
  background-color: var(--bg-topbar-color);
}

.topbar .logo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.topbar .logo a {
  color: var(--link-color);
  text-decoration: none;
}

.topbar .logo a:hover {
  color: var(--link-hover-color);
}

.topbar .theme-toggle svg:hover {
  color: var(--link-hover-color);
}

.theme-toggle {
  cursor: pointer;
}

.sun-icon,
.moon-icon {
  color: var(--text-color);
}

.main {
  display: flex;
  flex-direction: row;
  max-width: 1400px;
  flex: 1;
  margin: 0 auto;
  width: 100%;
}
.main .main__left {
  width: 40px; /* 2.5rem */
  border-right: 1px solid var(--border-color);
  position: relative;
}

.main .main__left::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  background-size: 10px 10px;
  background-image: repeating-linear-gradient(
      315deg,
      var(--border-color) 0px,
      var(--border-color) 1px,
      transparent 0px,
      transparent 7px
    ),
    linear-gradient(
      to right,
      var(--border-color) 0px,
      var(--border-color) 1px,
      transparent 1px
    );
  background-repeat: repeat, repeat-y;
  background-position: right top, left top;
  z-index: -1;
}

.main .main__center {
  flex: 1;
}
.main .main__right {
  width: 40px;
  border-left: 1px solid var(--border-color);
  position: relative;
}
.main .main__right::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 100%;
  background-size: 10px 10px;
  background-image: repeating-linear-gradient(
      315deg,
      var(--border-color) 0px,
      var(--border-color) 1px,
      transparent 0px,
      transparent 7px
    ),
    linear-gradient(
      to left,
      var(--border-color) 0px,
      var(--border-color) 1px,
      transparent 1px
    );
  background-repeat: repeat, repeat-y;
  background-position: right top, right top;
  z-index: -1;
}
.container {
  position: relative;
  width: 100%;
  height: fit-content;
}
.container::after {
  content: "";
  width: 200vw;
  left: -100vw;
  bottom: 0;
  height: 1px;
  display: block;
  position: absolute;
  background-color: var(--border-color);
}

.header {
  padding: 15px 20px; /* poprawić */
  padding-top: 10vh;

  h1 {
    font-size: var(--text-2xl);
    padding-bottom: 5px;
  }

  p {
    font-size: var(--text-m);
  }
}

nav.container {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.navigation {
  display: flex;
  flex-direction: row;
}

.navigation a {
  text-transform: uppercase;
  display: block;
  border-right: 1px solid var(--border-color);
  padding: 15px 20px;
  text-decoration: none;
  color: var(--link-color);
}

.navigation a:hover {
  background-color: var(--select-hover-color);
}

.navigation .active {
  background-color: var(--link-active-color);
}

nav.container.special .navigation:last-child a {
  border-right: none;
  border-left: 1px solid var(--border-color);
}

.content-input {
  display: flex;
  width: 100%;
  overflow: hidden;
}

.content-input input {
  flex: 1;
  font-size: var(--text-5xl);
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: none;
  outline: none;
  background: var(--bg-color);
  color: var(--input-text-color);
  border-radius: 0;
  background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
  background-size: 10px 10px;
  background-position: left top;
}

.content-input input:first-of-type {
  border-right: 1px solid var(--border-color);
}

.content-input input::placeholder {
  color: var(--placeholder-color);
}

.content-select {
  display: flex;
}

.content-select select {
  flex: 1;
}

.content-select select:first-of-type {
  border-right: 1px solid var(--border-color);
}

select.form-select {
  border: none;
  outline: none;
  background: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  scrollbar-width: none;
}

select.form-select::-webkit-scrollbar {
  display: none;
}

select.form-select option {
  padding: 5px 10px;
  cursor: pointer;
  color: var(--text-color);
}

select.form-select option:hover {
  background-color: var(--select-hover-color);
}
select.form-select option:checked {
  background-color: var(--select-color);
  color: var(--select-text-color);
}

.factor {
  display: flex;
  justify-content: center;
  padding: 15px 20px;
}

.bottombar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  border-top: 1px solid var(--border-color);
  height: var(--height-bottom-bar);
  margin-top: -1px;
}

.footer {
  text-align: center;
  color: var(--footer-text-color);
  font-size: var(--text-s);
}

.converter-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.converter-card {
  flex: 1;
  border-right: 1px solid var(--border-color);
  padding: 2rem;
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease;
}

.converter-card:hover {
  background-color: var(--select-hover-color);
}

.converter-card * {
  transition: all 0.3s ease;
}

.converter-card:last-of-type {
  border: none;
}

.converter-card h2 {
  color: var(--text-color);
  margin-bottom: 1rem;
  font-size: var(--text-l);
  display: block;
}

.converter-card svg {
  fill: var(--text-color);
  margin-bottom: 1rem;
}

.converter-card p {
  color: var(--text-color);
  padding-bottom: 1.5rem;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 0;
}

.converter-link {
  display: inline-block;
  color: var(--text-color);
  text-decoration: underline;
  align-self: flex-start;
}

/* Media query dla lepszej responsywności */
@media (max-width: 768px) {
  .topbar {
    padding: 1.5rem;
  }
  .converter-card {
    flex: 1 1 100%;
    max-width: none;
    border-bottom: 1px solid var(--border-color);
    border-right: none;
  }
  .footer {
    padding: 1.5rem;
  }
}
