html, body {
    padding: 0;
    margin: 0;
    font-family: system-ui, sans-serif;
    height: 100vh;
    color: #555;
    font-size: 10.5pt;
}

#curves-canvas {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: block;
    background-color: #f4f4f4;
    
}
p, h1 {
    margin: 10px 20px;
    text-align: justify;
}

#ui-controls-wrapper {
    position: fixed;
    margin: 0 0 0 80px;
}

#ui-controls {
    /*! padding: 20px; */
    margin: 10px auto;
    width: 680px;

    text-shadow: 0 2px 5px white;
    box-shadow: 2px 10px 20px -9px #a0b2b6;
    backdrop-filter: blur(10px);
    background: linear-gradient(#fefefea0 10%, #f2f4f5b0 100%);
    border: 1px solid #bbb;
    border-radius: 16px;
    z-index: 10;
    
}
#about-wrapper{
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: #444a; */
    backdrop-filter: blur(20px);
    z-index: 1000;
    perspective: 100vh;
    opacity: 0;
    transform: scale(0.92) translateY(20px);
    visibility: hidden;
    transition: 
        opacity 0.3s ease-in-out,
        transform 0.3s ease-in-out,
        visibility 0s linear 0.3s;
}
#about-wrapper.visible {
    z-index: 10;
    opacity: 1;
    transform: scale(1) translateY(0);
    transition: 
        opacity 0.2s ease-in-out,
        transform 0.2s ease-in-out;
    visibility: visible;
}

#about{
    margin: auto;
    max-width: 640px;
    text-align: justify;
    text-shadow: 0 2px 5px white;
    box-shadow: 0px 15px 50px -9px #a0b2b6;
    backdrop-filter: blur(10px);
    background: linear-gradient(#fefefea0 10%, #f2f4f5b0 100%);
    border: 1px solid #bbb;
    border-radius: 16px;
    z-index: 100;
    padding: 10px;
    line-height: 1.6em;
}

#ui-controls h1, #ui-controls p {
    font-size: 11pt;
    grid-column: 1/5;
    line-height: 1.65em;
}

.control-group {
    /*grupos de elementos de configuração*/
    /*! margin: 20px 0 0 0; */
    padding: 16px;
    display: grid;
}

#NURBS-settings {
    display: grid;
    grid-template-rows: 1fr 1fr;
    grid-template-columns: repeat(4,max-content);
    background: #aaa2;
    margin: 0 12px;
    border-radius: 12px;
    padding: 12px;
}

#sampleCount {
    align-self: center;
}

.setting-lbl {
    align-self: center;
    justify-self: right;
    padding: 10px;
}

.checkbox-lbl {
    align-self: center;
    justify-self: left;
}

input[type="text"] {
    padding: 8px 8px 8px 8px;
    border: 1px solid #ccc;
    border-radius: 8px 0 0 8px;
    width: 380px;
    position: relative;
    right: -4px;
    color: #555;
    background: #f8f8f8;
}

input[type="number"] {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 50px;
    text-align: right;
}

input[type="checkbox"] {
    width: 24px;
    height: 24px;
    margin: 6px;
    align-self: center;
    justify-self: right;
}

#applyKnots, #resetKnots {
    padding: 8px;
    border: 1px solid #bbb;
    border-radius: 0 8px 8px 0;
    position: relative;
    /*! left: 0; */
    width: 80px;
    transition: 0.25s all ease-in-out;
}   
#applyKnots{
    background: linear-gradient(0deg, hsl(110, 30%, 83%) 0%, hsl(110, 35%, 92%) 100%)
}
button:hover {
    transition: 0.5s all ease-in-out;
    filter:saturate(200%) contrast(110% );
}

button:active {
    filter:brightness(80%) contrast(120%);
    box-shadow: inset 1px 4px 16px 0 #0006;
    transition: 0.2s all ease-in-out;
}
#deletePoint{
    text-align: center;
}
#deletePoint:hover{
    background: rgb(162, 88, 88);
    color: #eee;
    text-shadow: 0px 1px 6px rgb(115, 63, 63);
    border-radius: 0px;
}
footer p {
    position: fixed;
    width: calc(100% - 4px);
    bottom: 0;
    left:0;
    padding: 2px;
    text-align: center;
    text-shadow: 0 2px 5px white;
    background-color: transparent;
    /* display: inline-block; */
    /* border: 1px solid red; */
    border-radius: 8px;
    margin: 2px;
}

.context-menu {
    position: fixed;
    text-shadow: 0px 1px 6px white;
    
    box-shadow: 2px 10px 20px -9px #a0b2b6;
    backdrop-filter: blur(6px);
    background: linear-gradient(#fefefea0 10%, #f2f4f5b0 100%);
    border: 1px solid #bbb;
    border-radius: 8px;
    width: 150px;
    padding: 5px 0;
    z-index: 1000;
    opacity: 0;
    transform: scale(0.95) translateY(-5px);
    transform-origin: top left;
    transition: 
        opacity 0.33s ease-in-out,
        transform 0.33s ease-in-out,
        visibility 0s linear 0.33s;
    visibility: hidden; /* oculto por padrão, para exibir adicione classe .visible */
    
    pointer-events: auto; /* Ensure menu can receive clicks */
}

.context-menu.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    transition: 
        opacity 0.2s ease-in-out,
        transform 0.2s ease-in-out;
    visibility: visible;
}

#contextTitle{
    align-items: center;
    padding: 0 14px 4px 14px;
}
#contextTitle:hover{
    background: transparent;

}
.menu-item {
    padding: 4px;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease-in-out;
    height: 28px;
}
.menu-item:hover {
    background: #ccc6;
    border-radius: 4px;
}
.menu-number-input {
    width: 50px;
    margin-left: 0px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: border-color 0.2s ease-in-out;
    pointer-events: auto; /* Ensure input can receive clicks */
}

.menu-number-input:focus {
    border-color: #203080;
    outline: none;
}

#setXYZ{
    padding: 4px;
    margin: 0 4px 4px 4px;
    background: #aaa2;
    border-radius: 6px;
}
#setWeight, #deletePoint{
    height: 36px;
}
#setWeight span, 
#weightInput, #deletePoint span {
    margin: 8px;
}
/* Esconde opção de excluir caso não haja pontos suficientes. */
.context-menu .hidden-option {
  display: none;
}

#pointInfoPopup {
  min-width: 200px;
  pointer-events: none; /* Prevent popup from blocking mouse events */
}

#pointInfoPopup .menu-item, #debugPopup .menu-item {
    font-size: 10.5pt;
    cursor: default;
    justify-content: space-between;
    padding: 0px 10px;
}

#pointInfoPopup .menu-item:hover, #debugPopup .menu-item:hover {
  background: transparent;
}

#debugPopup {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999;
    min-width: 320px;
    padding: 8px 8px 16px 8px;
}

/* Minimize Button Styles */
.minimize-button {
    position: fixed;
    left: 8px;
    top: 8px;
    z-index: 100;
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 24pt;
    font-weight: bold;
    /* color: white;
    text-shadow: 0px 2px 4px #ccc, 2px 0px 4px #ccc, -2px 0px 4px #ccc, 0px -2px 4px #ccc,
        0px 1px 0px black, 1px 0px 1px black, -1px 0px 1px black, 0px -1px 1px black; */
    color:#888;
    text-shadow: 0px 2px 4px white, 2px 0px 4px white, -2px 0px 4px white, 0px -2px 4px white;
    backdrop-filter: blur(1px);
}

.minimize-button:hover {
    background: #f0f0f0;
}

/* UI Wrapper Transitions */
#ui-controls-wrapper {
    position: fixed;
    margin: 0 0 0 64px;
    z-index: 10;
    opacity: 1;
    transform: scale(1) translateY(0);
    visibility: visible;
    transition: 
        opacity 0.2s ease-in-out,
        transform 0.2s ease-in-out,
        visibility 0s linear;
}

#ui-controls-wrapper.minimized {
    opacity: 0;
    transform: scale(0.92) translateX(-30px) translateY(-20px);
    visibility: hidden;
    transition: 
        opacity 0.2s ease-in-out,
        transform 0.2s ease-in-out,
        visibility 0s linear 0.2s;
}

.checkbox-item {
    display: flex;
    align-items: center;
    white-space: wrap;
    grid-row: 2/3;
}

#sampleCount-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    grid-row: -1/-2;
    grid-column: -1/-2;
}

.setting-lbl {
    white-space: nowrap;
}

input[type="number"] {
    width: 60px;
    margin: 0;
}
#NURBSKnotWrapper{
    grid-column: 1/5;
}

#bezierMagnitude, #bezierAngle {
    color: #800
}

#bezierMagnitude2, #bezierAngle2 {
    color: hsl(323, 100%, 40%)
}

#NURBSmagnitude, #NURBSangle{
    color: #080

}
#NURBSmagnitude2, #NURBSangle2{
    color: #06d
}