/* Stili generali */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
}

/* Stili per la dashboard */
.dashboard-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Stili per le lavagne */
.board-item {
    transition: transform 0.2s;
}

.board-item:hover {
    transform: translateY(-3px);
}

/* Migliora lo stile per le anteprime delle lavagne */
.board-thumbnail {
    height: 160px;
    overflow: hidden;
    background-color: #f8f9fa;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.board-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: auto;
}

.board-thumbnail {
    height: 160px;
    object-fit: cover;
    background-color: #f8f9fa;
    overflow: hidden;
    position: relative;
}

.board-thumbnail img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.board-item:hover .board-thumbnail img {
    transform: scale(1.05);
}

.object-fit-contain {
    object-fit: contain !important;
}

/* Stile per le anteprime delle lavagne */
.board-thumbnail {
    height: 160px;
    overflow: hidden;
    background-color: #f8f9fa;
    position: relative;
}

.preview-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: white;
}

/* Stile per il canvas della lavagna */
.drawing-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 250px);
    min-height: 400px;
    border: 1px solid #ddd;
    overflow: hidden;
    background-color: white;
    touch-action: none; /* Importante per dispositivi touch */
}

/* Stile per lo sfondo a quadretti */
.grid-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(0, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 1; /* Assicurati che sia sotto il canvas */
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Permette interazioni con il canvas sottostante */
}

.grid-background.visible {
    opacity: 1;
}

#drawing-board {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 10; /* Assicura che il canvas sia sopra altri elementi */
    touch-action: none; /* Previene lo scrolling su touch device */
    background-color: transparent; /* Canvas trasparente per vedere la griglia */
    image-rendering: pixelated; /* Migliora la qualità della gomma */
    image-rendering: crisp-edges;
}

/* Cursore personalizzato per la gomma */
.eraser-cursor {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" stroke="black" stroke-width="2" fill="rgba(255,255,255,0.5)"/></svg>') 12 12, auto;
}

/* Anteprima dello spessore della linea */
.line-preview-container {
    height: 20px;
    background-color: #f8f9fa;
    border-radius: 3px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

#line-preview {
    width: 100%;
    height: 5px;
    background-color: #000;
    border-radius: 10px;
}

/* Stile per la modalità schermo intero */
.drawing-container:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    padding: 0;
}

.drawing-container:-moz-full-screen {
    width: 100vw;
    height: 100vh;
    padding: 0;
}

.drawing-container:-ms-fullscreen {
    width: 100vw;
    height: 100vh;
    padding: 0;
}

.drawing-container:fullscreen {
    width: 100vw;
    height: 100vh;
    padding: 0;
}

/* Stili per la toolbar del disegno */
.drawing-toolbar {
    padding: 10px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.color-picker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ccc;
    cursor: pointer;
}

.size-slider {
    width: 100%;
}

/* Stili per la visualizzazione dell'utente */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-header {
    background-color: #f8f9fa;
    padding: 30px 0;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

/* Stili per le tabelle admin */
.table-responsive {
    overflow-x: auto;
}

.action-btn {
    margin-right: 5px;
}

/* Stili per i form */
.form-floating > label {
    padding-left: 1rem;
}

/* Paginazione */
.pagination {
    justify-content: center;
    margin-top: 30px;
}

/* Stile per l'indicatore di salvataggio */
#save-status {
    min-width: 200px;
    transition: all 0.3s ease;
    text-align: right;
    font-weight: 500;
}
