body {
    background-color: #ffffff;
    color: #212529;
    font-family: Arial, sans-serif;
}


#light-dark{
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 5px 10px;
    font-size: 1.2rem;
    padding: 1rem;
    border: 2px solid #dcdcdc7c;
    border-radius: 3px;
    display: inline-flex;
    background-color:  #fffefef7;
    height: 28px;
    width: 45px;
    margin: 8px auto;
    color: rgba(67, 67, 67, 0.834);
    text-align: center;
    align-items: center;
}

/* Container styling */
.container {
    max-width: 600px;
    margin: 2rem auto;
    /* Center horizontally */
    padding: 1rem;
    background-color: #fcfcfd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    /* Center text content */
}

/* Row styling to prevent wrapping */
.row {
    margin: 0 auto;
    max-width: 400px;
    /* Limit width to prevent wrapping */
}

/* Input field styling */
#rows, #cols{
    font-size: 1.2rem;
    padding: 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    width: 50px;
    height: 33px;
    text-align: center;
    transition: border-color 0.3s;
    margin: 0 auto;
    display: inline-block;
}

#rows:focus, #cols:focus, #reset:focus, #submit:focus, #light-dark:focus, #toggleMode:focus {
    border-color: #80bdff;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}
/* Form styling */
#entry {
    display: inline-block;
    /* Keep form elements on one line */
    margin: 0 auto;
}

/* Response message styling */
#response {
    margin-top: 1rem;
    font-size: 1.1rem;
    min-height: 2em;
    color: #495057;
}


/* Matrix Table Styling */
.table-not-bordered {
    border-collapse: separate;
    display: grid;
    place-items: center;
    border-spacing: 2px;
    margin: 2px auto;
    padding: 2px;
}

.table-not-bordered td {
    padding: 2px;
    margin: 2px auto;
    min-height: 50px;
    min-width: 33px;
    text-align: center;
    border: none !important;
    width: auto;
}


.input-overlay-container {
  position: relative;
  display: inline-block;
  width: 50px;  /* Match the input size */
  height: 33px; /* Match the input height */
}


#matrix {
    display: grid;
    place-items: center;
    padding: 2px;
    margin: 2px auto;
}


/* Matrix Input Styling */
.matrix-box {
    position: relative;
    z-index: 2;
    background: transparent;
    width: 50px !important;
    height: 33px;
    font-size: 1.2rem;
    padding: 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    text-align: center;
    transition: border-color 0.3s;
    margin: 2px;
    padding: 0.3rem;

}*/

.matrix-box:focus {
    border-color: #80bdff;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}

.katex, .katex-display {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-size: 1.2rem !important;
  color: #495057 !important;
}

/* Additional KaTeX-specific refinements */
.katex .katex-mathml {
  /* Hide MathML fallback */
  position: absolute;
  clip: rect(1px, 1px, 1px, 1px);
  padding: 0;
  border: 0;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

.katex .katex-html {
  /* Ensures proper alignment */
  display: inline-block;
}

/* LaTeX Overlay Styling */

.latex-overlay {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 110%;
  display: flex;
  text-align: center;
  color: #444;
  z-index: 1;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}


/* Button Styling */
#submit, #reset {

    font-size: 1.2rem;
    padding: 1rem;
    border: 2px solid #dcdcdc;
    border-radius: 4px;
    display: inline-flex;
    background-color:  #4950579e;
    height: 33px;
    width: 49px;
    margin: 4px auto;
    color: rgb(255, 255, 255);
    text-align: center;
    align-items: center;
    justify-content: center;
}
