body{
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100dvh;
    width: 100vw;
    background-color: white;
}

header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid gainsboro;
}

header div{
    display: flex;
    gap: 25px;    
}

#logo {    
    border: none;
    background-color: transparent;
    color: black;
    font-size: 25px;
    font-weight: 700;
    cursor: pointer;
}

#previsualizar {
    padding: 10px 18px;    
    background-color: white;
    border: 2px solid rgb(249, 214, 127);
    border-radius: 5px;
    transition: transform 0.5s;    
}

#previsualizar:hover {
    cursor: pointer;
    background-color: rgb(249, 214, 127, 0.2);
}

#imprimir {
    padding: 10px 18px;
    border: none;
    background-color: rgb(249, 214, 127);
    border-radius: 5px;
    transition: transform 0.5s;
}

#imprimir:hover {
    cursor: pointer;
    background-color: rgb(249, 222, 127);
}






.board {
    flex: 1;
    height: 100%;
    width: 100%;
    display: flex;
    min-height: 0;
}

.sidebar {
    display: flex;
    flex-direction: column;    
    width: 150px;
}

.tools {
    display: flex;
    flex-direction: column;
    padding: 11px;
    aspect-ratio: 10/12;
    border-right: 1px solid gainsboro;        
    border-bottom: 0.5px solid gainsboro; 
}

.tools div{    
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
}


.tool {
    height: 60%;
    aspect-ratio: 1/1;
    margin: auto;
    border: none;
    background-color: white;
    border-radius: 5px;
    cursor: pointer;   
    box-shadow: 0.1px 0.7px 0px 1px gainsboro;
    transition: box-shadow 300ms ease, transform 200ms ease;
}

.tool:hover {    
    box-shadow:  0px 0px 0px 0px gainsboro;     
    transform: translateY(1px);
}

.tool.active {
    box-shadow: none;
    background-color: rgb(249, 214, 127);
}



.bases {
    display: flex;
    flex-direction: column;
    padding: 11px;
    aspect-ratio: 10/12;
    border-right: 1px solid gainsboro;        
    border-bottom: 0.5px solid gainsboro; 
}

.bases div{
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.base {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60%;
    aspect-ratio: 1/1;
    margin: auto;
    border: none;
    background-color: white;
    border-radius: 5px;
    cursor: pointer;   
    box-shadow: 0.1px 0.7px 0px 1px gainsboro;
    transition: box-shadow 300ms ease, transform 200ms ease;
}

.base img {
    width: 60%;
    height: 60%;
}

.base:hover {
    box-shadow:  0px 0px 0px 0px gainsboro;     
    transform: translateY(1px);
}

.base.active {
    box-shadow: none;
    background-color: rgb(249, 214, 127);    
}



.shapes-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 11px;
    border-right: 1px solid gainsboro;     
    overflow: hidden;
}

.shapes-list div{    
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 10px 0px 3px 3px;
    gap: 13px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgb(249, 214, 127) transparent;    
}

.shape{    
    font-size: 12px;
    min-width: 80%;
    width: max-content;
    display: flex;
    justify-content: left;
    border-radius: 5px;
    padding: 7px 10px;
    background-color: whitesmoke;
    box-shadow: 0px 2px 0px -1px gainsboro;
    white-space: nowrap;
    cursor: pointer;   
}

.shape:hover {
    background-color: rgb(249, 214, 127);
}













.canvas {
    position: relative;
    flex: 1;
    overflow: hidden;
    background-color: whitesmoke;
    z-index: 0;
    touch-action: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

canvas {
    display: block;   
}

#overlayCanvas {
    position: absolute;  
    top: 0;
    left: 0;
    z-index: 10;
    pointer-events: none;
}

.controller {
    display: none;
    width: 300px;
    height: 70px;
    position: absolute;    
    z-index: 20;    
    padding: 12px;    
    border-radius: 10px;
    background-color: rgb(249, 214, 127);    
    font-family: sans-serif;
    font-size: 13px;
}


.controller-point {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    gap: 12px;
}

.controller-input{
    display: flex;    
    flex: 1;
    gap: 10px;
    min-width: 0;
    align-items: center;
    white-space: nowrap;
}

.input-wraper{
    display: flex;
    flex: 1;    
    min-width: 0;
    height: 100%;
    background-color: white;
    border-radius: 10px;
    padding: 0px 10px 0px 10px;        
    align-items: center;
    overflow: hidden;
}

.input{
    flex: 1;
    font-size: 13px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;            
    outline: none;
}

.controller-line {
    display: flex;
    flex: 1;
    gap: 20px;
    padding: 20px;
    text-align: center;
}

.controller-line button{
    flex: 1;
}

.controller-decoration {
    position: absolute;
    box-shadow: 0px 10px 20px -15px;
    width: 33%;
    height: 100%;
    top: 99%;
    left: 33%;
    background-color: rgb(249, 214, 127);
    clip-path: polygon(0% 0%, 100% 0%, 50% 10%);
}

@media (max-width: 768px) {

    .board {
        flex: 1;
        height: 100%;
        min-height: 0;
        width: 100%;
        display: flex;
        flex-direction: column-reverse;
    }

    .sidebar {
        display: flex;
        flex-direction: row;    
        height: 80px; 
        width: 100%;     
    }

    .tools {
        flex: 1;        
        height: 100%;
        border-top: 1px solid gainsboro;
    }

    .tools span {
        display: none;
    }

    .tools div {
        display: flex;
        flex: 1;
        gap: 10px;
    }

    .tool {
        width: 100%;
        height: auto;
        flex:1;        
        border: none;
        background-color: white;
        border-radius: 3px;
        cursor: pointer;        
        aspect-ratio: 1/1;
        box-shadow: 0.1px 0.7px 0px 1px gainsboro;
        transition: box-shadow 300ms ease, transform 200ms ease;
    }





    .bases {
        flex: 1;        
        height: 100%;
        border-top: 1px solid gainsboro;
    }

    .bases span {
        display: none;
    }

    .bases div {
        display: flex;
        flex: 1;
        gap: 10px;
    }

    .base {
        width: 100%;
        height: auto;
        flex:1;        
        border: none;
        background-color: white;
        border-radius: 3px;
        cursor: pointer;        
        aspect-ratio: 1/1;
        box-shadow: 0.1px 0.7px 0px 1px gainsboro;
        transition: box-shadow 300ms ease, transform 200ms ease;
    }
    
    .shapes-list{
        display: none;
    }
}