/* Sezione Lavagna Collaborativa - Stile Brutalista */
.collaborative-canvas {
    padding: 80px 0;
    position: relative;
}

.canvas-description {
    text-align: center;
    font-size: 1.1rem;
    color: #666666;
    margin-bottom: 48px;
    font-family: 'Funnel Display', sans-serif;
    font-weight: 300;
}

.canvas-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    align-items: center;
    padding: 24px 32px;
    background: #ffffff;
    border: 3px solid #000000;
    border-bottom: none;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.color-picker {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.color-btn {
    width: 48px;
    height: 48px;
    border: 3px solid #000000;
    cursor: pointer;
    position: relative;
}

.color-btn.active {
    transform: scale(1.1);
}

.color-btn.active::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    bottom: -8px;
    left: -8px;
    border: 3px solid #000000;
}

.brush-size {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Funnel Display', sans-serif;
    font-weight: 500;
    padding: 12px 20px;
    border: 2px solid #000000;
    background: #ffffff;
}

.brush-size label {
    font-size: 1rem;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.brush-size input[type="range"] {
    width: 150px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #000000;
    outline: none;
}

.brush-size input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #000000;
    cursor: pointer;
    border: 2px solid #000000;
}

.brush-size input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #000000;
    cursor: pointer;
    border: 2px solid #000000;
}

.brush-size #brushSizeValue {
    font-weight: 800;
    font-size: 1.2rem;
    min-width: 30px;
    text-align: center;
    color: #000000;
}

.clear-btn {
    padding: 12px 24px;
    background: #000000;
    color: #ffffff;
    border: 3px solid #000000;
    font-family: 'Funnel Display', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    clip-path: polygon(8px 0%, 100% 0%, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0% 100%, 0% 8px);
}

.clear-btn i {
    font-size: 1.2rem;
}

.canvas-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border: 3px solid #000000;
    overflow: visible;
    background: #ffffff;
    position: relative;
    aspect-ratio: 3 / 2;
    margin-bottom: 0;
}

#drawingCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair !important;
    touch-action: none;
}

/* Gambe della lavagna - Stile Brutalista con Cubetti */
.canvas-legs {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 120px;
    pointer-events: none;
    z-index: 10;
}

.canvas-leg {
    position: absolute;
    top: 0;
    width: 50px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.canvas-leg-left {
    left: 18%;
}

.canvas-leg-right {
    right: 18%;
}

/* Cubetti impilati nelle gambe */
.canvas-leg::before,
.canvas-leg::after {
    content: '';
    width: 100%;
    height: 30%;
    background: #000000;
    border: 3px solid #000000;
    box-sizing: border-box;
    position: relative;
}

.canvas-leg::before {
    clip-path: polygon(
        0% 20%,
        20% 0%,
        100% 0%,
        100% 80%,
        80% 100%,
        0% 100%
    );
}

.canvas-leg::after {
    clip-path: polygon(
        0% 15%,
        15% 0%,
        100% 0%,
        100% 85%,
        85% 100%,
        0% 100%
    );
}

/* Responsive */
@media (max-width: 768px) {
    .collaborative-canvas {
        padding: 60px 0;
    }

    .canvas-controls {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }

    .color-picker {
        justify-content: center;
        gap: 12px;
        width: 100%;
    }

    .color-btn {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }

    .color-btn.active::after {
        top: -6px;
        right: -6px;
        bottom: -6px;
        left: -6px;
        border: 3px solid #000000;
    }

    .canvas-wrapper {
        border: 3px solid #000000;
    }

    .canvas-legs {
        height: 80px;
    }

    .canvas-leg {
        width: 35px;
        gap: 5px;
    }

    .canvas-leg-left {
        left: 15%;
    }

    .canvas-leg-right {
        right: 15%;
    }

    .brush-size {
        padding: 12px 16px;
        width: 100%;
        justify-content: flex-start;
        max-width: 100%;
        box-sizing: border-box;
    }

    .brush-size label {
        display: none;
    }

    .brush-size input[type="range"] {
        flex-grow: 1;
        margin-right: 12px;
    }

    .brush-size #brushSizeValue {
        font-size: 1rem;
        min-width: 25px;
        flex-shrink: 0;
    }

    .clear-btn {
        width: 100%;
        justify-content: center;
        padding: 8px 16px;
    }

    .canvas-description {
        font-size: 0.95rem;
        margin-bottom: 32px;
        padding: 0 20px;
    }
}
