/* HEAD */

.back {
  text-decoration: none;
  color: black;
  font-size: 14px;
  margin-bottom: 10px;
  display: inline-block;

  padding: 5px 10px;
  border: solid 1px #e4e6e7;
  border-radius: 5px;
  background-color: white;

  display: flex;
  align-items: center;
  width: fit-content;
}

.head h1 {
  margin-bottom: 10px;
}

.category {
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 14px;
}

/* SOLUTION */

.solution {
  position: relative;
  margin: 0 20%;
  background-color: white;
  border: solid 1px #E4E6E7;
  border-radius: 10px;
  margin-top: 5px;
  overflow: hidden;
  padding: 50px;
}

.solution-tete {
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;

  display: flex;
  align-items: center;
  gap: 5px;

  background-color: #fbfafd;
  padding: 15px 20px;
  border-bottom: solid 1px #E4E6E7;
  font-weight: bold;
}

.back-to-chall {
  margin: 0 20%;
  background-color: transparent;
  border: none;

  display: flex;
  align-items: center;

  font-size: 15px;
  cursor: pointer;
}

.solution h1 {
  /* margin-top: 0; */
}

.solution h2 {

}

.solution h3 {
  margin-bottom: 5px;
}

.solution p {
  margin: 10px 0;
  line-height: 25px;
}

.solution code {
  background: white;
  border: 1px solid #E4E6E7;
  padding: 2px 5px;
  border-radius: 5px;
  font-family: 'Neon', Courier, monospace;
}

.solution img {
  width: 100%;
  padding: 0 20%;
  margin: 20px 0;
  border-radius: 12px;
}

/* Style du modal */
.img-modal {
  display: none;
  align-items: center;
  justify-content: center; 
  position: fixed; 
  z-index: 1000; 
  /* padding-top: 5%;  */
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(255, 255, 255, 0.0);
  backdrop-filter: blur(1.5px);
}

/* Image dans le modal */
.img-modal-content {
  margin: auto;
  display: block;
  max-width: 80%;
  max-height: 80%;
  border-radius: 10px;
    animation: zoomIn 0.3s ease;
  cursor: zoom-out;
}

/* Bouton de fermeture */
.img-modal .close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

@keyframes zoomIn {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Validation */

.validations {
  margin-top: 10px;
}

.challenge-container {
    display: flex;
    flex-direction: column;
    padding: 0 10%;
}

div p {
  white-space: break-spaces;
}

pre {
    overflow-x: scroll;
}

details {
  cursor: pointer;
}

.completed-message {
  padding: 10px;
  
  background-color: #e8f3eb;
  color: #155724;
  border: 1px solid #c3e6cb;
  margin: 10px 0;
  border-radius: 4px;
}

.top-notification {
  position: fixed;
  top: -100px; /* start hidden */
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  width: 500px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  
  color: #000;
  padding: 10px 22px;
  border-radius: 6px;
  border: 1px solid #E4E6E7;
  z-index: 9999;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  animation: slideDown 0.6s ease-out forwards;
}

.top-notification p {
  margin: 0;
  display: flex;
  gap: 5px;
}

.top-notification a {
  color: #60a5fa;
  text-decoration: underline;
}

.top-notification .close {
  margin-left: 12px;
  cursor: pointer;
  font-size: 18px;
}

/* Slide animation */
@keyframes slideDown {
  from {
    top: -100px;
    opacity: 0;
  }
  to {
    top: 20px;
    opacity: 1;
  }
}

.code-container pre {
  margin: 0;
  padding: 0;
  background: none;
  position: relative;
  font-size: 15px;    /* Adjust font size here */
  line-height: 1.5;
  font-family: 'JetBrains Mono', 'Fira Mono', 'Consolas', monospace;
  overflow-x: auto;
}

.code-container code {
  background: none;
  font-size: inherit;
  color: inherit;
  border-radius: 8px;
  padding: 0;
  border: none;
}

.code-editor {
  width: 100%;
  margin: 10px 0;
  box-sizing: border-box;
  border: none;
  position: relative;
  margin-top: 20px;
}

.code-editor-bar {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 10px 10px 0 0;
  padding: 10px 20px;
  padding-bottom: 0px;
  padding-top: 15px;
  border: 1.5px solid #E4E6E7;
  border-bottom: none;
  position: relative;
}

.code-editor-bar p {
  color: #999999;
  font-size: 13px;
}

.code-editor-bar .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
}

.code-container {
  background: white;
  border: 1px solid #E4E6E7;
  border-top: none;
  /* margin-top: 20px; */
  border-radius: 0 0 10px 10px;
  /* box-shadow: 0 2px 12px rgba(0,0,0,0.08); */
  padding: 0;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.code-container-solution {
  background: white;
  border: 1px solid #E4E6E7;
  /* margin-top: 20px; */
  border-radius: 10px;
  /* box-shadow: 0 2px 12px rgba(0,0,0,0.08); */
  padding: 0;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

pre .line-numbers {
  border-right: none;
}

/* Copy button */

.copy {
  position: absolute;
  top: 10px;
  right: 10px;

  /* border: 1px solid #494949; */
  border: none;
  background-color: transparent;

  padding: 10px;
  border-radius: 5px;

  cursor: pointer;
}

/* Question Card */
.question-card {
  padding: 15px;
  background-color: white;
  border-radius: 10px;
  border: solid 1px #E4E6E7;
}

.question-title {
  margin: 0;
  font-size: 17px;
  font-weight: 300;
}

.question-description {
  margin: 0;
}

/* Input Groups */
.question-input {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

/* Text Input Styling */
.question-input input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  font-size: 1em;
  border-radius: 4px;
  border: 1px solid #ccc;
  transition: border 0.2s;
}

.question-input input.correct {
  border: 1px solid green;
  background-color: rgb(207, 255, 207);
  color: darkgreen;
}

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

.question-input input.incorrect.shake {
  animation: shake 0.4s;
}


.question-input input.incorrect {
  background-color: #ffcccc;
  border: 1px solid red;
}

.question-input input {
  width: 80%;
}

.form-control {
  padding: 8px 12px;
  border: 1.5px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
  transition: border 0.2s, background 0.2s;
}

.form-control:focus {
  border-color: #000;
  outline: none;
}

.send_btn {
  background: #B33791;
  color: white;

  width: fit-content;
  display: flex;
  align-items: center;

  padding: 8.5px;
  border: none;
  border-radius: 5px;

  cursor: pointer;

  height: 36px;
}

.submit-key {
  background-color: #f0f0f0;
  border: solid 1px #E4E6E7;
  display: flex;
  align-items: center;
  color: gray;
  border-radius: 5px;
  padding: 2px 5px;
  font-size: 13px;

  font-family: 'Courier New', Courier, monospace;
}

/* Hint Card */
.hint-container {
  text-align: left;
  width: 100%;
  margin: 10px 0;
}

.hint-container details {
  margin: 5px 0;
  background-color: #f0f0f0;
  padding: 10px 15px;
  border-radius: 10px;
  border: solid 1px #E4E6E7;
}

/* REFERENCES */

.references {
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 10px;
    border: solid 1px #E4E6E7;
}

.ref-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ref-title .ast {
  background-color: #B33791;
  padding: 5px;
  display: flex;
  justify-content: center;
  border-radius: 4px;
}

.ref-title h2 {
  margin: 0;
}


@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px);}
  to { opacity: 1; transform: none;}
}

/* images in write up */
div img {
  max-height:100%; 
  max-width:100%;
}

/* Adjust spacing between line numbers and code content */
.hljs-ln-n {
    padding-right: 10px;
    margin-right: 20px;
    color: #999;
    user-select: none;
    margin-bottom: 2px;
    text-align: right;
}

pre code.hljs {
    padding: 15px 15px;
    padding-bottom: 15px;
}