/* Layout */

/* general & body config */

body {
    font-family: 'Quicksand', sans-serif;
}
.calculator-zoom {
  display: inline-block;          
  transform-origin: top left; 
  transition: transform 0.2s ease;
}

div.glass{
    display: flex;
    gap:16px;
    justify-content: space-evenly;
    align-items: flex-start;
            /* border: dashed blue 1px; */
    /* padding-left:3em; */
    /* padding-right:3em; */
    /* gap: 16px; */
    min-height: 100vh;
    flex-wrap: wrap;
    overflow: auto;
}

button {
    padding:18px;
    display:block;
    flex:1;
    min-width: 50px;
    min-height: 50px;
    text-align: center;
    /* line-height: 0px; */
}

/* History tab */
div.right {
    /* border:#1b1b27 solid; */
    display: flex;
    flex-direction: column;
    padding: 2em;
    height: 580px;
    width: 310px;
    gap:16px;
    align-items: center;
}

div.right button {
    font-size: clamp(0.6rem, 1vw, 0.7rem);
    max-width: fit-content;
    max-height: fit-content;
}

#visorRight {
  display: none;
}

body.visor-open #visorRight {
    padding:1em;
    max-width: fit-content;
    max-height: fit-content;
    overflow-y: auto;
    overflow-x: hidden;
    flex:1 1 0;

    display:flex;
    flex-direction: column;
    align-content: flex-start;
    justify-content: flex-start;
}

body.visor-open #visorRight {
        color:#1b1b27;
    background-color:#fdf5f5;
    border-radius: 1em;
    box-shadow: 1px 1px 5px #3F3F5F;
    cursor: not-allowed;
    scrollbar-color: #ba9eb5 transparent;
}

#visorRight h3 {
    display: block;
    flex:1;
    /* border:#1b1b27 1px solid; */
}

#visorRight ul {
    padding:0px;
}

#visorRight li {
    word-break: break-word; 
    margin-bottom: 2px;
    list-style-position: inside;
    /* border: red solid 1px; */
}


/* Calculator tab */

div.left {
            /* border: dashed red 1px; */
    display: flex;
    flex:0;
    max-width: fit-content;
    flex-direction: column;
    padding: 2em;
    align-items: center;
    gap: 24px;
}

div.background {
    /* border:darkblue solid 1px; */
    display:flex;
    flex:0;
    max-width: fit-content;
    flex-direction: column;
    padding: 2em;
    align-items: center;
    gap: 24px;
}

div.menu {
        /* border: solid red 1px; */
    display: flex;
    gap:8px;
    justify-content: space-evenly;
    align-items: center;
    flex:0;
}

/* visor and name */

h1#name{
    font-size: xx-small;
    flex:0;
    text-align: center;
    align-content: center;
    /* border: purple 1px solid; */
}

div.visor {
        /* border: solid purple 1px; */
    width: 250px;
    min-height: 55px;
    max-height: 55px;
    flex:1;
    align-content: center;
    text-align: center;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
}

div.visor p {
    padding-left:1em;
    padding-right:1em;
}

/* body of calculator */

div.corpo {
        /* border: solid red 3px; */
    display: flex;
    flex-direction: column;
    gap:12px;
    flex:1;
}

div.upper-row {
    /* border: dashed yellow 2px; */
    display: flex;
    gap:12px;
}

div.bottom-row {
    /* border: dashed yellow 2px; */
    display: flex;
    gap:12px;
}

/* left column body */
div.left-column{
        /* border:green dashed 1px; */
    align-content: flex-start;
    gap:12px;
    flex:1;
    display: flex;
    flex-direction: column;
}

/* number row */
div.first {
    /* border: white solid 1px; */
    display: flex;
    gap:12px;
}

div.second {
    /* border: white solid 1px; */
    display: flex;
    gap:12px;
}

div.third {
    /* border: white solid 1px; */
    display: flex;
    gap:12px;
}

div.forth {
    /* border: white solid 1px; */
    display: flex;
    gap:12px;
}

/* right column body */

div.operators{
    display: flex;
    flex-direction: column;
    /* border: green dashed 1px; */
    flex:1;
    gap:12px;
    justify-content: space-between;
}

/* style */

body {
    background-image: url(./picture/masaaki-komori-NoXUQ54pDac-unsplash.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100dvh;
    margin:0;
    padding:0;
}

div.glass {
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(12px);
    transition: background-color 0.3s ease, color 0.3s ease;
    z-index: 0;
}

/* background */
div.background {
    background: linear-gradient(125deg, #ffecec 0%, #fcdcdc 100%);
    border-radius: 1em;
    box-shadow: 0 4px 12px 0 #3F3F5F;
    position: relative;
    z-index: 1;
}

/* visor */
div.visor {
    color:#1b1b27;
    background-color:#fdf5f5;
    border-radius: 1em;
    box-shadow: 1px 1px 5px #3F3F5F;
    cursor: not-allowed;
    font-weight: bold;
    /* scrollbar-width: thin; */
    scrollbar-color: #ba9eb5 transparent;
}

/* buttons */
button {
    border-radius: 2em;
    background-color: #ffcccc;
    box-shadow: 1px 1px 5px #3F3F5F;
    border:0;
    color: #1b1b27;
    font-weight:medium;
    transition: background-color 0.2s ease, transform 0.1s ease;
    border: 1px solid transparent;
}

.left-column button {
    background-color: #e0b8c2;
}

button#equal {
    background-color: #ffcccc;
    color: #1b1b27;    
}

div.menu button {
    min-height: 30px;
}

/* Pseudo-elements */

button:active {
  background-color: #e0b8c2;
    box-shadow: 1px 1px 5px #3F3F5F;
  transform: translateY(5px);
}

button#equal:active {
    background-color: #e0b8c2;
}

.left-column button:active{
    background-color: #ba9eb5;
}

button:hover {
    border:#fdebeb solid 1px;
    cursor: pointer;
}

/* zoom in and out */

div.zoom {
    /* border:red solid 1em; */
    display: flex;
    flex:0;
    gap:8px;
    flex-basis: auto;
}

div.zoom button {
    font-size: clamp(0.65rem, 1.2vw, 0.8rem);
    min-width: 100px;
    min-height: 40px;
}

/* toggle */

.switch {
  position: relative;
  display: inline-block;
  width: 65px;
  height: 35px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color:#ffecec;
  -webkit-transition: .4s;
  transition: .4s;
    box-shadow: 1px 1px 5px #3F3F5F;

}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color:#fdf5f5;
  -webkit-transition: .4s;
  transition: .4s;
  border:#ffcccc solid 1px;
}

input:checked + .slider {
  background-color:#ba9eb5;
}

input:focus + .slider {
  box-shadow:1px 1px 5px #3F3F5F;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* night-mode */
body.night-mode .glass {
  background: rgba(34, 17, 31, 0.8);
}

body.night-mode .background {
    background: linear-gradient(125deg, #dcd0d9 0%, #ba9eb5 100%);
}


@media screen and (max-width: 450px){
    div.glass {
        flex-direction: column;
        align-items: center;
    }
}

@media screen and (max-width: 410px){
    div.glass {
        flex-direction: column;
        align-items: center;
    }
}