﻿/* Scoped Application CSS utilizing Framework Variables */
html, body {
    overflow: hidden; /* Prevent pull-to-refresh & scrolling while drawing */
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    height: calc(100vh - 60px); /* Adjust based on top header height */
    background-color: var(--bg-base);
    overflow: hidden;
    cursor: crosshair;
}

#mainCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none; /* Crucial for touch-screen drawing */
}

#cursorLayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through */
}

.remote-cursor {
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: var(--accent);
    border: 2px solid var(--text-main);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.05s linear, top 0.05s linear;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    z-index: 10;
}

    .remote-cursor span {
        position: absolute;
        top: 18px;
        left: 10px;
        background: var(--bg-surface);
        color: var(--text-main);
        padding: 2px 6px;
        font-size: 10px;
        border-radius: 4px;
        white-space: nowrap;
    }

.canvas-toolbar {
    position: fixed;
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 30px;
    display: flex;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.toolbar-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .toolbar-btn:hover {
        background: var(--bg-surface-hover);
        color: var(--text-main);
    }

    .toolbar-btn.danger:hover {
        color: #ef4444; /* red */
    }

    .toolbar-btn svg {
        width: 20px;
        height: 20px;
    }

.settings-group {
    margin-bottom: 20px;
}

    .settings-group label {
        display: block;
        color: var(--text-main);
        margin-bottom: 8px;
        font-weight: 500;
    }

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
}

    input[type="color"]::-webkit-color-swatch-wrapper {
        padding: 0;
    }

    input[type="color"]::-webkit-color-swatch {
        border: none;
        border-radius: 50%;
    }

.styled-slider {
    width: 100%;
    accent-color: var(--accent);
}

/* Clear Animation */
.canvas-shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }

    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}
