// Copyright (c) 2023-2024 FlyByWire Simulations
// SPDX-License-Identifier: GPL-3.0

@tailwind base;
@tailwind components;
@tailwind utilities;

/*
  Custom CSS for a32nx [EFB]
*/

@layer base {
  @font-face {
    font-family: "JetBrains Mono";
    font-weight: 300;
    src: url("#{$font-file-path}/JetBrainsMono-Regular.ttf") format("truetype");
  }

  @font-face {
    font-family: "Inter";
    font-weight: 400;
    src: url("#{$font-file-path}/Inter-Regular.ttf") format("truetype");
  }
  @font-face {
    font-family: "Inter";
    font-weight: 600;
    src: url("#{$font-file-path}/Inter-SemiBold.ttf") format("truetype");
  }

  @font-face {
    font-family: "Manrope";
    font-weight: 300;
    src: url("#{$font-file-path}/Manrope-Light.ttf") format("truetype");
  }
  @font-face {
    font-family: "Manrope";
    font-weight: 400;
    src: url("#{$font-file-path}/Manrope-Regular.ttf") format("truetype");
  }
  @font-face {
    font-family: "Manrope";
    font-weight: 500;
    src: url("#{$font-file-path}/Manrope-Medium.ttf") format("truetype");
  }
  @font-face {
    font-family: "Manrope";
    font-weight: 600;
    src: url("#{$font-file-path}/Manrope-SemiBold.ttf") format("truetype");
  }
  @font-face {
    font-family: "Manrope";
    font-weight: 700;
    src: url("#{$font-file-path}/Manrope-Bold.ttf") format("truetype");
  }

  @font-face {
    font-family: "AirbusRMP";
    font-weight: 900;
    src: url("#{$font-file-path}/AirbusRMP.ttf") format("truetype");
  }

  // Korean
  @font-face {
    font-family: "NotoSansKR";
    font-weight: 300;
    src: url("#{$font-file-path}/NotoSansKR-Light.otf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansKR";
    font-weight: 400;
    src: url("#{$font-file-path}/NotoSansKR-Regular.otf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansKR";
    font-weight: 500;
    src: url("#{$font-file-path}/NotoSansKR-Medium.otf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansKR";
    font-weight: 600;
    src: url("#{$font-file-path}/NotoSansKR-Bold.otf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansKR";
    font-weight: 700;
    src: url("#{$font-file-path}/NotoSansKR-Bold.otf") format("truetype");
  }

  // Japanese
  @font-face {
    font-family: "NotoSansJP";
    font-weight: 300;
    src: url("#{$font-file-path}/NotoSansJP-Light.otf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansJP";
    font-weight: 400;
    src: url("#{$font-file-path}/NotoSansJP-Regular.otf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansJP";
    font-weight: 500;
    src: url("#{$font-file-path}/NotoSansJP-Medium.otf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansJP";
    font-weight: 600;
    src: url("#{$font-file-path}/NotoSansJP-Bold.otf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansJP";
    font-weight: 700;
    src: url("#{$font-file-path}/NotoSansJP-Bold.otf") format("truetype");
  }

  // Simplified Chinese
  @font-face {
    font-family: "NotoSansSC";
    font-weight: 300;
    src: url("#{$font-file-path}/NotoSansSC-Light.otf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansSC";
    font-weight: 400;
    src: url("#{$font-file-path}/NotoSansSC-Regular.otf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansSC";
    font-weight: 500;
    src: url("#{$font-file-path}/NotoSansSC-Medium.otf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansSC";
    font-weight: 600;
    src: url("#{$font-file-path}/NotoSansSC-Bold.otf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansSC";
    font-weight: 700;
    src: url("#{$font-file-path}/NotoSansSC-Bold.otf") format("truetype");
  }

  // Arabic
  @font-face {
    font-family: "NotoSansArabic";
    font-weight: 300;
    src: url("#{$font-file-path}/NotoSansArabic-Light.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansArabic";
    font-weight: 400;
    src: url("#{$font-file-path}/NotoSansArabic-Regular.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansArabic";
    font-weight: 500;
    src: url("#{$font-file-path}/NotoSansArabic-Medium.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansArabic";
    font-weight: 600;
    src: url("#{$font-file-path}/NotoSansArabic-SemiBold.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansArabic";
    font-weight: 700;
    src: url("#{$font-file-path}/NotoSansArabic-Bold.ttf") format("truetype");
  }

  // Thai
  @font-face {
    font-family: "NotoSansThai";
    font-weight: 300;
    src: url("#{$font-file-path}/NotoSansThai-Light.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansThai";
    font-weight: 400;
    src: url("#{$font-file-path}/NotoSansThai-Regular.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansThai";
    font-weight: 500;
    src: url("#{$font-file-path}/NotoSansThai-Medium.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansThai";
    font-weight: 600;
    src: url("#{$font-file-path}/NotoSansThai-SemiBold.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansThai";
    font-weight: 700;
    src: url("#{$font-file-path}/NotoSansThai-Bold.ttf") format("truetype");
  }

  // Hebrew
  @font-face {
    font-family: "NotoSansHebrew";
    font-weight: 300;
    src: url("#{$font-file-path}/NotoSansHebrew-Light.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansHebrew";
    font-weight: 400;
    src: url("#{$font-file-path}/NotoSansHebrew-Regular.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansHebrew";
    font-weight: 500;
    src: url("#{$font-file-path}/NotoSansHebrew-Medium.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansHebrew";
    font-weight: 600;
    src: url("#{$font-file-path}/NotoSansHebrew-SemiBold.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansHebrew";
    font-weight: 700;
    src: url("#{$font-file-path}/NotoSansHebrew-Bold.ttf") format("truetype");
  }

  // Hindi
  @font-face {
    font-family: "NotoSansDevanagari";
    font-weight: 300;
    src: url("#{$font-file-path}/NotoSansDevanagari-Light.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansDevanagari";
    font-weight: 400;
    src: url("#{$font-file-path}/NotoSansDevanagari-Regular.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansDevanagari";
    font-weight: 500;
    src: url("#{$font-file-path}/NotoSansDevanagari-Medium.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansDevanagari";
    font-weight: 600;
    src: url("#{$font-file-path}/NotoSansDevanagari-SemiBold.ttf") format("truetype");
  }
  @font-face {
    font-family: "NotoSansDevanagari";
    font-weight: 700;
    src: url("#{$font-file-path}/NotoSansDevanagari-Bold.ttf") format("truetype");
  }

  @font-face {
    src: url("#{$font-file-path}/HoneywellMCDU.ttf") format("truetype");
    font-family: "HoneywellMCDU";
    font-style: normal;
    font-weight: 900;
  }

  @font-face {
    src: url("#{$font-file-path}/HoneywellMCDUSmall.ttf") format("truetype");
    font-family: "HoneywellMCDUSmall";
    font-style: normal;
    font-weight: 900;
  }

  html body {
    @apply font-body;
  }

  h1, h2, h3, h4, h5, h6 {
    @apply font-title text-theme-text;
  }

  h1 {
    @apply text-3xl;
  }

  h2 {
    @apply text-2xl;
  }

  h3, h4, h5, h6 {
    @apply text-xl;
  }

  p, div, a, span, button {
    @apply text-xl text-theme-text;
  }

  ul {
    @apply list-disc pl-12;
  }
}

/* ---- Global Scrollbar ---- */

.scrollbar::-webkit-scrollbar {
  @apply rounded-md w-6 bg-theme-secondary;
}

.scrollbar::-webkit-scrollbar-track {
  @apply rounded-md bg-theme-secondary;
}

.scrollbar::-webkit-scrollbar-thumb {
  @apply rounded-md bg-theme-accent;

  &:hover {
    @apply bg-theme-highlight;
  }
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ---- Dashboard UtilComponents ---- */

.flip-horizontal {
  transform: scaleX(-1);
}

/* ---- Dispatch UtilComponents ---- */

.image-theme {
  /* fbw flypad theme for simbrief maps */
  & img {
    width: 70.5%;
    filter: brightness(110%) hue-rotate(210deg) saturate(26%) invert(100%);
  }
}

.grabbable {
  cursor: move;
  cursor: grab;
  cursor: -moz-grab;
  cursor: -webkit-grab;

  &:active {
    cursor: grabbing;
    cursor: -moz-grabbing;
    cursor: -webkit-grabbing;
  }
}

.shake {
  animation: shake 0.5s;

  animation-iteration-count: infinite;

  @keyframes shake {
    0% {
      transform: translate(1px, 1px) rotate(0deg);
    }
    10% {
      transform: translate(-1px, -2px) rotate(-1deg);
    }
    20% {
      transform: translate(-3px, 0px) rotate(1deg);
    }
    30% {
      transform: translate(3px, 2px) rotate(0deg);
    }
    40% {
      transform: translate(1px, -1px) rotate(1deg);
    }
    50% {
      transform: translate(-1px, 2px) rotate(-1deg);
    }
    60% {
      transform: translate(-3px, 1px) rotate(0deg);
    }
    70% {
      transform: translate(3px, 1px) rotate(-1deg);
    }
    80% {
      transform: translate(-1px, -1px) rotate(1deg);
    }
    90% {
      transform: translate(1px, 2px) rotate(0deg);
    }
    100% {
      transform: translate(1px, -2px) rotate(-1deg);
    }
  }
}

.mcdu-big {
  font-family: 'HoneywellMCDU';
  font-size: 24px;
}

.mcdu-sml {
  font-family: 'HoneywellMCDUSmall';
  line-height: 1.25;
  font-size: 24px;
}
