/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background: #0d0d0d;
    color: #e4e4e7;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #0d0d0d;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 20px;
    background: #18181b;
    border-bottom: 1px solid #27272a;
    flex-shrink: 0;
}

.header-left {
    flex: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #fafafa;
}

.logo svg {
    color: #6366f1;
}

.header-center {
    flex: 2;
    text-align: center;
}

.header-center h1 {
    font-size: 14px;
    font-weight: 500;
    color: #a1a1aa;
    letter-spacing: 0.3px;
}

.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid #3f3f46;
    border-radius: 6px;
    color: #e4e4e7;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.header-btn:hover {
    background: #27272a;
    border-color: #52525b;
}

.header-btn svg {
    width: 16px;
    height: 16px;
}

/* App Body */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #18181b;
    border-right: 1px solid #27272a;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

.sidebar-section {
    padding: 16px;
    border-bottom: 1px solid #27272a;
}

.section-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #71717a;
    margin-bottom: 12px;
}

/* Tool Buttons */
.tool-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 2px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #e4e4e7;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.12s ease;
}

.tool-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.tool-btn:hover {
    background: #27272a;
}

.tool-btn.active {
    background: #3b3b40;
    color: #fff;
}

.tool-btn.active svg {
    opacity: 1;
    color: #6366f1;
}

/* Properties */
.property-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.property-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    color: #a1a1aa;
    font-weight: 500;
}

.property-label input[type="range"] {
    width: 100%;
    height: 4px;
    background: #27272a;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.property-label input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #6366f1;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    transition: all 0.12s ease;
}

.property-label input[type="range"]::-webkit-slider-thumb:hover {
    background: #818cf8;
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.25);
}

.property-label input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #6366f1;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.property-value {
    float: right;
    color: #6366f1;
    font-weight: 600;
}

.property-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #e4e4e7;
    cursor: pointer;
}

.property-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #6366f1;
}

/* Quick Action Buttons */
.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 6px;
    color: #e4e4e7;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.quick-action-btn:hover {
    background: #3b3b40;
    border-color: #52525b;
}

.demo-select {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 6px;
    color: #e4e4e7;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.demo-select:hover {
    border-color: #52525b;
}

.demo-select:focus {
    outline: none;
    border-color: #6366f1;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 32px;
    pointer-events: none;
    z-index: 10;
}

.zoom-controls-overlay {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
}

.zoom-btn-overlay {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(24, 24, 27, 0.95);
    border: 1px solid #3f3f46;
    border-radius: 8px;
    color: #e4e4e7;
    cursor: pointer;
    transition: all 0.12s ease;
    backdrop-filter: blur(8px);
}

.zoom-btn-overlay:hover {
    background: rgba(59, 59, 64, 0.95);
    border-color: #6366f1;
    transform: scale(1.05);
}

.zoom-btn-overlay:active {
    transform: scale(0.95);
}

.zoom-btn-overlay svg {
    flex-shrink: 0;
}

/* Action Buttons */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 6px;
    color: #e4e4e7;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s ease;
}

.action-btn:hover {
    background: #3b3b40;
    border-color: #52525b;
}

.action-btn.danger {
    border-color: #7f1d1d;
    color: #f87171;
}

.action-btn.danger:hover {
    background: #450a0a;
    border-color: #991b1b;
}

/* Shortcuts */
.shortcuts {
    background: #0d0d0d;
}

.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #a1a1aa;
}

kbd {
    display: inline-block;
    padding: 2px 6px;
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 4px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #e4e4e7;
    min-width: 24px;
    text-align: center;
}

/* Workspace */
.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0d0d0d;
    position: relative;
    overflow: hidden;
}

#mainCanvas {
    flex: 1;
    background: #0d0d0d;
    cursor: crosshair;
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 32px;
    padding: 0 16px;
    background: #18181b;
    border-top: 1px solid #27272a;
    font-size: 12px;
    color: #71717a;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
}

.status-divider {
    color: #3f3f46;
}

#currentTool {
    color: #a1a1aa;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .header-center h1 {
        font-size: 12px;
    }
}
