/* ============================================
   SVG Editor Styles
   ============================================ */

/* Editor App Container */
.svg-editor-app {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Top Toolbar */
.editor-toolbar-top {
    background: #2d2d2d;
    border-bottom: 1px solid #3d3d3d;
    padding: 8px 16px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    z-index: 100;
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 4px;
    align-items: center;
    background: #252525;
    padding: 4px 8px;
    border-radius: 8px;
}

.tool-btn {
    background: transparent;
    border: none;
    color: #e0e0e0;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tool-btn:hover {
    background: #3d3d3d;
    color: #fff;
}

.tool-btn.active {
    background: #6366f1;
    color: white;
}

.zoom-level {
    font-size: 12px;
    color: #aaa;
    margin-left: 8px;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #2d2d2d;
    min-width: 150px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    margin-top: 4px;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 13px;
}

.dropdown-menu a:hover {
    background: #3d3d3d;
}

/* Left Toolbar */
.editor-toolbar-left {
    position: absolute;
    left: 0;
    top: 50px;
    width: 70px;
    background: #2d2d2d;
    border-right: 1px solid #3d3d3d;
    height: calc(100% - 90px);
    display: flex;
    flex-direction: column;
    z-index: 90;
    overflow-y: auto;
}

.tool-section {
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tool-divider {
    height: 1px;
    background: #3d3d3d;
    margin: 8px 12px;
}

.editor-toolbar-left .tool-btn {
    width: 48px;
    height: 48px;
    justify-content: center;
    font-size: 18px;
}

/* Right Panel */
.editor-panel-right {
    position: absolute;
    right: 0;
    top: 50px;
    width: 280px;
    background: #2d2d2d;
    border-left: 1px solid #3d3d3d;
    height: calc(100% - 90px);
    display: flex;
    flex-direction: column;
    z-index: 90;
    overflow-y: auto;
}

.panel-section {
    border-bottom: 1px solid #3d3d3d;
}

.panel-header {
    padding: 12px 16px;
    background: #252525;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.panel-header h3 {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    color: #e0e0e0;
}

.panel-actions {
    display: flex;
    gap: 8px;
}

.panel-content {
    padding: 12px;
    display: block;
}

.panel-section.collapsed .panel-content {
    display: none;
}

/* Property Groups */
.prop-group {
    margin-bottom: 16px;
}

.prop-group label {
    display: block;
    font-size: 11px;
    margin-bottom: 6px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 50px;
    height: 32px;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    background: #1e1e1e;
    cursor: pointer;
}

.color-input-group input[type="number"] {
    flex: 1;
}

.prop-group input[type="range"] {
    width: 100%;
    margin-top: 8px;
}

.prop-group input[type="number"],
.prop-group select {
    width: 100%;
    background: #1e1e1e;
    border: 1px solid #3d3d3d;
    padding: 6px 8px;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 12px;
}

.dual-input {
    display: flex;
    gap: 8px;
}

.dual-input input {
    flex: 1;
}

.icon-btn {
    background: #1e1e1e;
    border: 1px solid #3d3d3d;
    color: #e0e0e0;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #3d3d3d;
}

.text-align-group {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

/* Layers List */
.layers-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.layer-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #252525;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.layer-item:hover {
    background: #3d3d3d;
}

.layer-item.selected {
    background: #6366f1;
    color: white;
}

.layer-visibility {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    color: #aaa;
}

.layer-name {
    flex: 1;
    font-size: 12px;
}

.layer-delete {
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    color: #f44336;
}

.layer-item:hover .layer-delete {
    opacity: 1;
}

/* Assets Panel */
.assets-search {
    position: relative;
    margin-bottom: 12px;
}

.assets-search input {
    width: 100%;
    background: #1e1e1e;
    border: 1px solid #3d3d3d;
    padding: 8px 32px 8px 12px;
    border-radius: 6px;
    color: #e0e0e0;
}

.assets-search i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.assets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.asset-item {
    background: #1e1e1e;
    border: 1px solid #3d3d3d;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.asset-item:hover {
    border-color: #6366f1;
    transform: translateY(-2px);
}

.asset-item i {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
    color: #6366f1;
}

.asset-item span {
    font-size: 11px;
    color: #aaa;
}

/* Canvas Area */
.editor-canvas-area {
    position: absolute;
    left: 70px;
    right: 280px;
    top: 50px;
    bottom: 30px;
    overflow: auto;
    background: #1a1a1a;
}

.canvas-wrapper {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#svg-canvas {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: crosshair;
}

.canvas-wrapper.grid-overlay {
    background-image: 
        linear-gradient(to right, #ccc 1px, transparent 1px),
        linear-gradient(to bottom, #ccc 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Status Bar */
.editor-status-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #252525;
    border-top: 1px solid #3d3d3d;
    padding: 6px 16px;
    display: flex;
    gap: 24px;
    font-size: 11px;
    z-index: 100;
    height: 30px;
    align-items: center;
}

.editor-status-bar span {
    color: #aaa;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #3d3d3d;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #3d3d3d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4d4d4d;
}

/* Responsive */
@media (max-width: 1024px) {
    .editor-panel-right {
        width: 260px;
    }
    
    .editor-canvas-area {
        right: 260px;
    }
}

@media (max-width: 768px) {
    .editor-toolbar-left {
        width: 55px;
    }
    
    .editor-panel-right {
        width: 240px;
        transform: translateX(100%);
        transition: transform 0.3s;
    }
    
    .editor-panel-right.open {
        transform: translateX(0);
    }
    
    .editor-canvas-area {
        left: 55px;
        right: 0;
    }
    
    .editor-toolbar-left .tool-btn {
        width: 44px;
        height: 44px;
    }
    
    .tool-btn span {
        display: none;
    }
}

@media (max-width: 480px) {
    .editor-toolbar-left {
        display: none;
    }
    
    .editor-canvas-area {
        left: 0;
    }
}