html, body {
  margin: 0;
  padding: 0;
}

body {
    background-image: linear-gradient(to bottom, #4A6CDD, #012089);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    font-family: K2D, sans-serif;
}

/* Trash style */
.trash-container,
.fish-container {
  position: fixed;      /* always relative to viewport, not document flow */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* click-through */
  z-index: -1;          /* behind content */
  overflow: hidden;
}

.trash {
  position: absolute;
  width: 75px;
}

.fish {
  position: absolute;
  width: 200px;
  height: auto;       /* let browser keep aspect ratio */
  top: 40vh;
  left: 0;
  transition: transform 0.2s;
}

/* Header container */
.header-container {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2;
}

.header-image {
  position: relative;  /* Makes it a positioning context for absolute children */
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
  padding: 0;
  transition: opacity 0.3s ease;
}

.logo {
  position: absolute;  /* Absolute positioning relative to header-image */
  top: 3vh;          /* Distance from top */
  left: 3vh;         /* Distance from left */
  width: 75px;       /* Adjust logo size */
  height: auto;
  z-index: 3;         /* Above the header image */
  transition: opacity 0.3s ease;
}

/* Other */

nav ul {
    position: fixed;
    list-style: none;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
    z-index: 100;
}

nav a {
    font-size: 1.2rem;
    font-weight: bold;
    color: black;
    background: white;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    text-decoration: none;
    margin: 0;
    z-index: 100;
}

nav a:hover,
nav a:focus {
    background: #C2ECFF;
}

.main_content {
  position: relative; /* for z-index */
  z-index: 1;
  
  display: flex;           /* makes children flex items */
  flex-direction: column;  /* stack vertically */
  justify-content: center; /* vertical alignment */
  align-items: center;     /* horizontal alignment */
  margin-top:8vh;
  
  min-height: 100vh;       /* ensure full viewport height for vertical centering */
  transform: translateY(-25vh);
    /* Add smooth transitions */
    opacity: 1;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    animation: fadeInUp 0.6s ease-out;
  }
  
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(-25vh) translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(-25vh) translateY(0);
  }
}

/* Smooth transitions for all content */
.main {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.page_title {
    color:white;
    font-size:96px;
    font-family: K2D, sans-serif;
    text-align: center;
    padding: 0;
    margin: 10px;
}

.welcome_page_text {
  color:white;
  font-size:32px;
  text-align: center;
  font-family: K2D, sans-serif;
  font-weight: normal;
}

/* buttons */

.btn-container {
  display: inline-block;           /* make it behave like a button */
  padding: 10px 50px;             /* button size */
  background-color: white;      /* button color */
  color: white;                    /* text color */
  text-decoration: none;           /* remove underline */
  border-radius: 5px;              /* rounded corners */
  border: none;                    /* remove default border */
  font-family: K2D, sans-serif;
  font-size: 24px;
  cursor: pointer;                 /* mouse pointer on hover */
  transition: background-color 0.3s ease;
  text-align: center;
  box-sizing: border-box;
}

.btn-welcome {
  background-color: white;
  color: #00178A;
  min-width: 180px;
  width: 250px;
  
}

.btn-welcome:hover {
  background-color: #C2ECFF;
  color: #00178A;
}

.btn-container:hover {
  background-color: #C2ECFF;       /* darker on hover */
}

.btn-problems {
  background-color: #53A4F5;
  min-width: 180px;
  width: 250px;
  
}

.btn-problems:hover {
  color: #00178A;
}

.btn-back {
  background-color: #C2ECFF;
  color: #00178A;
  padding: 10px 20px;
}

.btn-back:hover {
  background-color: #53A4F5;
  color: #00178A;
}

.btn-test {
  background-color: #53A4F5;
  color: #00178A;
  width: 100px;
  height: 30px;
  margin: 10px auto;
  font-size: 18px;
  padding: 0;
  display: block;
}

.btn-test:hover {
  background-color: #C2ECFF;
  color: #00178A;
}

.user-test-case {
  text-align: right;
}


.btn-resultp {
  font-size: 18px;
  background-color: white ;
  /* width: 60px ; */
  /* height: 20px ; */
  padding: 10px ;
  color: green;
  margin: 5px 0 ;
  position: relative;
  right: 0;
}

.btn-resultp:hover {
  background-color: white ;
}

.btn-resultf {
  font-size: 18px;
  background-color: white ;
  /* width: 50px ; */
  /* height: 20px ; */
  padding: 10px ;
  color: red ;
  margin: 5px 0 ;
  position: relative;
  right: 0;
}

.btn-resultf:hover {
  background-color: white ;
}

.container {
    display: flex;              /* arrange sections side by side */
    gap: 20px;                  /* spacing between sections */
    justify-content: center;    /* center horizontally */
    margin: 40px 0;               /* space from page edges */
}

.section {
    background: #00178A;
    padding: 10px 50px;
    border-radius: 5px;
    text-align: center;
    color: white;
    width: 250px;
    display: inline-block;
    box-sizing: border-box;
    min-width: 180px;
}

.section h2 {
  margin: 0;  /* Remove default h2 margins */
  padding: 0;  /* Remove default padding */
  font-size: 24px;  /* Match button font size if needed */
  line-height: 1.2;  /* Tighter line height */
}

/* Editor styles */
.editor-container {
  position: relative;
  font-size: 14px;
  border-radius: 5px;
  overflow: hidden;
  background: #1e1e1e;
  width: 100%;
  max-width: 800px;
  margin: 20px 0;
}

/* Highlight layer */
#highlight-layer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;

  margin: 0;
  padding: 10px;
  width: 100%;
  min-height: 200px;

  box-sizing: border-box;
  white-space: pre-wrap;
  word-wrap: break-word;

  overflow: hidden; /* FIX 1 */
  color: #d4d4d4;

  font-family: Consolas, monospace; /* FIX 2 */
  font-size: 14px;
  line-height: 1.5;
}

/* Textarea */
#code {
  position: relative;
  z-index: 2;

  background: transparent;
  color: transparent;

  caret-color: white;
  border: none;
  outline: none;

  width: 100%;
  min-height: 200px;
  box-sizing: border-box;
  padding: 10px;
  resize: none;

  white-space: pre-wrap;
  overflow: auto;

  font-family: Consolas, monospace; /* FIX 2 */
  font-size: 14px;
  line-height: 1.5;
}

.keyword { color: #53A4F5; font-weight: bold; }
.string { color: #53A4F5; }
.comment { color: #53A4F5; }
.number { color: #C2ECFF; }
.function { color: #53A4F5; }

/* problem description & incorrect solution */

.problem_container {
margin-top:10px;
  width: 1200px;               /* Take up 75% of screen */
  margin: 0 auto;           /* Center it horizontally */
  display: flex;            /* Enable side-by-side layout */
  gap: 10px;                /* Optional spacing between columns */
}

.problem_container > div {
  flex: 1;                  /* Each child div takes up equal width */
  background: #f2f2f2;      /* Optional styling */
  padding: 20px;
  width:100%;
  box-sizing: border-box;
  background: #012189ab;
  font-family: K2D, sans-serif !important;
  color:white;
}

.problem_container textarea {
  flex: 1;
  width:100%;
  padding: 20px;
  box-sizing: border-box;
  height:300px;
}

pre {
    font-family: K2D, sans-serif;
}
textarea{
    width:100%;
}

.container {
  display: flex;
  flex-direction: column;  /* Stack vertically */
  gap: 20px;
  justify-content: center;
  align-items: center;
  margin: 40px 0;
}

.sections-wrapper {
  display: flex;  /* Display sections side-by-side */
  flex-direction: row;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
}

.section {
  background: #00178A;
  padding: 10px 50px;
  border-radius: 5px;
  text-align: center;
  color: white;
  width: 250px;
  display: inline-block;
  box-sizing: border-box;
  min-width: 180px;
}

.section h2 {
margin: 0;  /* Remove default h2 margins */
padding: 0;  /* Remove default padding */
font-size: 24px;  /* Match button font size if needed */
line-height: 1.2;  /* Tighter line height */
}

.sections-wrapper > div {  /* Target divs inside sections-wrapper */
  display: flex;
  flex-direction: column;     /* Stack section and button vertically */
  align-items: center;        /* Center items horizontally */
  gap: 10px;                  /* Space between section and button */
  width: fit-content;
}

.description {
  font-size: 24px;
  font-family: K2D, sans-serif;
  color: white;
  text-align: center;
  padding: 20px 40px;
  background-color: #00178A;
  opacity: 0.8;
  width: 90%;
  max-width: 1000px;
  margin: 0 auto 30px auto;
  border-radius: 5px;
  box-sizing: border-box;
}

.footer {
  position: static;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  color: white;
  font-size: 14px;
  font-family: K2D, sans-serif;
  padding: 10px 0;
}
