/* -------- 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);
}

label{
  font-weight: bold;
}

input{
  width: 150px;
  padding: 0.5rem;
  background-color: var(--ui-bg);
  color: var(--text-color);
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.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;
}

.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);
}

.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;
}

#titleLink{
  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);
}

/* -------- 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;
}

/* -------- Table Style -------- */

.table-container {
  overflow-x: auto;
  margin-bottom: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--ui-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  border: none;
}

th, td {
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: var(--ui-bg);
  font-weight: bold;
}

.load-btn,
.delete-btn {
  width: 80px;
  height: 36px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background-color: var(--primary-color);
  color: var(--white);
  transition: all 0.25s ease;
  margin: 4px;
}

#itemTable td:nth-child(2) {
  max-width: 300px;            /* set your desired width limit */
  white-space: normal;         /* allow line breaks */
  word-wrap: break-word;       /* break long words if needed */
  word-break: break-word;      /* ensure it wraps anywhere if too long */
  text-align: left;            /* optional: make text easier to read */
}


/* -------- 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);
}



/* -------- Main Section Style -------- */
.page-content {
  margin-top: 70px;
  padding: 0 60px;
  background: var(--ui-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: left;
  margin-bottom: 40px;
}

.color-text {
  color: var(--primary-color);
}

.page-content-title{
  font-size: 30px;
  margin-top: 40px;
  text-align: center;
}

.page-content p {
  font-size: 16px;
  max-width: 700px;
  margin: 20px 0 30px;
}

/* -------- Main Menu Style -------- */

.button-container{
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.program-header{
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.program-header p{
  text-align: center
}

/* -------- Guide Menu Styles -------- */
.guide-menu{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.guide-menu-body h3{
  margin-top: 30px;
  margin-bottom: 30px;
}

#guideBackBtn{
  margin-top: 30px;
}

/* -------- Calculator Menu Styles -------- */

.loaded-calculator-program {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
  width: 100%;
}

.formula-display {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-color);
  text-align: center;
  margin-bottom: 10px;
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.calc-inputs .input-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 300px;
}

.calc-inputs .input-group label {
  width: 100px; 
  text-align: center; 
}

.result-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.calc-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}


/* -------- Footer -------- */
.footer {
  background: var(--primary-color);
  color: var(--white);
  text-align: center;
  padding: 20px;
  margin-top: auto;
}

/* -------- Reset and delete Modal Style -------- */

.reset-modal, .delete-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
}

.reset-modal-content, .delete-modal-content {
  background: var(--ui-bg);
  margin: 120px auto;
  padding: 20px;
  width: 350px;
  border-radius: 8px;
  text-align: left;
}

.reset-modal-header, .delete-modal-header {
  font-size: 1.25rem;
  margin-top: 10px;
  margin-bottom: 10px;
  font-weight: bold;
}

.reset-modal-body, .delete-modal-body {
  margin-top: 20px;
  margin-bottom: 20px;
}

.reset-modal-actions, .delete-modal-actions{
  text-align: right;
}

.reset-modal-actions button, .delete-modal-actions button {
  width: auto;
  margin-left: 10px;
}

/* -------- Add Modal Style -------- */

.add-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
}

.add-modal-content {
  background: var(--ui-bg);
  margin: 120px auto;
  padding: 20px;
  width: 350px;
  border-radius: 8px;
  text-align: center;
}

.add-modal-header {
  font-size: 1.25rem;
  margin-bottom: 30px;
  font-weight: bold;
}

.add-modal-body {
  margin-bottom: 20px;
  font-size: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.add-modal-actions {
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
}

/* -------- Dark Mode Theme -------- */

.color-text.darkMode {
  color: #FFD700;  /* yellow */
}

/* --------- Other Function Mode and Styles ----- */

.hidden{
  display: none;
}

/* ------- Mobile Device ------- */
@media (max-width: 768px) {

    table {
    font-size: 14px;
  }
  th, td {
    padding: 8px 10px;
  }

  .appearance-area {
    display: flex;
    align-items: center;
    gap: 10px;
  }

    #itemTable td:nth-child(2) {
    max-width: 250px;          /* smaller width for mobile */
  }
  
}





