@font-face {
  font-family: "FontWithASyntaxHighlighter";
  src: url("./assets/font/FontWithASyntaxHighlighter-Regular.woff2") format("woff2");
}

/* ---------------- app colors ------------------- */
:root {
  --bg: #181a1b;
  --panel: #23272e;
  --panel2: #2d3138;
  --border: #40444b;

  --text: #e6e6e6;
  --text2: #b7b7b7;

  --accent: #3fb950;
  --accent-hover: #2ea043;
  --light-greeb: #2ea043;
  --dark-green: #016814;
  --link: #58a6ff;
  --light-blue: #58a6ff;
  --medium-blue: #2196F3;
  --dark-blue: #024188;

  --editor: #1e1e1e;
  --console: #0f1115;

/* ------------- size definition ------------------ */
  --header-title-width: 180px;
  --header-icone-play: 50%;
}

/* --------  page structure by screen size ------------------*/

/* Computer style */
@media (min-width: 601px) {
  
  .container {
    flex-direction: row;
    width: 90%;
  }

  .main {
    width: 100%;
  }

  .monaco-container {
    width: 80%;
  }

  .monaco {
    height: 84vh;
  }

  .sidebar {
    width: 30%;
    min-width: 200px;
    margin-left: 10px;
  }

  .button-smartphone-area {
    display: none;
  }

  .sidebar .button-pc-area {
    transform: translateY(-10px);
  }

  .output {
    max-height: 82vh;
  }
}

/* Smartphone style */
@media (max-width: 600px) {
  :root{
    --header-icone-play: 80%;
  
  }

  .container {
    flex-direction: column;
    width: 100%;
  }

  .button-smartphone-area {
    display: block;
    transform: translateY(-10px);
  }

  .monaco-container {
    width: 100%;
  }

  .monaco {
    height: 60vh;
  }

  .sidebar {
    width: 100%;
  }

  .sidebar .button-pc-area {
    display: none;
  }

  .log {
    margin-top: 10px;
  }

  .output {
    max-height: 150px;
  }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: auto;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 1.1em;
  line-height: 1.5;
  align-items: center;
}

.header {
  text-align: center;
  width: var(--header-title-width);
  display: grid;
  grid-template-columns: 25px 100% 25px;
  height: 50px;
  align-items: center;
  position: relative;
  transform: translateX(-20px);
}

.container {  
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
  flex: 1;
  margin-bottom: 20px;
  display: flex;
}

.monaco-container {
  flex: 1;
}

.sidebar {
  display: flex;
  flex-direction: column;
}

.log {
  flex: 1;
}

/* ------------ Header animation -----------------*/
@keyframes expand {
    from { width: var(--header-title-width); }
    to { width: var(--header-icone-play); }
}

@keyframes shrink {
    from { width: var(--header-icone-play); }
    to { width: var(--header-title-width); }
}

/* ------------  text editor : MONACO -----------------*/
.monaco {
  border: 1px solid #444;
  border-top-right-radius: 8px;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  overflow: hidden;
}


/* Tabs */
.tabs-header {
  display: flex;
}

.tab-button {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  padding: 10px 20px;
  background: #282A36;
  color: #F8F8F2;
  border: none;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
}

.tab-button.active {
  background: #44475A;
  font-weight: bold;
}

.tab-button:hover {
  background: #3A3C4E;
}

.tab-content {
  display: none;
  width: 100%;
}

.tab-content.active {
  display: block;
}


/* ----------  Consol : output ------------------*/
.output {
  flex-shrink: 0;
  padding: 10px;

  min-height: 100px;

  overflow-y: auto;

  background: var(--editor);
  color: #9CDC7C;

  border: 1px solid #333;
  border-radius: 8px;

  white-space: pre-wrap;
  font-family: Consolas, monospace;
  font-size: small;
}


/* ------------   Scrollbars ------------------ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #202225;
}

::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
  background: #777;
}

/*  ----------------   Button styles  ---------------------*/
.svg-icon {
  width: 36px;
  height: 36px;
  transition: filter 0.2s ease;

}

.svg-icon:hover {
  cursor: pointer;
  transform: translateY(-1px);
}

.svg-icon:active {
  filter: brightness(0) saturate(100%) invert(24%) sepia(98%) saturate(2000%) hue-rotate(200deg);
  transform: translateY(-2px);

}

.flex-row-button {
    display: flex;
    flex-direction: row; 
    align-items: center; 
    gap: 8px;
}

/* --------------   Switch slider button -----------------*/

.switch {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 32px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* switch - input*/
input:checked+.sliderSwitch {
  background-color: var(--medium-blue);
}

input:focus+.sliderSwitch {
  box-shadow: 0 0 1px #2196F3;
}

input:checked+.sliderSwitch:before {
  -webkit-transform: translateX(40px);
  -ms-transform: translateX(40px);
  transform: translateX(40px);
}

/* switch - sliders */
.sliderSwitch {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
  
}

.sliderSwitch:before {
  position: absolute;
  content: "";
  height: 100%;
  width: 100%;
  background-size: contain;
  background-image: url("../svg/bug.svg");
  background-repeat: no-repeat;
  -webkit-transition: .4s;
  transition: .4s;
}

.sliderSwitch.round {
  border-radius: 34px;
  
}

.sliderSwitch.round:before {
  border-radius: 50%;
}


/* -------------- PIANO -----------------*/

piano-main {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: 232323;
  font-family: Arial, sans-serif;
  touch-action: none;
}

.piano {
  display: flex;
  position: relative;
  width: 100%;
  height: 300px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.white-keys {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.white-key {
  flex: 1;
  height: 100%;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 0 0 5px 5px;
  margin: 0 2px;
  cursor: pointer;
  transition: background-color 0.1s;
  position: relative;
  touch-action: none;
}

.white-key:hover {
  background-color: #e0e0e0;
}

.white-key:active {
  background-color: #bbb;
}

.black-keys {
  position: absolute;
  top: 10;
  left: 0;
  width: 100%;
  height: 60%;
  display: flex;
  z-index: 2;
}

.black-key {
  height: 180px;
  background-color: black;
  color: white;
  border-radius: 5px;
  margin: 0 10px;
  cursor: pointer;
  transition: background-color 0.1s;
  position: absolute;
  touch-action: none;
}

.black-key:hover {
  background-color: #333;
}

.black-key:active {
  background-color: #555;
}

.key-label {
  position: absolute;
  bottom: 5px;
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: #666;
}

.white-key-label {
  position: absolute;
  bottom: 5px;
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: #666;
}
.black-key-label {
  position: absolute;
  bottom: 5px;
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: white;
}