@import url('./aesthetics/landing.css');
@import url('./aesthetics/story.css');
@import url('./aesthetics/talon.css');
@import url('./aesthetics/kharza.css');
@import url('./aesthetics/final.css');

/* ========== ALL ========== */
body {
    overflow-x: hidden;
    margin: 0;
    text-align: center;
    margin: 0;
    padding: 0;
    background-color: #000000;
    color: white;
    font-family: 'Lexend', 'Segoe UI', sans-serif;
}

h1, h2, h3, p {
    margin: 0;
}

.background {
    position: fixed;
    inset: 0;
    background-color: #1d1d1d;
    z-index: -2;
}


@media (min-width: 768px) {
    body > *:not(#header) {
        padding: 0 10vw;
    }
}

/* ========== FONTS ========== */

@font-face {
    font-family: "Lexend";
    src: url("./fonts/Lexend-VariableFont_wght.ttf") format('truetype');
    font-weight: 100-900;
    font-style: normal;
}

/* ========== Header ========== */


.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5vw;
    background-color: #1D1D1D;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    width: 60px;
}

.CTFName {
    font-size: 1.4rem;
    font-weight: 500;
    color: #fce4e4;
    text-decoration: none;
}

.nav-link {
    color: #fce4e4;
    text-decoration: none;
    font-size: 1rem;
}

.nav-link:hover {
    text-decoration: underline;
}

.profile-circle {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background-color: #333;
  cursor: pointer;
  display: inline-block;
}

.profile-container {
    position: relative;
}

.profile-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);

    background-color: #3f3f3f;
    border-radius: 5px;
    display: none;
}


/* ========== Dashboard & Buttons ========== */
.btn {
    margin: 10px;
    border: 0;
    cursor: pointer;
    padding: 5px 20px;
    border-radius: 3px;
    color: inherit;
    text-decoration: none;
    color: white;
    background-color: black;
    font-family: 'Lexend', 'Segoe UI', sans-serif;
}

.dropdown-btn {
    all: unset;
    margin: 10px;
    border: 0;
    cursor: pointer;
    padding: 5px 20px;
    border-radius: 3px;
    color: inherit;
    color: white;
}

/* ========== Pop-up ========== */
.popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
}

.popup-content {
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  border-radius: 12px;
  padding: 36px 32px 28px;
  width: min(90vw, 520px);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.popup-content.ide-popup {
  width: 80vw
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 18px;
  cursor: pointer;
  color: #666;
  line-height: 1;
  transition: color 0.15s ease;
}

.close-btn:hover {
  color: #fff;
}

/* ========== Popup body text ========== */
#popup-body {
  display: flex;
  flex-direction: column;
}

#popup-body h1 {
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 600;
  color: #fff;
  border-left: 3px solid #ABFF04;
  padding-left: 12px;
  line-height: 1.3;
}

#popup-body p {
  font-size: clamp(12px, 1.1vw, 15px);
  color: #aaa;
  line-height: 1.65;
}

#popup-body strong {
  color: #ddd;
}

#popup-body code {
  background: #2a2a2a;
  color: #ABFF04;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.challenge-link {
  display: inline-block;
  margin-top: 4px;
  color: #ABFF04;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  border: 1px solid rgba(171, 255, 4, 0.3);
  padding: 7px 16px;
  border-radius: 6px;
  transition: background 0.2s ease, border-color 0.2s ease;
  width: fit-content;
}

.challenge-link:hover {
  background: rgba(171, 255, 4, 0.08);
  border-color: #ABFF04;
}


.challenge-link,
#popup-body .btn {
  align-self: center;
  margin: 8px auto 0;
  display: block;
  text-align: center;
}

/* ========== Flag form ========== */
#flagForm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid #2a2a2a;
  margin-top: 4px;
  align-self: stretch;
}

#flagForm label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #555;
}

#flagForm input[type="text"] {
  background: #111;
  border: 1px solid #333;
  border-radius: 6px;
  color: #fff;
  padding: 10px 14px;
  font-size: 14px;
  font-family: monospace;
  outline: none;
  transition: border-color 0.2s ease;
}

#flagForm input[type="text"]:focus {
  border-color: #ABFF04;
}

#flagForm .btn {
  align-self: center;
  margin-top: 4px;
}

#submitMessage {
  font-size: 13px;
  min-height: 18px;
}

/* ========== IDE ========== */
.terminal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0;
}

textarea {
  grid-row: 1;
  grid-column: 1 / 2;
  background: #111;
  color: #e0e0e0;
  width: 100%;
  height: 30vh;
  max-height: 30vh;
  font-family: monospace;
  font-size: clamp(11px, 1vw, 14px);
  border-radius: 6px;
  border: 1px solid #2e2e2e;
  padding: 12px;
  resize: none;
  outline: none;
  transition: border-color 0.2s ease;
}

textarea:focus {
  border-color: #444;
}

pre {
  text-align: left;
  max-height: 30vh;
  margin: 0;
  grid-row: 1;
  grid-column: 2 / 3;
  font-size: clamp(11px, 1vw, 14px);
  background: #111;
  border: 1px solid #2e2e2e;
  border-radius: 6px;
  padding: 12px;
  white-space: pre-wrap;
  overflow-y: auto;
  font-family: monospace;
}

/* ========== FOOTER ========== */
#footer {
  background-color: #2c2c2c;
  color: #eaeaea;
  padding: 0 !important;
  margin-top: 15vh;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 4rem;
  padding: 4rem 6rem;
  max-width: 1200px;
  margin: 0 auto;
}

#footer h1 {
  font-size: 1.6rem;
  margin: 0.5rem 0;
}

#footer h2 {
  font-size: 1rem;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  color: #bbbbbb;
}

#footer p {
  font-size: 0.9rem;
  color: #cccccc;
}

#footer a {
  display: block;
  color: #eaeaea;
  text-decoration: none;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

#footer a:hover {
  color: #7dd3fc;
}

.footer-brand img {
  width: 80px;
}

.footer-brand p {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #aaaaaa;
}

.footer-bottom {
  border-top: 1px solid #333;
  text-align: center;
  padding: 1.2rem;
  background-color: #161616;
  font-size: 0.8rem;
  color: #999;
}

/* Responsive */
@media (max-width: 768px) {
  .footer-top {
    flex-direction: column;
    text-align: center;
    padding: 3rem 2rem;
  }

  #footer a {
    align-items: center;
  }
}