/* Resetta i margini e padding */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    font-family: 'Roboto', sans-serif;
    background: #f7f7f7;
    color: #111;
    min-height: 100vh;
}

/* ----------------------------- container dei panels draggable ----------------------------- */
/* il contenitore deve avere una vera altezza */
#content{
  height: 100vh;
  overflow: hidden;
}

/* split verticale */
#mainContainer{
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;            /* IMPORTANT: permette lo shrink dei figli */
}

/* i pannelli in flex DEVONO avere min-height:0 per poter shrinkare */
.panel{
  min-height: 0;
  overflow: auto;
}

/* padding solo sopra (se vuoi) */
.upPanel{
  background: #eee;
  padding: 20px;
  flex: 1 1 auto;
}

/* sotto: niente padding (altrimenti il canvas non coincide), e layout flex */
.downPanel{
  background: #fff;
  padding: 0;
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  overflow: hidden;         /* evita scroll “strano” sul canvas */
}

.draggable{
  height: 10px;
  flex: 0 0 10px;
  cursor: ns-resize;
  background: #523e3e;
  touch-action: none;
}


/* ----------------------------- NAVIGATION BAR ----------------------------- */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    width: 100%;
    height: 60px;
    padding: 0 20px;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 999;
}

/* Rendi la parte sinistra e destra della nav flex container per allineare verticalmente l'immagine */
.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-left div:has(img),
.nav-left img {
    height: 100%;
    /* L'immagine ora sarà alta quanto la nav bar */
    width: auto;
    user-select: none;
    cursor: pointer;
}

.nav-left p#logged_user_text {
    margin-left: 20px;
    /* Spazio tra l'immagine e il testo */
    font-size: 20px;
    color: #333;
}

.nav-right a,
.nav-right p {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    margin-left: 20px;
    line-height: 60px;
    position: relative;
    transition: color 0.3s;
}

.nav-right a:hover {
    color: #0b4d9d;
}

.nav-right a.active {
    color: #0b4d9d;
    font-weight: 500;
    border-bottom: 3px solid #0b4d9d;
}

/* CONTAINER GENERALE */
.container {
    max-width: 400px;
    margin: 80px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.container h1 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #0b4d9d;
}



/* ----------------------------- select language ----------------------------- */

.language-select-container select {
    padding: 8px 16px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #f8f9fa;
    appearance: none;
    /* Rimuove lo stile predefinito del select */
    cursor: pointer;
    font-size: 16px;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="%23999" viewBox="0 0 4 5"><path d="M2 0L0 2h4L2 0zM2 5L0 3h4l-2 2z"/></svg>');
    /* Icona della freccia */
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

.language-select-container select:focus {
    border-color: #80bdff;
    background-color: #ffffff;
    outline: none;
    /* Rimuove il contorno predefinito */
}

.language-select-container select:hover {
    border-color: #a0a0a0;
    background-color: #e9ecef;
}


.language-select-container select {
    /* ...stili precedenti... */
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.language-select-container select:focus {
    box-shadow: 0 0 5px rgba(128, 189, 255, 0.5);
}


/* ----------------------------- Form: login e registrazione ----------------------------- */
.form-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.form-container h3#errorText {
    margin-bottom: 15px;
    font-size: 14px;
    min-height: 20px;
}

/* Campi input */
.form-container input {
    width: 100%;
    padding: 12px 15px;
    margin: 8px 0;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-container input:focus {
    border-color: #0b4d9d;
    outline: none;
}

.form-container button {
    padding: 12px 15px;
    margin-top: 20px;
    border-radius: 4px;
    border: none;
    background-color: #0b4d9d;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.form-container button:hover {
    background-color: #1576ed;
}

.password-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 8px;
}

.password-wrapper input {
    width: 100%;
    padding-right: 40px;
    /* lascia spazio all'icona */
}

.password-wrapper i {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.password-wrapper i:hover {
    color: #0b4d9d;
}


/* Messaggi di errore/successo */
#errorText.error {
    color: red;
}

#errorText.ok {
    color: green;
}



/* ........................... RESPONSIVE ...........................*/
@media screen and (max-width: 500px) {
    .nav {
        height: 50px;
        padding: 0 10px;
    }

    .nav-right a,
    .nav-right p {
        margin-left: 10px;
        font-size: 14px;
    }

    .container {
        margin: 60px auto;
        width: 90%;
        padding: 20px;
    }

    .container h1 {
        font-size: 20px;
    }

    .language-select-container {
        justify-content: center;
        /* Centra il select su schermi piccoli */
        padding: 10px 15px;
    }

    .language-select-container select {
        width: 100%;
        /* Il select occupa tutta la larghezza disponibile */
    }
}