@charset "utf-8";

body {
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    scroll-behavior: smooth;
}

/* Sleek scrollbar customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.dark ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.3);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.6);
}

#sheetMusicCanvas {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    /* 모바일 크롬 & 사파리 웹킷 강제 GPU 가속 주입 (60fps 버터 스크롤 구현) */
    transform: translate3d(0, 0, 0);
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000;
}

/* Invert sheet elements beautifully in dark mode */
.dark-sheet-active svg,
.dark-sheet-active canvas {
    filter: invert(0.9) hue-rotate(180deg) brightness(1.1);
}

.dark-sheet-active {
    background-color: #1a1a24 !important;
}

.key-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.key-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transition: 0.5s;
}

.key-btn:hover::after {
    left: 100%;
}

.drag-over {
    border-color: #10b981 !important;
    background-color: rgba(16, 185, 129, 0.05) !important;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.dark .glass-panel {
    background: rgba(30, 41, 59, 0.7);
}

/* Prevent horizontal overflow and wiggling in both vertical and horizontal scroll modes */
#sheetMusicCanvas > svg,
#sheetMusicCanvas > div,
#sheetMusicCanvas > canvas {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

#sheetMusicCanvas svg,
#sheetMusicCanvas canvas {
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
    pointer-events: none !important; /* Prevents SVG/canvas elements from intercepting touch gestures, unlocking smooth mobile swiping */
}

/* Horizontal scroll mode for sheet music canvas */
.sheet-scroll-horizontal {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth !important;
    padding: 0 !important; /* Remove parent padding to prevent snapping misalignment */
    gap: 0 !important;
    -webkit-overflow-scrolling: touch !important; /* Enables high-performance native swipe scrolling on iOS Safari & Chrome */
}

.sheet-scroll-horizontal > svg,
.sheet-scroll-horizontal > div,
.sheet-scroll-horizontal > canvas {
    flex: 0 0 100% !important; /* Force each page to occupy exactly 100% of the visible container width */
    width: 100% !important;
    max-width: 100% !important;
    scroll-snap-align: center !important;
    scroll-snap-stop: always !important;
    box-sizing: border-box !important;
    padding: 1.5rem !important; /* Add padding inside the page itself for premium margins */
    background-color: white !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    transition: transform 0.2s ease !important;
}

.dark-sheet-active.sheet-scroll-horizontal > svg,
.dark-sheet-active.sheet-scroll-horizontal > div,
.dark-sheet-active.sheet-scroll-horizontal > canvas {
    background-color: #1a1a24 !important;
}

