/* Base styles and global elements */
body, html {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #000;
    font-family: sans-serif;
    cursor: url('../../assets/cursor.svg') 4 4, auto;
}

canvas {
    display: block;
    cursor: url('../../assets/cursor.svg') 4 4, auto;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#tabletCanvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2; /* Default to front, will be adjustable */
    pointer-events: none; /* Let events pass through to main canvas */
}

#noiseOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 3; /* Above canvas and tablet canvas */
    pointer-events: none; /* Let events pass through */
    display: none; /* Initially hidden */
}

#ditherOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 4; /* Above noise overlay */
    pointer-events: none; /* Let events pass through */
    display: none; /* Initially hidden */
    background: transparent;
}

#ditherOverlay canvas {
    width: 100%;
    height: 100%;
    display: block;
    filter: url(#ditherFilter);
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

#chromaticAberrationOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 5; /* Above dither overlay */
    pointer-events: none; /* Let events pass through */
    display: none; /* Initially hidden */
    background: transparent;
}

#chromaticAberrationOverlay canvas {
    width: 100%;
    height: 100%;
    display: block;
    filter: url(#chromaticAberrationFilter) contrast(1);
}

/* Custom cursor for pointer elements */
button, 
.controls button,
.settings-button,
.panel-toggle-btn,
.open-toggle-btn,
.save-toggle-btn,
.info-toggle-btn,
.toggle-panel-btn,
.mute-btn,
.solo-btn,
.tablet-action-btn,
#startButton,
input[type="checkbox"],
input[type="radio"],
select,
.mid-device-select,
.luminode-select,
.config-header {
    cursor: url('../../assets/cursor.svg') 4 4, auto !important;
}

body.loading {
    cursor: wait !important;
}

body.loading * {
    cursor: wait !important;
}

/* Icon styles */
ion-icon {
    font-size: 20px;
    color: inherit;
}

.settings-button ion-icon,
.panel-toggle-btn ion-icon {
    font-size: 18px;
}

.toggle-panel-btn ion-icon {
    font-size: 16px;
}

.midi-debug-overlay {
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 12px;
    font-family: 'Inconsolata', monospace;
    font-size: 11px;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
    text-transform: lowercase;
    max-width: 300px;
    word-wrap: break-word;
}

/* Custom Scrollbar Styles */
/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

::-webkit-scrollbar-corner {
    background: rgba(255, 255, 255, 0.05);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}
