@import '~flickity/css/flickity';

/* Variables */
:root {
  --color-primary-blue: rgb(0, 91, 152);
  --color-light-gray-1: rgb(240, 240, 240);
  --color-light-gray-2: rgb(220, 220, 220);
  --color-highlight-red: rgb(255, 220, 204);
  --color-highlight-blue: rgb(205, 224, 255);
  --color-highlight-green: rgb(221, 255, 226);
}

/* Full page */
body {
  margin: 0;
  padding: 0;
  font-family: "Haas Grot Text R Web", "Helvetica Neue", Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}
main {
  width: 80%;
  margin: auto;
}
svg {
  /* Should always be in a button, makes targeting easier */
  pointer-events: none;
}

h1 {
  margin: 20px 0 10px 0;
}
h3 {
  margin-bottom: 0;
}

nav {
  display: flex;
  flex-wrap: wrap;
}
header > nav > a {
  display: block;
  text-decoration: none;
  color: inherit;
  margin-top: 5px;
  margin-bottom: 5px;
}
nav > a:hover {
  background-color: var(--color-light-gray-1);
}

/* Code Carousel with Flickity */
.code-carousel {
  margin-left: -10vw;
  width: 100vw;
}
.flickity-button:disabled {
  /* Prevents accidental events on clickable elements underneath arrows */
  pointer-events: initial;
}
.flickity-page-dots {
  bottom: -15px;
}
.flickity-prev-next-button.previous {
  left: 5px;
}
.flickity-prev-next-button.next {
  right: 5px;
}

/* Code Carousel Details */
.code-carousel figure {
  margin: 10px;
}
.code-carousel figure:first-child {
  padding-left: 10vw;
}
.code-carousel figure:last-child {
  padding-right: 10vw;
}
.code-carousel figure .code-card {
  display: flex;
  flex-direction: column;
  width: 310px;
  height: 235px;
  background-color: var(--color-light-gray-1);
  border-radius: 15px;
}
.code-card .code-card-header {
  background-color: var(--color-light-gray-2);
  padding: 10px 10px 5px 10px;
  border-radius: 10px 10px 0 0;
  flex: 0 1 auto;
}
.code-card pre {
  flex: 0 1 auto;
  padding: 5px 10px 0 10px;
  margin: 0;
}
.code-card pre code {
  background-color: inherit;
  padding: 0;
  line-height: 18px;
}
.code-card .buttons {
  flex: 1 1 auto;
  align-self: center;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: flex-end;
  margin-bottom: 15px;
}
.code-card .buttons button,
nav a {
  display: inline-block;
  margin-right: 8px;
  border-radius: 8px;
  padding: 8px;
  background-color: var(--color-light-gray-2);
  border-width: 0;
  cursor: pointer;
}
/* .code-card .buttons button:hover {
  background-color: white;
} */
.code-card .buttons button.run {
  font-weight: 900;
  color: rgb(255, 255, 255);
  background-color: var(--color-primary-blue);
}
.code-card .buttons button:hover {
  filter: brightness(140%);
}
.code-card .buttons button:first-child {
  margin-left: 15px;
  margin-right: auto;
}
.code-card .buttons button:last-child {
  margin-right: 15px;
}

/* Highlight.js */
.hljs-title {
  color: var(--color-primary-blue);
  font-weight: 600;
}
.hljs-string {
  color: rgb(0, 0, 0);
}
.hljs-string .selector {
  font-style: italic;
  color: rgb(90, 90, 90);
}
.hljs-string:hover .action-keyword {
  background-color: var(--color-highlight-red);
  cursor: pointer;
}
.hljs-string:hover .selector {
  background-color: var(--color-highlight-blue);
  cursor: pointer;
  font-style: italic;
}
.hljs-string:hover .argument {
  background-color: var(--color-highlight-green);
  cursor: pointer;
}
.hljs-string .action-keyword.initial-highlight {
  background-color: var(--color-highlight-red);
  cursor: pointer;
}
.hljs-string .selector.initial-highlight {
  background-color: var(--color-highlight-blue);
  cursor: pointer;
  font-style: italic;
}
.hljs-string .argument.initial-highlight {
  background-color: var(--color-highlight-green);
  cursor: pointer;
}

.hljs-attr {
  color: var(--color-primary-blue);
}

/* CSS */
.button-2 {
  background-color: rgba(51, 51, 51, 0.05);
  border-radius: 8px;
  border-width: 0;
  color: #333333;
  cursor: pointer;
  display: inline-block;
  font-family: "Haas Grot Text R Web", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  list-style: none;
  margin: 0;
  padding: 10px 12px;
  text-align: center;
  transition: all 200ms;
  vertical-align: baseline;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* Scroll Bar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #ececec;
}
::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Mock Application */
.mock-app-columns {
  display: flex;
  flex-direction: row;
  gap: 15px;
  flex-wrap: wrap;
}
.mock-app .code-card {
  flex: 0 1 250px;
  display: flex;
  flex-direction: column;
  background-color: var(--color-light-gray-1);
  border-radius: 15px;
  min-width: 160px;
}
.mock-app .code-card-header {
  background-color: var(--color-light-gray-2);
  padding: 10px 10px 5px 10px;
  border-radius: 10px 10px 0 0;
  flex: 0 1 auto;
}
.mock-app .code-card-content {
  padding: 5px 10px 10px 10px;
  flex: 1 0 auto;
}
.mock-app .code-card-inputs {
  min-height: 80px;
}
.mock-app .code-card-inputs p {
  margin-top: 5px;
  margin-bottom: 5px;
}
.mock-app .count {
  width: 62px;
}
.mock-app .code-card .output,
.mock-app .code-card .result {
  white-space: break-spaces;
  overflow-x: auto;
  word-wrap: break-word;
  display: block;
  padding: 5px;
  background-color: white;
  margin-top: 5px;
  min-height: 19px;
}

pre.output-duplicate {
  white-space: pre-wrap;
  word-wrap: break-word;
}
.mock-app label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 5px;
}

@media (max-width: 1024px) {
  main {
    width: calc(100vw - 30px);
  }

  .code-carousel {
    margin-left: -15px;
    width: 100vw;
  }

  .code-carousel figure:first-child {
    padding-left: 15px;
  }

  .code-carousel figure:last-child {
    padding-right: 15px;
  }
  
}