@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700&display=swap');

body {
    transform: scale(0.9);
    font-family: Arial, sans-serif;
    text-align: center;
    margin: 0 110px;
    background-color: #400000;
    color: white;
    height: 100vh;
    overflow: hidden;
    background-image: url("../images/matrixbg.jpg");
    background-size: cover;              
    background-repeat: no-repeat;        
    background-position: center center;    
    background-attachment: fixed;  
}

.header-container {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    width: 85%;
    padding: 20px 50px;
}

h1 {
    font-size: 44px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    margin-left: 140px;
}

.matrix-size {
    font-size: 20px;
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
}

#matrix-select {
    background: black; 
    font-size: 18px;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.matrix-size, #matrix-container {
    visibility: hidden; 
    opacity: 0; 
    transition: opacity 0.5s ease-in-out;
}

#matrix-select option {
    background: black; 
    color: white; 
}

.calulator-body{
    padding : 20px;
    background: rgba(0, 0, 0, 0.5);
    height: 100vh;
    border-top-left-radius: 200px;
    border-top-right-radius: 200px;
    border-color: #ffffff;
    border-style: solid;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.h1 {
    font-size: 44px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Orbitron', sans-serif; 
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.matrix-size {
    font-size: 24px;
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    margin-left: auto; 
    margin-right: 55px; 
}

.matrix-size label {
    margin-right: 10px;
    font-weight: bold;
}

#matrix-select {
    background: linear-gradient(to bottom, #400000, #840c0c);
    color: white;
    font-size: 18px;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0px 5px 0px #400000, 0px 8px 12px rgba(0, 0, 0, 0.3);
}

#matrix-select:active {
    transform: scale(0.98);
}

#matrix-select {
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#matrix-select:hover {
    background-color: #400000;
    transform: scale(1.05);
}
.screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 75%;
    height: 300px;
    margin: 10px auto;
    background: rgba(208, 201, 201, 0.9);
    backdrop-filter: blur(8px);
    color: #0f0f0f;
    border-radius: 15px;
    box-shadow: inset 0px 0px 12px#400000; 
    font-family: 'Courier New', monospace;
    font-size: 28px;
    text-align: center;
    padding: 15px;
}

#hello-text {
    font-size: 90px;
    color: #1e241f;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 5px;
    text-shadow: 0px 0px 15px rgba(174, 187, 174, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity 3s ease-in-out;
    position: absolute;
}

#goodbye-text {
    font-size: 90px;
    color: #1e241f;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 5px;
    text-shadow: 0px 0px 15px rgba(174, 187, 174, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease-in-out;
    position: absolute;
}

input[type="text"] {
    pointer-events: auto; 
}


#matrix-wrapper {
    display: flex;
    gap: 20px; 
    justify-content: center;
    align-items: center;
}

#right-matrix-container {
    display: grid;
    gap: 10px;
    justify-content: center;
}


.matrix-size, #matrix-container, #right-matrix-container {
    visibility: hidden; 
    opacity: 0;
    transition: opacity 1s ease-in-out;
}


#matrix-container {
    display: grid;
    gap: 10px;
    justify-content: center;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
}

#matrix-container input[type="text"] {
    height: 50px;
    width: 50px;
    font-size: 18px; 
    text-align: center; 
    overflow: hidden; 
    white-space: nowrap; 
    overflow-x: auto;
    border: 1px solid #ccc;
    background: #eee;
}

#matrix-container input[type="number"]::-webkit-outer-spin-button,
#matrix-container input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


.buttons {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 50%;
    flex-wrap: wrap;

}

table {
            margin-left: auto;
            margin-right: auto;
            margin-top: auto;
            width: 100%;
            border-spacing: 10px;
            border-collapse: separate;
            
        }
        
input[type="button"] {
    width: 100%;
    padding: 15px 40px;
    background: linear-gradient(to bottom, #821010, #400000); 
    color: white;
    font-size: 24px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    margin-left: 10px;
    margin-right: 10px;
    box-shadow: 0px 5px 0px #400000, 0px 8px 15px rgba(0, 0, 0, 0.3); 
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

input[type="button"]:hover {
    box-shadow: 0px 0px 15px #400000;
    transform: scale(1.05);
}

input[type="button"]:active {
    box-shadow: 0px 2px 0px #400000, 0px 5px 10px rgba(0, 0, 0, 0.3); 
    transform: translateY(3px); 
}
input[type="button"]:active {
    transform: scale(0.95);
    box-shadow: 0px 2px 6px rgba(249, 255, 249, 0.5);
}

input[type="button"][value="ON"] {
    width: 100%;
    padding: 15px 40px;
    background: linear-gradient(to bottom, #c51212, #ff2020); 
    color: white;
    font-size: 24px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    margin-left: 10px;
    margin-right: 10px;
    box-shadow: 0px 5px 0px  #db0c0c, 0px 8px 15px rgba(0, 0, 0, 0.3); 
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

input[type="button"][value="ON"]:active {
    box-shadow: 0px 2px 0px #db0c0c, 0px 5px 10px rgba(0, 0, 0, 0.3); 
    transform: translateY(3px);
}

 /*Light mode*/

.method-switch-label{
  position: absolute;
  right: 50px;
  top: 87vh;
  background-color: #750000;
  width: fit-content;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0px;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  padding: 2px;
}

.method-switch{
  width: 0px;
  height: 0px;
  margin: 0px;
  opacity: 0;
}

.current-method{
  font-size: 1rem;
  text-transform: capitalize;
  font-family:Arial, Helvetica, sans-serif;
  color: white;
  width: fit-content;
  padding: 0px 10px;
  background-color: #400000;
  margin: 0px;
  height: 40px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  cursor: pointer;
}
 
 /*Light mode*/
body.light-mode {
  background-color: #f4f4f4;
  color: #111;
  background-image: url(../images/matrixli.png);
}

body.light-mode h1,
body.light-mode .matrix-size label,
body.light-mode #hello-text {
  color: #111;
  text-shadow: none;
}

body.light-mode .calulator-body {
  background: rgba(255, 255, 255, 0.85);
  border-color: #444;
}

body.light-mode .screen {
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  box-shadow: inset 0px 0px 12px #aaa;
}

body.light-mode #matrix-select,
body.light-mode input[type="button"] {
  background: linear-gradient(to bottom, #ffcccc, #ff6666);
  color: #000;
  box-shadow: 0px 5px 0px #8f0000, 0px 8px 12px rgba(0, 0, 0, 0.2);
}

body.light-mode input[type="button"][value="ON"] {
  background: linear-gradient(to bottom, #ff5f5f, #d70000);
  color: white;
}

body.light-mode .method-switch-label {
  background-color: #ddd;
}

body.light-mode .current-method {
  background-color: #bbb;
  color: #000;
}

.theme-switch {
  position: fixed;
  top: 20px;
  left: 1350px;
  width: 60px;
  height: 34px;
  z-index: 999;
  user-select: none;
  position: absolute;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: relative;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 34px;
  height: 100%;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  box-sizing: border-box;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.4s;
}

.theme-switch input:checked + .slider {
  background-color: #1b232a;
}

.theme-switch input:checked + .slider:before {
  transform: translateX(26px);
}

.slider .icon {
  font-size: 18px;
  color: #666;
  pointer-events: none;
  user-select: none;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
}

.theme-switch input:checked + .slider .sun {
  color: #ffdd00;
}

.theme-switch input:not(:checked) + .slider .moon {
  color: #222;
}

.back {
  background: linear-gradient(to bottom, #c51212, #ff2020);
  color: white;
  border: none;
  padding: 1.2vh 2.4vh;
  margin-top: 10%;
  margin-right: 70%;
  border-radius: 1.2vh;
  cursor: pointer;
  font-size: 2vh;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background-color 0.4s ease;
  transition: all 0.4s ease;
}
.back:hover {
  box-shadow: 0px 0px 15px #400000;
  transform: scale(1.1);
  color: black;
}

body.light-mode .back {
  background: linear-gradient(to bottom, #e76d6d, #ec1f1f);
  color: rgb(0, 0, 0);
  border: none;
  padding: 1.2vh 2.4vh;
  margin-top: 10%;
  margin-right: 70%;
  border-radius: 1.2vh;
  cursor: pointer;
  font-size: 2vh;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background-color 0.4s ease;
  transition: all 0.4s ease;
}

body.light-mode .back:hover {
  box-shadow: 0px 0px 15px #400000;
  transform: scale(1.1);
  color: rgb(255, 255, 255);
}