/* Product Designer - Canvas Specific Styles */

/* Canvas Container */
.canvas-container-wrapper {
    height: calc(100vh - 72px);
    display: flex;
    flex-direction: column;
    background: #0F172A;
}

.canvas-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left Toolbar */
.canvas-toolbar {
    width: 80px;
    background: #1E293B;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    gap: 1rem;
    overflow-y: auto;
}

.tool-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    align-items: center;
}

.tool-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #334155;
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.tool-btn svg {
    width: 24px;
    height: 24px;
}

.tool-btn:hover {
    background: #3B4A5F;
    color: #F8FAFC;
    transform: translateY(-2px);
}

.tool-btn.active {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tool-tip {
    position: absolute;
    left: 60px;
    background: #1E293B;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    border: 1px solid #334155;
    z-index: 50;
}

.tool-btn:hover .tool-tip {
    opacity: 1;
}

.tool-divider {
    width: 40px;
    height: 1px;
    background: #334155;
    margin: 0.5rem 0;
}

.ai-generate-btn {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    margin-top: auto;
}

.ai-generate-btn svg {
    width: 28px;
    height: 28px;
}

.ai-generate-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.4);
}

/* Main Workspace */
.canvas-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0F172A;
    overflow: hidden;
}

.workspace-toolbar {
    height: 64px;
    background: #1E293B;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #0F172A;
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid #334155;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: transparent;
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn svg {
    width: 20px;
    height: 20px;
}

.toolbar-btn:hover {
    background: #334155;
    color: #F8FAFC;
}

.toolbar-btn:active {
    transform: scale(0.95);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: #334155;
    margin: 0 0.25rem;
}

/* Product Selector */
.product-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #0F172A;
    padding: 0.25rem 0.5rem 0.25rem 1rem;
    border-radius: 8px;
    border: 1px solid #334155;
}

.product-btn {
    background: #334155;
    color: #F8FAFC;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.product-btn:hover {
    background: #3B4A5F;
}

.product-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 240px;
    background: #1E293B;
    border: 1px solid #334155;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 50;
}

.group:hover .product-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #94A3B8;
    font-size: 0.875rem;
    border-bottom: 1px solid #334155;
    transition: all 0.2s ease;
}

.dropdown-header:hover {
    background: #334155;
    color: #F8FAFC;
}

.dropdown-header svg {
    width: 18px;
    height: 18px;
}

.dropdown-divider {
    height: 1px;
    background: #334155;
    margin: 0.5rem 0;
}

.dropdown-label {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: #94A3B8;
    font-weight: 600;
}

.dropdown-item {
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: #334155;
    color: #F8FAFC;
}

.product-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dropdown-footer {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
    color: #6366F1;
    font-size: 0.875rem;
    border-top: 1px solid #334155;
    transition: all 0.2s ease;
}

.dropdown-footer:hover {
    background: #334155;
    color: #8B5CF6;
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #0F172A;
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid #334155;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zoom-btn svg {
    width: 18px;
    height: 18px;
}

.zoom-btn:hover {
    background: #334155;
    color: #F8FAFC;
}

.zoom-level {
    color: #F8FAFC;
    font-size: 0.875rem;
    min-width: 50px;
    text-align: center;
}

.zoom-fit-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    margin-left: 0.25rem;
    transition: all 0.2s ease;
}

.zoom-fit-btn svg {
    width: 18px;
    height: 18px;
}

.zoom-fit-btn:hover {
    background: #334155;
    color: #F8FAFC;
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #0F172A;
    position: relative;
    overflow: auto;
}

.canvas-mockup {
    background: #1E293B;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: inline-block;
}

#fabric-canvas {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: white;
}

/* Right Properties Panel */
.properties-panel {
    width: 320px;
    background: #1E293B;
    border-left: 1px solid #334155;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-tabs {
    display: flex;
    border-bottom: 1px solid #334155;
}

.panel-tab {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.panel-tab:hover {
    color: #F8FAFC;
    background: #334155;
}

.panel-tab.active {
    color: #6366F1;
    border-bottom-color: #6366F1;
    background: rgba(99, 102, 241, 0.1);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: none;
}

.panel-content.active {
    display: block;
}

/* No Selection State */
.no-selection {
    text-align: center;
    padding: 3rem 1rem;
    color: #94A3B8;
}

.no-selection svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.3;
}

.no-selection h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #F8FAFC;
}

.no-selection p {
    font-size: 0.875rem;
}

/* Selection Properties */
.selection-properties {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.property-section {
    border-bottom: 1px solid #334155;
    padding-bottom: 1.5rem;
}

.property-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.property-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #F8FAFC;
}

.property-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.property-group {
    flex: 1;
}

.property-group label {
    display: block;
    font-size: 0.75rem;
    color: #94A3B8;
    margin-bottom: 0.25rem;
}

.property-input {
    width: 100%;
    padding: 0.5rem;
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #F8FAFC;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.property-input:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.property-select {
    width: 100%;
    padding: 0.5rem;
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #F8FAFC;
    font-size: 0.875rem;
    cursor: pointer;
}

.property-select:focus {
    outline: none;
    border-color: #6366F1;
}

.property-range {
    width: 100%;
    height: 4px;
    background: #334155;
    border-radius: 2px;
    -webkit-appearance: none;
}

.property-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #6366F1;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.property-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #8B5CF6;
}

.range-value {
    font-size: 0.75rem;
    color: #94A3B8;
    min-width: 40px;
    text-align: right;
}

/* Color Picker */
.color-picker-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #334155;
}

.color-input {
    flex: 1;
    padding: 0.5rem;
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #F8FAFC;
    font-size: 0.875rem;
    font-family: monospace;
}

.color-swatches {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.color-swatch {
    aspect-ratio: 1;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: #F8FAFC;
}

/* Effect Buttons */
.effect-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.effect-btn {
    padding: 0.75rem 0.5rem;
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #94A3B8;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.effect-btn svg {
    width: 20px;
    height: 20px;
}

.effect-btn:hover {
    background: #334155;
    color: #F8FAFC;
    border-color: #6366F1;
}

/* Layers Panel */
.layers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.layers-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #F8FAFC;
}

.layer-actions {
    display: flex;
    gap: 0.5rem;
}

.layer-action {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #0F172A;
    border: 1px solid #334155;
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.layer-action svg {
    width: 18px;
    height: 18px;
}

.layer-action:hover {
    background: #334155;
    color: #F8FAFC;
}

.layers-list {
    margin-bottom: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.layer-item:hover {
    background: #334155;
}

.layer-item.selected {
    border-color: #6366F1;
    background: rgba(99, 102, 241, 0.1);
}

.layer-drag {
    cursor: grab;
    color: #94A3B8;
}

.layer-icon {
    width: 20px;
    height: 20px;
    color: #6366F1;
}

.layer-name {
    flex: 1;
    font-size: 0.875rem;
}

.layer-controls {
    display: flex;
    gap: 0.25rem;
}

.layer-control {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.layer-control:hover {
    background: #1E293B;
    color: #F8FAFC;
}

.layer-nested {
    margin-left: 2rem;
}

.layers-footer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #334155;
}

.layer-footer-btn {
    padding: 0.5rem;
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #94A3B8;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.layer-footer-btn svg {
    width: 14px;
    height: 14px;
}

.layer-footer-btn:hover {
    background: #334155;
    color: #F8FAFC;
}

.layer-footer-btn.delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #EF4444;
    border-color: #EF4444;
}

/* AI Panel */
.ai-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.ai-header svg {
    width: 24px;
    height: 24px;
    color: #6366F1;
}

.ai-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #F8FAFC;
}

.ai-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.ai-quick-btn {
    padding: 0.75rem 0.5rem;
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #94A3B8;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-quick-btn svg {
    width: 20px;
    height: 20px;
}

.ai-quick-btn:hover {
    background: #334155;
    color: #F8FAFC;
    border-color: #6366F1;
}

.ai-prompt-section {
    margin-bottom: 1.5rem;
}

.ai-prompt-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #F8FAFC;
}

.ai-prompt {
    width: 100%;
    height: 80px;
    padding: 0.75rem;
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #F8FAFC;
    font-size: 0.875rem;
    resize: none;
    margin-bottom: 0.5rem;
}

.ai-prompt:focus {
    outline: none;
    border-color: #6366F1;
}

.ai-generate-prompt {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-generate-prompt:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ai-suggestions h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #F8FAFC;
}

.suggestion-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.suggestion-item {
    padding: 0.75rem;
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background: #334155;
    border-color: #6366F1;
}

.suggestion-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #F8FAFC;
}

.suggestion-desc {
    font-size: 0.75rem;
    color: #94A3B8;
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1E293B;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6366F1;
}