@import url('https://fonts.googleapis.com/css2?family=Roboto+Serif:opsz,wdth@8..144,87.5&display=swap');

:root {
  --bg: #0f1221;
  --body-bg: #0b0f1d;
  --panel: #14182b;
  --muted: #b2b5b2;
  --txt: #f5f5f5;
  --brand: #7dd3fc;
  --brand-2: #60a5fa;
  --ok: #22c55e;
  --warn: #f7cc0f;
  --err: #ef4a0f;
  --radius: 18px;
  --gap: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* Using Roboto Serif Google font */
  font-family: 'Roboto Serif', serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings: 'wdth' 87.5, 'GRAD' 0;
}

html,
body {
  height: 100%;
}

body {
  background: linear-gradient(225deg, var(--body-bg), var(--bg));
  color: var(--txt);
}

header {
  padding: 1rem;
  background: linear-gradient(
    90deg,
    rgba(5, 5, 221, 0.15),
    rgba(4, 162, 240, 0.1)
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.container {
  max-width: 90vw;
  padding: 0.875rem;
  /* border: 1px solid red; */
  margin: 0 auto;
}

.brand {
  /* border: 1px solid white; */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  font-weight: 800;
  gap: 0.625rem;
}

.brand .logo {
  /* `inline-size`:  defines the size of an element along the inline axis, which is the direction in which text flows within a line. 
  `horizontal writing mode`: (e.g., English, where text flows left-to-right), inline-size corresponds to the width of the element. 
  `vertical writing mode`: (e.g., some East Asian languages, where text flows top-to-bottom), inline-size corresponds to the height of the element. 
  `block-size`: defines the size of an element along the block axis, which is the direction perpendicular to the inline axis.
  `horizontal writing mode`: block-size represents the height
  `vertical writing mode`: block-size represents the width
  */
  inline-size: 3.25rem;
  block-size: 3.25rem;
  border-radius: 2px;
  background: url('../assets/logo.png') center / cover no-repeat;
}

.title {
  /* clamp(min_val, preferred_val, max_val) - the property will never be less than the `min_val`, will try to be in `preferred_val` if it falls inside of the range and will never be maximum than `max_val` */
  font-size: clamp(18px, 2vw, 32px);
}

main {
  max-width: 1516px;
  /* min-height: 70vh; */
  margin: 0 auto;
  padding: 0.875rem;
  /* `grid` is suitable for designing & structuring 2D layouts in CSS */
  display: grid;
  /* grid-template-columns: 17.5rem 1fr 22.5rem; */
  grid-template-columns: 0.55fr 1.8fr 0.65fr;
  gap: var(--gap);
  /* border: 1px solid white; */
}

/* If the max-width available is 1100px or less then everyone gets full width available in case of `aside`, `section` & `aside` inside of `main` */
@media (max-width: 1100px) {
  main {
    grid-template-columns: 1fr;
  }
}

.card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.03)
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  box-shadow: 5px 10px 30px rgba(0, 0, 0, 0.25);
}

.panel {
  padding: 1rem;
}

h2,
h3 {
  margin: 0 0 0.35rem;
}

.muted {
  color: var(--muted);
  font-size: 0.8125rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.row {
  display: flex;
  gap: var(--gap);
  justify-content: space-around;
  align-items: center;
  /* If the page is resized then the flex elements will wrap, ie, go to the next line, making our layout more responsive & mobile-friendly */
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: none;
  background: linear-gradient(45deg, var(--brand-2), var(--brand));
  color: #0b0f1d;
  font-weight: 800;
  padding: 0.625rem 0.875rem;
  border: 1px solid rgb(11, 5, 76);
  border-radius: 8px;
  box-shadow: 5px 7px 14px rgba(96, 122, 251, 0.65);
  cursor: pointer;
}

.btn.secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--txt);
  box-shadow: none;
}

.btn.warn {
  background: linear-gradient(45deg, #f59e0b, #eab308);
}

.btn.ok {
  background: linear-gradient(45deg, #27ae02, #80f763);
}

.btn.err {
  background: linear-gradient(45deg, #ea0388, #ff0f0a);
}

.select,
select,
.text {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  color: var(--txt);
  cursor: pointer;
  padding: 0.75rem 0.825rem;
}

.select::placeholder,
select::placeholder,
.text::placeholder {
  color: var(--warn);
}

textarea.text {
  width: 100%;
  min-height: 7.5rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  /* justify-content: space-around; */
}

.tab {
  padding: 0.625rem 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  font-weight: 900;
  color: var(--txt);
  cursor: pointer;
}

.tab.active {
  background: linear-gradient(
    45deg,
    rgba(125, 242, 252, 0.25),
    rgba(96, 95, 255, 0.04)
  );
  color: #00ff00 !important;
}

.editor-wrap {
  /* the element will be positioned relatively with respect to the page or the surrounding elements */
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  /* we do not want the code we write inside the editor to flow out of the space given for the editor. So, we use `overflow: hidden`. Unlike `overflow: scroll` or `overflow: auto` this does not display scrollbars and cuts the content at the edges of the element's padding box */
  overflow: hidden;
  min-height: 17.5rem;
  background: #0b1020;
}

.editor {
  inline-size: 100%;
  block-size: 23.75rem;
}

iframe.preview {
  inline-size: 100%;
  block-size: 23.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: #fff;
}

.out {
  position: relative;
  overflow: auto; /* displays scrollbars only if the content overflows the element */
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px;
  min-height: 10rem;
  background: #0a0e1a;
  /* whitespace characters (space, tab, newlines) are preserved, meaning, not collapsed into a single space character. Text wraps automatically to fill the line box, in addition to breaking at newline characters and <br> elements. */
  white-space: pre-wrap;
}

.footer {
  text-align: center;
  padding: 0.75rem;
  font-size: 1.125rem;
}

.kbd {
  font-family: SFMono-Regular, monospace, Menlo, Consolas;
  background-color: #0e1324;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.25rem 0.375rem;
}

main aside div.muted {
  line-height: 2;
}

.label {
  font-size: 0.875rem;
  color: var(--muted);
}
