:root {
    --bg-dark: #1e1e24;
    --bg-panel: #2b2b36;
    --bg-lighter: #363645;
    --text-light: #e0e0e0;
    --accent: #00d2ff;
    --accent-hover: #3a7bd5;
    --border: #3d3d4e;
    --hover: #3b3b4f;
    --active: #4a4a6a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* ==================================
   Top Bar
   ================================== */
#top-bar {
    height: 60px;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-bar-left h2 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.accent-btn {
    background: var(--accent) !important;
    color: #000 !important;
    font-weight: bold;
    padding: 0 15px !important;
}

.navigation-path {
    flex: 1;
    margin: 0 20px;
    display: flex;
    gap: 5px;
    align-items: center;
    color: #aaa;
    background: var(--bg-lighter);
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.95rem;
    overflow-x: auto;
    white-space: nowrap;
}

.navigation-path::-webkit-scrollbar { display: none; }

.nav-link {
    cursor: pointer;
    color: var(--accent);
    padding: 2px 5px;
    border-radius: 4px;
}
.nav-link:hover {
    background: rgba(0, 210, 255, 0.1);
    text-decoration: underline;
}

/* ==================================
   Main Content
   ================================== */
#main-content {
    flex: 1;
    display: flex;
    background-color: #1a1a20;
    overflow: hidden;
    position: relative;
}

/* Explorer Grid */
#explorer-view {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    width: 100%;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 15px;
}

.file-item {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.file-item:hover {
    background: var(--hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.file-item i {
    font-size: 2.5rem;
}
.file-item .fa-folder { color: #f6d365; }
.file-item .fa-file-pdf { color: #ff6b6b; }
.file-item .fa-image { color: #4facfe; }
.file-item .fa-level-up-alt { color: #aaa; }

.file-item span {
    font-size: 0.8rem;
    word-break: break-all;
}

.thumb-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;
}
.thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Viewer Container */
.viewer-container {
    flex: 1;
    overflow: auto;
    position: relative;
    background: #202028;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 0;
}

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 1.3rem;
}
.placeholder i {
    font-size: 5rem;
    margin-bottom: 20px;
    color: #444;
}

#canvas-wrapper {
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    background: #fff;
    border-radius: 4px;
    position: relative;
    margin: 0 auto;
    transition: width 0.25s ease-out, height 0.25s ease-out;
}
#render-canvas, #draw-canvas {
    border-radius: 4px;
    display: block;
    width: 100%;
    height: 100%;
}
#draw-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    cursor: crosshair;
}

/* ==================================
   Floating Draggable Icon
   ================================== */
#floating-tools-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--accent);
    color: #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,210,255,0.4);
    transition: transform 0.1s;
}
#floating-tools-btn:active {
    transform: scale(0.95);
}
#floating-tools-btn:hover {
    transform: scale(1.05);
}

/* ==================================
   Vertical Fixed Annotation Toolbar
   ================================== */
.vertical-toolbar {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.divider-horizontal {
    width: 30px;
    height: 1px;
    background-color: var(--border);
}

.tool-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-light);
    height: 40px;
    width: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.tool-btn:hover {
    background-color: var(--hover);
    border-color: var(--border);
}

.tool-btn.active {
    background-color: var(--accent);
    color: #000;
    border-color: var(--accent);
}

input[type="color"] {
    border: 1px solid var(--border);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    padding: 0;
    overflow: hidden;
}
input[type="color"]::-webkit-color-swatch-wrapper {
	padding: 0;
}
input[type="color"]::-webkit-color-swatch {
	border: none;
    border-radius: 50%;
}

.slider-container {
    height: 100px;
    display: flex;
    align-items: center;
}


/* Tailwind Polyfills for User Snippet */
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-4 { width: 1rem; }
.h-0\.5 { height: 0.125rem; }
.min-h-24px { min-height: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.transition-colors { transition-property: color, background-color, border-color, fill, stroke; transition-duration: 150ms; }
.transition-all { transition-property: all; transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.transition-transform { transition-property: transform; transition-duration: 150ms; }
.text-gray-300 { color: #d1d5db; }
.text-white { color: #fff; }
.bg-blue-500 { background-color: #3b82f6; }
.hover\:bg-blue-600:hover { background-color: #2563eb; }
.hover\:text-white:hover { color: #fff; }
.hover\:bg-white\/10:hover { background-color: rgba(255, 255, 255, 0.1); }
.hover\:scale-110:hover { transform: scale(1.1); }
.group:hover .group-hover\:opacity-100 { opacity: 1; }
.group:hover .group-hover\:visible { visibility: visible; }
.absolute { position: absolute; }
.relative { position: relative; }
.left-\[100\%\] { left: 100%; }
.top-0 { top: 0; }
.ml-2 { margin-left: 0.5rem; }
.p-2 { padding: 0.5rem; }
.pt-1 { padding-top: 0.25rem; }
.pb-1 { padding-bottom: 0.25rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }
.border-\[var\(--border\,\#333\)\] { border-color: var(--border, #333); }
.bg-\[var\(--body-bg\,\#1e1e24\)\] { background-color: var(--body-bg, #1e1e24); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.shadow-\[0_4px_15px_rgba\(0\,0\,0\,0\.5\)\] { box-shadow: 0 4px 15px rgba(0,0,0,0.5); }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.invisible { visibility: hidden; }
.z-50 { z-index: 50; }
.min-w-max { min-width: max-content; }
.gap-1 { gap: 0.25rem; }
.bg-current { background-color: currentColor; }
.cursor-not-allowed { cursor: not-allowed; }
.w-full { width: 100%; }
/* Reset for Annotation Toolbar Buttons */
#annotation-tools button {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    outline: none;
}
#annotation-tools button.bg-blue-500 {
    background-color: #3b82f6;
}
/* Hide annotation tools button outlines */
#annotation-tools button:focus {
    outline: none;
}
/* Beautiful Size Picker */
#size-picker {
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    border-radius: 5px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
#size-picker::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    border: 2px solid #3b82f6;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
#size-picker::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(59,130,246,0.8);
    background: #3b82f6;
    border: 2px solid #fff;
}
#size-picker::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    border: 2px solid #3b82f6;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
#size-picker::-moz-range-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(59,130,246,0.8);
    background: #3b82f6;
    border: 2px solid #fff;
}
