/**
 * CrowdOrigin Designer - Styles
 *
 * @package CrowdOrigin_Designer
 */

.co-designer-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Toolbar */
.co-designer-toolbar {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.co-toolbar-left,
.co-toolbar-center,
.co-toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.co-toolbar-group {
    position: relative;
}

.co-dropdown {
    position: relative;
}

.co-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-width: 150px;
    z-index: 1000;
    display: none;
    margin-top: 5px;
}

.co-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 15px;
    border: none;
    background: #fff;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.co-dropdown-item:hover {
    background: #f0f0f0;
}

.co-dropdown-item:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.co-dropdown-item:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.co-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.co-btn:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.co-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.co-btn-primary {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.co-btn-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.co-btn-success {
    background: #00a32a;
    color: #fff;
    border-color: #00a32a;
}

.co-btn-success:hover {
    background: #008a20;
    border-color: #008a20;
}

/* Main Content */
.co-designer-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Canvas Wrapper */
.co-designer-canvas-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #e0e0e0;
    padding: 20px;
    overflow: auto;
}

#co-designer-canvas {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
}

/* Properties Panel */
.co-designer-properties {
    width: 250px;
    background: #fff;
    border-left: 1px solid #ddd;
    padding: 15px;
    overflow-y: auto;
}

/* Text Editor Panel */
.co-designer-text-editor {
    width: 250px;
    background: #fff;
    border-left: 1px solid #ddd;
    padding: 15px;
    overflow-y: auto;
}

.co-text-editor-content {
    font-size: 14px;
}

.co-text-style-buttons,
.co-text-align-buttons {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.co-text-style-buttons .co-btn-icon,
.co-text-align-buttons .co-btn-icon {
    flex: 1;
    padding: 8px;
    font-weight: bold;
}

/* Image Editor Panel */
.co-designer-image-editor {
    width: 250px;
    background: #fff;
    border-left: 1px solid #ddd;
    padding: 15px;
    overflow-y: auto;
}

.co-image-editor-content {
    font-size: 14px;
}

.co-property-slider {
    width: 100%;
    margin: 5px 0;
}

.co-property-group span {
    display: inline-block;
    margin-left: 10px;
    font-size: 12px;
    color: #666;
    min-width: 40px;
}

.co-designer-properties h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.co-properties-content {
    font-size: 14px;
}

.co-property-group {
    margin-bottom: 15px;
}

.co-property-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.co-property-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.co-property-input[type="number"] {
    margin-bottom: 5px;
}

.co-property-input[type="color"] {
    height: 40px;
    cursor: pointer;
}

.co-no-selection,
.co-no-layers {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Layers Panel */
.co-designer-layers {
    width: 250px;
    background: #fff;
    border-left: 1px solid #ddd;
    padding: 15px;
    overflow-y: auto;
}

.co-designer-layers h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.co-layers-content {
    font-size: 14px;
}

.co-layer-item {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.co-layer-item:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.co-layer-item.co-layer-selected {
    background: #e7f3ff;
    border-color: #2271b1;
}

.co-layer-name {
    flex: 1;
    font-weight: 500;
}

.co-layer-actions {
    display: flex;
    gap: 5px;
}

.co-btn-icon {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.co-btn-icon:hover {
    background: #f0f0f0;
}

/* Modal */
.co-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.co-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.co-modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.co-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.co-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.co-modal-close:hover {
    color: #333;
}

.co-modal-body {
    padding: 20px;
}

.co-modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.co-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.co-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive */
@media (max-width: 1200px) {
    .co-designer-properties,
    .co-designer-layers,
    .co-designer-text-editor,
    .co-designer-image-editor {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .co-designer-content {
        flex-direction: column;
    }
    
    .co-designer-properties,
    .co-designer-layers,
    .co-designer-text-editor,
    .co-designer-image-editor {
        width: 100%;
        max-height: 200px;
    }
    
    .co-designer-toolbar {
        flex-wrap: wrap;
    }
    
    .co-toolbar-left,
    .co-toolbar-center,
    .co-toolbar-right {
        flex-wrap: wrap;
    }
}

/* Asset Library Styles */
.co-asset-library-container {
    width: 100%;
    padding: 20px;
    background: #f5f5f5;
}

.co-asset-library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ddd;
}

.co-asset-library-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.co-library-actions {
    display: flex;
    gap: 10px;
}

.co-asset-library-filters {
    background: #fff;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.co-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.co-filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.co-filter-select,
.co-filter-input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.co-filter-search {
    flex: 1;
    min-width: 200px;
}

.co-filter-search .co-filter-input {
    width: 100%;
}

.co-asset-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.co-asset-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}

.co-asset-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.co-asset-image {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background: #f0f0f0;
    overflow: hidden;
}

.co-asset-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.co-asset-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.co-asset-item:hover .co-asset-overlay {
    opacity: 1;
}

.co-asset-actions {
    display: flex;
    gap: 10px;
}

.co-asset-info {
    padding: 10px;
}

.co-asset-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.co-asset-meta {
    font-size: 12px;
    color: #999;
}

.co-loading,
.co-error,
.co-no-assets {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #999;
}

.co-asset-library-load-more {
    text-align: center;
    padding: 20px;
}

.co-modal-large {
    max-width: 600px;
}

.co-form-group {
    margin-bottom: 15px;
}

.co-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.co-form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.co-btn-danger {
    color: #dc3545;
}

.co-btn-danger:hover {
    background: #dc3545;
    color: #fff;
}

.co-favorited {
    color: #dc3545;
}

@media (max-width: 768px) {
    .co-asset-library-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .co-asset-library-filters {
        flex-direction: column;
    }
    
    .co-filter-group {
        width: 100%;
    }
    
    .co-filter-select,
    .co-filter-input {
        width: 100%;
    }
}
