/* --- RESET INIZIALE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Microsoft Sans Serif", Arial, sans-serif;
}

body, html {
    width: 100%;
    min-height: 100%;
    background-color: #f0f0f0;
}

body {
    padding-top: 62px; /* Spazio per l'header fisso */
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- HEADER (identico a index.css) --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 62px;
    background: #0d3b66;
    margin-bottom: 0 !important;
    padding: 10px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- LOGO (identico a index.css) --- */
.logo {
    position: absolute;
    left: 25px;
    top: 14px;
    font-size: 30px;
    font-weight: bold;
    color: white;
    letter-spacing: 1px;
    background-color: transparent;
    text-shadow: none;
    z-index: 10000;
}

/* --- NAVBAR (identica a index.css) --- */
nav {
    position: absolute;
    right: 35px;
    top: 18px;
    z-index: 10000;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

nav a, nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 20px;
    font-weight: 600;
    transition: .25s;
    background-color: transparent;
    text-shadow: none;
}

nav a:hover, nav ul li a:hover {
    color: #8fd3ff;
}

/* --- CONTENITORE PRINCIPALE --- */
#form-fig-geom {
    position: relative;
    width: 100%;
    min-height: 520px; /* Spazio calibrato per contenere canvas, descrizione e pulsanti senza vuoti enormi */
    background-color: #fff;
    flex: 1;
}

canvas {
    border: 2px solid #0a0a0a;
    background-color: rgb(207, 206, 206);
    display: block;
}

/* pictureBox1: Sfondo principale */
#pictureBox1 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('fondoGeom.jpg');
    background-size: 100% 100%; 
    background-repeat: no-repeat;
    border: 2px inset #888; 
    z-index: 1;
}

/* lblNickName */
#lblNickName {
    position: absolute;
    top: 0;
    left: 0;
    font-family: "Times New Roman", serif;
    font-size: 18pt;
    z-index: 10;
    white-space: nowrap;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 2px 5px;
}

/* label1: Descrizione (Spostata sotto il canvas, altezza e larghezza corrette) */
#label1 {
    position: absolute;
    top: 410px; /* Sotto la zona canvas */
    left: 0;
    width: 1000px; /* Larghezza piena della griglia */
    height: 120px; /* Altezza adeguata a contenere il testo senza tagliarlo */
    background-color: rgb(192, 255, 255);
    border: 2px inset #888; 
    font-size: 18pt;
    color: red;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
}

/* pictureBox2: Foto Giocatore (Affiancata a destra della descrizione) */
#pictureBox2 {
    position: absolute;
    top: 360px;
    left: 1000px;
    width: 200px;
    height: 150px; 
    border: 2px inset #888;
    background-size: 100% 100%;
    background-color: rgba(200, 200, 200, 0.3);
    z-index: 5;
}

/* --- PULSANTI (Agganciati subito sotto label1) --- */
.controls {
    position: relative;
    margin-top: 100px; /* Posizionati esattamente sotto i 360px + 100px di label1 */
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    z-index: 20;
}

.btn-bottom {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 200px;
    height: 45px;
    font-size: 13pt;
    font-weight: bold;
    color: rgb(192, 0, 192);
    border: 1px solid #777;
    cursor: pointer;
    z-index: 20;
}

.btn-bottom:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#button1 {
    background-color: rgb(192, 255, 192);
    color: red;
    font-weight: normal;
}

#button2 {
    background-color: rgb(200, 200, 255);
}

#button3 {
    background-color: rgb(192, 255, 105);
}

#button4 {
    background-color: rgb(192, 155, 255);
}

#button5 {
    background-color: rgb(192, 255, 192);
    color: black;
    font-weight: normal;
}

/* textBox1 */
#textBox1 {
    position: absolute;
    top: 410px;
    left: 780px;
    width: 200px;
    height: 45px;
    font-family: "Courier New", monospace;
    font-size: 16pt;
    font-weight: bold;
    display: none; 
    z-index: 25;
    resize: none;
}

/* --- FOOTER / CONTATTI --- */
#contatti, footer {
    margin-top: 0;
    background: #0d3b66;
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 0.9rem;
    line-height: normal;
    width: 100%;
    position: relative;
    z-index: 10;
}

#contatti a, footer a {
    color: #8fd3ff;
    text-decoration: none;
}

#contatti a:hover, footer a:hover {
    text-decoration: underline;
}

/* Media query dispositivi mobili */
@media(max-width:900px){
    .logo {
        position: static;
        text-align: center;
        margin-top: 5px;
    }
    nav {
        position: static;
        margin-top: 10px;
        text-align: center;
    }
    nav ul {
        flex-direction: column;
        gap: 10px;
    }
    .header {
        height: auto;
        padding-bottom: 20px;
    }
}
