/* KBBrochure Styles */
/* Copyright: Lila.,corp. Website: bctoyz.com, Author: Kyobi */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* Modal */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 400px;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.error-message {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 14px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

#userInfo {
    font-size: 14px;
}

/* Main Container */
.main-container {
    display: flex;
    height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, min-width 0.3s ease, padding 0.3s ease, margin 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #f5f5f5;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tab-header h3 {
    font-size: 18px;
    color: #2c3e50;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.list-container {
    flex: 1;
    overflow-y: auto;
}

.list-item {
    background: #f8f9fa;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.list-item:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.list-item.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.list-item h4 {
    font-size: 14px;
    margin-bottom: 5px;
}

.list-item p {
    font-size: 12px;
    color: #666;
    margin: 0;
}

.list-item.active p {
    color: rgba(255,255,255,0.9);
}

.list-item-actions {
    margin-top: 8px;
    display: flex;
    gap: 5px;
}

/* Editor Area */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f5f7fa;
}

.toolbar {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toolbar-left {
    flex: 1;
}

.name-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    max-width: 400px;
}

.toolbar-right {
    display: flex;
    gap: 10px;
}

.canvas {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.drop-zone {
    min-height: 100%;
    background: white;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 60px 20px;
    font-size: 16px;
}

/* Sidebar Toggle */
.sidebar-header {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    color: #666;
    font-size: 16px;
    transition: all 0.3s ease;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.toggle-btn:hover {
    color: #667eea;
    background: #f0f0f0;
    transform: scale(1.1);
}

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

.toggle-btn i {
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    overflow: visible !important;
    border: none;
    padding: 0;
    margin: 0;
}

.sidebar.collapsed .sidebar-tabs,
.sidebar.collapsed .tab-content {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.sidebar.collapsed .sidebar-header {
    display: flex !important;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 0 4px 4px 0;
    padding: 8px;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-header:hover {
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    background: #f8f9fa;
}

/* Components Tree Panel (Left) */
.components-tree-panel {
    width: 250px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s;
    height: calc(100vh - 60px);
    overflow: hidden;
}

.components-tree-panel.collapsed {
    width: 0;
    overflow: hidden;
    border: none;
}

.components-tree-panel.collapsed .panel-content {
    display: none;
}

.components-tree-panel.collapsed .panel-header {
    position: absolute;
    left: -40px;
    z-index: 1000;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px 0 0 4px;
    padding: 5px;
}

.components-tree {
    padding: 10px;
    flex: 1;
    overflow-y: auto;
}

.components-tree-panel .panel-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.tree-item {
    padding: 8px;
    margin: 4px 0;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.tree-item:hover {
    background: #f8f9fa;
    border-left-color: #667eea;
}

.tree-item.active {
    background: #e3f2fd;
    border-left-color: #667eea;
    font-weight: 500;
}

.tree-item .tree-icon {
    margin-right: 8px;
    color: #667eea;
    width: 16px;
    display: inline-block;
}

.tree-item .tree-label {
    flex: 1;
}

.tree-item .tree-badge {
    font-size: 11px;
    color: #999;
    margin-left: 8px;
}

.tree-item-nested {
    margin-left: 20px;
    padding-left: 10px;
    border-left: 1px dashed #ddd;
}

.empty-message-small {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 12px;
}

/* Right Sidebar - Tab System */
.right-sidebar {
    width: 300px;
    background: white;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    overflow: hidden;
    position: relative;
    transition: width 0.3s;
}

.right-sidebar-header {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.right-sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    overflow: visible !important;
    border: none;
    padding: 0;
    margin: 0;
}

.right-sidebar.collapsed .right-sidebar-tabs,
.right-sidebar.collapsed .right-tab-content {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.right-sidebar.collapsed .right-sidebar-header {
    display: flex !important;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px 0 0 4px;
    padding: 8px;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    width: auto;
    min-width: auto;
}

.right-sidebar.collapsed .right-sidebar-header:hover {
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
    background: #f8f9fa;
}

.right-sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    flex-shrink: 0;
}

.right-tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.right-tab-btn:hover {
    background: #e9ecef;
    color: #667eea;
}

.right-tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.right-tab-btn i {
    font-size: 16px;
}

.right-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    height: 100%;
}

.right-tab-content.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Properties content in tab */
#propertiesContent {
    display: block;
}

/* Components list in right sidebar */
.right-tab-content .components-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.components-panel h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.components-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.component-item {
    padding: 12px;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 6px;
    cursor: grab;
    text-align: center;
    transition: all 0.3s;
    user-select: none;
}

.component-item:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-2px);
}

.component-item:active {
    cursor: grabbing;
}

.component-item i {
    margin-right: 8px;
    color: #667eea;
}

/* Editor Components */
.editor-component {
    margin-bottom: 20px;
    padding: 15px;
    border: 2px solid transparent;
    border-radius: 6px;
    position: relative;
    background: white;
    transition: all 0.3s;
}

.editor-component:hover {
    border-color: #667eea;
}

.editor-component.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.component-controls {
    position: absolute;
    top: -10px;
    right: 10px;
    display: none;
    gap: 5px;
}

.editor-component:hover .component-controls,
.editor-component.selected .component-controls {
    display: flex;
}

.control-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #667eea;
    color: white;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: #5568d3;
}

.component-content {
    min-height: 40px;
}

.component-content input,
.component-content textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.component-content textarea {
    min-height: 100px;
    resize: vertical;
}

.component-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.component-content video {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.image-upload-placeholder,
.video-upload-placeholder {
    border: 2px dashed #ddd;
    border-radius: 6px;
    padding: 40px;
    text-align: center;
    color: #999;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.image-upload-placeholder:hover,
.video-upload-placeholder:hover {
    border-color: #667eea;
    background: #e3f2fd;
    color: #667eea;
}

.image-upload-placeholder i,
.video-upload-placeholder i {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.specs-editor {
    margin-top: 10px;
}

.spec-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.spec-row input {
    flex: 1;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
    border: 1px solid #e0e0e0;
}

.dropdown.active .dropdown-content {
    display: block;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background 0.3s;
}

.dropdown-content a:hover {
    background-color: #f5f5f5;
}

.dropdown-content a i {
    margin-right: 8px;
    width: 20px;
}

/* Drag and Drop */
.drag-over {
    background: #e3f2fd !important;
    border: 2px dashed #667eea !important;
}

.dragging {
    opacity: 0.5;
}

/* Template Input Form */
.form-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.form-section h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section h3 i {
    color: #667eea;
}

.specs-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spec-row-input {
    display: flex;
    gap: 10px;
}

.spec-row-input input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.list-item {
    cursor: pointer;
}

.list-item:hover {
    background: #e9ecef;
}

/* Properties moved to right sidebar */

.panel-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.panel-header h3 {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.property-group {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.property-group:last-child {
    border-bottom: none;
}

.property-group h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
}

.property-item {
    margin-bottom: 10px;
}

.property-item label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.property-item input,
.property-item select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.property-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Layers moved to right sidebar */

.layer-item {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.layer-item:hover {
    background: #f8f9fa;
}

.layer-item.active {
    background: #e3f2fd;
    border-left: 3px solid #667eea;
}

.layer-item .layer-icon {
    width: 20px;
    text-align: center;
    color: #667eea;
}

.layer-item .layer-info {
    flex: 1;
}

.layer-item .layer-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.layer-item .layer-details {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.layer-item .layer-actions {
    display: flex;
    gap: 5px;
}

.layer-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #999;
    font-size: 12px;
}

.layer-btn:hover {
    color: #667eea;
}

/* Resize Handles */
.editor-component {
    position: relative;
}

.resize-handle {
    position: absolute;
    background: #667eea;
    z-index: 10;
}

.resize-handle.nw {
    top: -5px;
    left: -5px;
    width: 10px;
    height: 10px;
    cursor: nw-resize;
}

.resize-handle.ne {
    top: -5px;
    right: -5px;
    width: 10px;
    height: 10px;
    cursor: ne-resize;
}

.resize-handle.sw {
    bottom: -5px;
    left: -5px;
    width: 10px;
    height: 10px;
    cursor: sw-resize;
}

.resize-handle.se {
    bottom: -5px;
    right: -5px;
    width: 10px;
    height: 10px;
    cursor: se-resize;
}

.resize-handle.n {
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    cursor: n-resize;
}

.resize-handle.s {
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    cursor: s-resize;
}

.resize-handle.w {
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    cursor: w-resize;
}

.resize-handle.e {
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    cursor: e-resize;
}

/* Container, Row, Column */
.component-container {
    border: 2px dashed #ddd;
    padding: 10px;
    min-height: 50px;
    position: relative;
}

.component-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    border: 2px dashed #667eea;
    padding: 10px;
    min-height: 50px;
    position: relative;
}

.component-column {
    flex: 1;
    border: 2px dashed #28a745;
    padding: 10px;
    min-height: 50px;
    position: relative;
}

.component-column.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

.component-column.empty::before {
    content: "Click để nhập nội dung";
}

.container-placeholder,
.row-placeholder,
.column-placeholder {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s;
}

.container-placeholder:hover,
.row-placeholder:hover,
.column-placeholder:hover {
    border-color: #667eea;
    background: #e3f2fd;
    color: #667eea;
}

/* Nested blocks */
.editor-component .editor-component {
    margin: 5px;
}

/* Responsive */
@media (max-width: 1200px) {
    .components-panel {
        width: 200px;
    }
    
    .properties-panel {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 250px;
    }
    
    .components-panel {
        display: none;
    }
    
    .properties-panel {
        position: fixed;
        right: 0;
        top: 60px;
        height: calc(100vh - 60px);
        z-index: 200;
    }
}

/* Modal Styles */
.modal-large {
    max-width: 800px;
    width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Media Library */
.media-library-toolbar {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.media-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 15px;
}

.media-item {
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s;
}

.media-item:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.media-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.media-item-info {
    padding: 8px;
    background: #f8f9fa;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.media-thumbnail {
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 1;
}

.media-thumbnail:hover {
    border-color: #667eea;
}

.media-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.media-thumbnail:hover .media-thumbnail-overlay {
    display: flex;
}

.media-thumbnail {
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 1;
}

.media-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}

.media-thumbnail:hover .media-delete-btn,
.media-item:hover .media-delete-btn {
    opacity: 1;
}

.media-delete-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
}

.media-item {
    position: relative;
}

.media-item-info {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.media-item .media-delete-btn {
    position: static;
    margin-left: auto;
    opacity: 0;
}

.media-thumbnail.dragging,
.media-item.dragging,
.icon-picker-item.dragging,
.animation-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.media-file-icon {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    font-size: 48px;
    color: #667eea;
}

.icon-picker-item,
.animation-item {
    cursor: grab;
}

.icon-picker-item:active,
.animation-item:active {
    cursor: grabbing;
}

/* Icon Library */
.icon-library {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.icon-picker-item {
    padding: 15px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.icon-picker-item:hover {
    border-color: #667eea;
    background: #f8f9fa;
    transform: scale(1.1);
}

.icon-picker-item i {
    font-size: 24px;
    color: #667eea;
}

.icon-picker-search {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

/* Animation Library */
.animation-library {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.animation-item {
    text-align: center;
    cursor: pointer;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.3s;
    background: white;
}

.animation-item:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.animation-preview {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 4px;
}

.animation-item span {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 1s ease-in-out;
}

.animate-slide-in-left {
    animation: slideInLeft 1s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 1s ease-out;
}

.animate-slide-in-up {
    animation: slideInUp 1s ease-out;
}

.animate-slide-in-down {
    animation: slideInDown 1s ease-out;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 2s linear infinite;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Specifications Table */
.specs-table {
    width: 100% !important;
    border-collapse: collapse;
    margin: 15px 0;
    table-layout: auto;
    display: table !important;
}

.specs-table th,
.specs-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    word-wrap: break-word;
}

.specs-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.specs-table td {
    background-color: white;
}

.specs-table tr:hover td {
    background-color: #f8f9fa;
}

.component-content table {
    width: 100% !important;
    max-width: 100%;
    display: table !important;
}

.component-content .specs-table {
    width: 100% !important;
    display: table !important;
}

.spec-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 13px;
    font-family: inherit;
}

.spec-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    border-radius: 2px;
}

.specs-table td {
    padding: 8px !important;
}

.specs-table td:last-child {
    width: 40px;
    text-align: center;
}

/* Media Library Section */
.media-library-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.media-library-section:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
}

.section-header h4 {
    margin: 0;
    font-size: 14px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spec-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

