/* assets/css/editor.css - Dark Mode Optimized */

/* General Layout */
/* Toolbar-integrated Tool Container (State 1: Upload) */
#editor-upload-container.tool-container {
    height: 100%;
    width: 100%;
    overflow: auto;
    /* Changed from hidden to allow scroll in landing card */
    background-color: transparent;
    display: flex;
    flex-direction: column;
    color: #e0e0e0;
}

.editor-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
}

/* Toolbar - Dark Glass Style */
.editor-toolbar {
    height: 52px;
    min-height: 52px;
    background: rgba(30, 30, 40, 0.85);
    /* Dark */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex-wrap: nowrap;
    overflow-x: auto;
}

/* Tool Groups */
.tool-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    /* Lighter bg for grouping */
    padding: 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tool-group.transparent {
    background: transparent;
    padding: 0;
    border-color: transparent;
}

/* Tool Buttons */
.tool-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #aaa;
    /* Dimmed icon */
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tool-btn.active {
    background: rgba(80, 227, 194, 0.2);
    /* Accent color tint */
    border: 1px solid rgba(80, 227, 194, 0.5);
    color: #50e3c2;
    /* Accent color text */
    box-shadow: 0 0 10px rgba(80, 227, 194, 0.2);
}

/* Icons */
.tool-btn i {
    pointer-events: none;
}

/* Separator */
.separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 8px;
}

/* Canvas Area */
.editor-workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    background-color: #121212;
    /* Dark Canvas BG */
}

/* Sidebar (Thumbnails) */
.editor-sidebar {
    width: 220px;
    background: rgba(30, 30, 40, 0.9);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 15px;
    overflow-y: auto;
    flex-shrink: 0;
    transition: width 0.3s ease;
}

@media (max-width: 768px) {
    .editor-sidebar {
        display: none;
    }
}

.page-thumb {
    width: 100%;
    background: #252525;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.page-thumb:hover {
    transform: translateY(-2px);
    background: #333;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.page-thumb.active {
    border-color: #50e3c2;
    background: #2a2a2a;
    box-shadow: 0 0 0 2px rgba(80, 227, 194, 0.3);
}

.page-thumb canvas {
    width: 100%;
    height: auto;
    border: 1px solid #444;
}

.page-number {
    text-align: center;
    font-size: 11px;
    color: #888;
    margin-top: 5px;
    font-weight: 500;
}

/* Canvas Scroll Wrapper */
.editor-canvas-area {
    flex: 1;
    overflow: auto;
    display: flex;
    position: relative;
    padding: 50px;
    background-image:
        linear-gradient(45deg, #1e1e1e 25%, transparent 25%),
        linear-gradient(-45deg, #1e1e1e 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1e1e1e 75%),
        linear-gradient(-45deg, transparent 75%, #1e1e1e 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #121212;
    /* Dark Checkboard */
}

/* Fabric Wrapper (The Sheet of Paper) */
#fabric-wrapper {
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
    /* Deeper shadow */
    background: white;
    /* Paper is always white! */
    transition: transform 0.1s ease-out;
    margin: auto;
}

/* Inputs & Selects */
.prop-input {
    border: 1px solid #444;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    outline: none;
    background: #252525;
    color: #eee;
    height: 32px;
}

.prop-input:focus {
    border-color: #50e3c2;
}

.prop-input option {
    background: #252525;
    color: #eee;
}

input[type="color"] {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    background: transparent;
}

input[type="range"] {
    accent-color: #50e3c2;
}

/* Zoom Controls (Floating) */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(30, 30, 40, 0.9);
    backdrop-filter: blur(10px);
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    gap: 4px;
    z-index: 90;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Overlays */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 30, 0.95);
    /* Dark Overlay */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.overlay-screen h1 {
    color: #f0f0f0 !important;
}

.overlay-screen p {
    color: #aaa !important;
}

.editor-loading {
    z-index: 201;
}

.ml-auto {
    margin-left: auto;
}

.hidden {
    display: none !important;
}

/* Custom Scrollbar for Sidebar */
.editor-sidebar::-webkit-scrollbar {
    width: 6px;
}

.editor-sidebar::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.editor-sidebar::-webkit-scrollbar-track {
    background: transparent;
}