/* -------- Global Reset -------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s ease;
}

/* -------- Global Variables -------- */
:root {
  --white: #fff;
  --text-color: #000000;
  --primary-color: #000;
  --secondary-color: #272B2F;
  --ui-bg: #fff;
}

/* -------- Page Layout Setup -------- */
html, body {
  height: 100%;
}

body {
  background-color: var(--ui-bg);
  color: var(--text-color);
}

button{
  background-color: var(--primary-color);
  color: var(--white);
  font-size: 18px;
  height: 50px;
  width: 200px;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  margin-bottom: 20px;
  cursor: pointer;
}

button:hover{
  background: var(--secondary-color)
}

.wrapper {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* -------- Navigation Bar -------- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: var(--primary-color);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.navigation-bar {
  max-width: 1300px;
  height: 100%;
  margin: auto;
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navigation-bar a {
  color: var(--white);
  text-decoration: none;
  font-size: 18px;
  opacity: 0.75;
}

.navigation-bar a:hover,
.navigation-bar a.active-nav {
  opacity: 1;
}

.title-page-area{
  font-size: 30px;
  font-weight: 600;
  opacity: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  cursor: default;
  user-select: none;
}

.title-page-area a{
  opacity: 1;
}

#logoLink{
  font-size: 30px;
  font-weight: 600;
  opacity: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  cursor: pointer;
  user-select: none;
}

.page-logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--secondary-color);
}

/* -------- Navigation Bar Links -------- */
.nav-links {
  display: flex;
  flex-wrap: wrap;
}

.nav-links li {
  list-style: none;
  margin: 0 8px;
  padding-right: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-links li:last-child {
  border-right: none;
}

.nav-links-menu-toggle {
  display: none;
  font-size: 24px;
  color: var(--white);
  cursor: pointer;
}

/* -------- Appearance Area Style -------- */
.appearance-area {
  display: flex;
  align-items: center;
}

.dark-mode-btn {
  width: 50px;
  height: 50px;
  background: var(--secondary-color);
  color: var(--white);
  border-radius: 6px;
  font-size: 20px;
  text-align: center;
  line-height: 50px;
  cursor: pointer;
  margin-left: 10px;
  opacity: 0.8;
}

.dark-mode-btn:hover {
  opacity: 1;
}

/* -------- Page Content Style -------- */
.content {
  flex: 1;
  padding-top: 50px;
}

/* -------- Page Links Style -------- */
.content a {
  font-size: 20px;
  padding: 12px 20px;
  background: var(--primary-color);
  color: var(--white);
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
  align-items: center;
  gap: 8px;
}

.content a:hover {
  background: var(--secondary-color);
}

.about-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
}

.about-area-links {
  font-weight: 570;
  font-size: 16px;
  width: 260px;
}

.about-area-links:hover {
  background: var(--secondary-color);
}

/* -------- Main Section Style -------- */
.page-content {
  margin-top: 70px;
  padding: 0 60px;
  background: var(--ui-bg);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: left;
  margin-bottom: 40px;
}

.page-content.active-section {
  display: flex;
}

.page-content h3 {
  font-size: 35px;
}

.color-text {
  color: var(--primary-color);
}

.page-content p {
  font-size: 16px;
  max-width: 700px;
  margin: 20px 0 30px;
}

/* -------- Main Program Style -------- */

.projects-canvas {
  text-align: center;
}

.projects-canvas p {
  font-size: 18px;
}

.mainMenu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.methodBtn{
  height: 50px;
  width: 150px;
}

.toggleButton{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 30px;
  height: 50px;
  width: 100px;
}

.methodSelect{
  width: 200px;
}

/* -------- Cipher Area Style -------- */

.cipherArea {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

#cipherInput {
  width: 500px;
  max-width: 100%;
  height: 250px;
  padding: 0.8rem 1rem;
  font-size: 18px;
  border: 1px solid gray;
  border-radius: 8px;
  background-color: var(--ui-bg);
  color: var(--text-color);
  outline: none;
  resize: vertical; /* allow resizing */
  line-height: 1.5;
  text-align: left;
  vertical-align: top;
}

#cipherInput::placeholder {
  color: var(--text-color);
  opacity: 0.70;
}

.cipher-method-selection {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

#cipherMethodSelect {
  height: 50px;
  font-size: 16px;
  padding: 0 15px;
  border-radius: 6px;
  border: 1px solid gray;
  background-color: var(--ui-bg);
  color: var(--text-color);
  cursor: pointer;
  outline: none;
}

.caesar-shift-dropdown{
   height: 50px;
  font-size: 16px;
  padding: 0 15px;
  border-radius: 6px;
  border: 1px solid gray;
  background-color: var(--ui-bg);
  color: var(--text-color);
  cursor: pointer;
  outline: none;
}

.cipher-output-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.cipher-output-box {
  width: 500px;
  max-width: 100%;
  height: 250px;
  padding: 0.8rem 1rem;
  font-size: 18px;
  font-family: 'Courier';
  border: 1px solid gray;
  border-radius: 8px;
  background-color: var(--ui-bg);
  color: var(--text-color);
  outline: none;
  resize: vertical;
  line-height: 1.5;
  text-align: left;
  vertical-align: top;
}

.cipher-output-box::placeholder {
  color: var(--text-color);
  opacity: 0.70;
}

/* -------- Decipher Area Style -------- */

.decipherArea {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

#decipherInput {
  width: 500px;
  max-width: 100%;
  height: 250px;
  padding: 0.8rem 1rem;
  font-size: 18px;
  border: 1px solid gray;
  border-radius: 8px;
  background-color: var(--ui-bg);
  color: var(--text-color);
  outline: none;
  resize: vertical; /* allow resizing */
  line-height: 1.5;
  text-align: left;
  vertical-align: top;
}

#decipherInput::placeholder {
  color: var(--text-color);
  opacity: 0.70;
}

.decipher-method-selection {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

#decipherMethodSelect {
  height: 50px;
  font-size: 16px;
  padding: 0 15px;
  border-radius: 6px;
  border: 1px solid gray;
  background-color: var(--ui-bg);
  color: var(--text-color);
  cursor: pointer;
  outline: none;
}

.decrypt-caesar-shift-dropdown{
  height: 50px;
  font-size: 16px;
  padding: 0 15px;
  border-radius: 6px;
  border: 1px solid gray;
  background-color: var(--ui-bg);
  color: var(--text-color);
  cursor: pointer;
  outline: none;
}

.decipher-output-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.decipher-output-box {
  width: 500px;
  max-width: 100%;
  height: 250px;
  padding: 0.8rem 1rem;
  font-size: 18px;
  font-family: 'Courier';
  border: 1px solid gray;
  border-radius: 8px;
  background-color: var(--ui-bg);
  color: var(--text-color);
  outline: none;
  resize: vertical;
  line-height: 1.5;
  text-align: left;
  vertical-align: top;
}

.decipher-output-box::placeholder {
  color: var(--text-color);
  opacity: 0.70;
}

/* -------- Instruction Area Style -------- */

.instructionArea {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.guideSection {
  position: relative;
  padding-top: 3rem;
  margin-top: 3rem;
}

.guideSection::before {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  background-color: #ccc;
  position: absolute;
  top: 0;
  left: 0;
}

.cipherGuide img.cipher-img {
  max-width: 600px;
  width: 100%;
  height: auto;
  margin: 1rem auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* -------- About Area Style -------- */
#about {
  text-align: center;
}

.about-heading {
  margin: 30px 0 30px;
}

/* -------- Footer -------- */
.footer {
  background: var(--primary-color);
  color: var(--white);
  text-align: center;
  padding: 20px;
  margin-top: auto;
}

/* -------- Dark Mode Theme -------- */
.color-text.darkMode {
  color: #FFD700;  /* yellow */
}

/* --------- Other Function Mode and Styles ----- */

.hidden{
  display: none;
}


/* -------- Responsive Media -------- */
@media (max-width: 1100px) {
  .page-content {
    padding: 0 30px;
  }

  .page-content p {
    width: 90%;
  }
}

/* ------- Mobile Device ------- */
@media (max-width: 768px) {
  .nav-links-menu-toggle {
    display: block;
  }
  
  .nav-links {
    position: absolute;
    top: calc(70px + 10px); /* navigation-bar height + gap */
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-radius: 8px;
    display: none; /* hidden by default */
    width: auto;
    text-align: center;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links li {
    border: none;
    margin: 10px 0;
  }

  .appearance-area {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  #cipherInput, #decipherInput, .cipher-output-box, .decipher-output-box {
    width: 350px;
  }
  
}
