:root {
    --primary-color: #6c5ce7;
    --secondary-color: #00cec9;
    --accent-color: #fd79a8;
    --bg-gradient: linear-gradient(135deg, #a8c0ff 0%, #3f2b96 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.3);
    --text-color: #2d3436;
    --font-heading: 'Jua', sans-serif;
    --font-body: 'Noto Sans KR', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    /* Prevent text selection during drag */
}

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    height: 100vh;
    overflow: hidden;
    color: var(--text-color);
}

#app {
    display: flex;
    height: 100%;
    width: 100%;
}

/* Sidebar */
#sidebar {
    width: 280px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid var(--glass-border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
    margin-bottom: 20px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    /* Allow scrolling if tight */
}

.menu-category {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-title {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 5px;
    padding-left: 5px;
}

.menu-btn {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--glass-border);
    padding: 12px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.menu-btn.active {
    background: #fff;
    color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    font-weight: bold;
}

.icon {
    font-size: 1.2rem;
}

/* Glass Panel */
.glass-panel {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 15px;
    border: 1px solid var(--glass-border);
    margin-top: auto;
    /* Push to bottom */
}

/* Main Display */
#main-display {
    flex: 1;
    position: relative;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#canvas-container {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

canvas {
    display: block;
    cursor: crosshair;
}

/* Overlay Controls */
#overlay-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    pointer-events: none;
    /* Let clicks pass through to canvas where empty */
    display: flex;
    justify-content: space-between;
}

.control-group {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 15px;
    align-items: center;
    font-family: var(--font-heading);
}

.hidden {
    display: none !important;
}

.action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-family: var(--font-heading);
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s;
}

.action-btn:hover {
    transform: scale(1.05);
}

.secondary-btn {
    background: #fab1a0;
    color: #2d3436;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-family: var(--font-heading);
    cursor: pointer;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 100;
    transform: translate(-50%, -120%);
    white-space: nowrap;
}

/* Whiteboard Overlay */
#whiteboard {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    border: 5px solid #2d3436;
}

.board-content {
    font-family: var(--font-heading);
    text-align: center;
    font-size: 1.2rem;
}

.board-content h3 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.board-content ul {
    text-align: left;
    display: inline-block;
    margin: 20px 0;
    line-height: 1.8;
}

.board-content .highlight {
    background: #ffeaa7;
    padding: 0 5px;
}