/* Custom Design Tool CSS - designer.css */

/* ═══════════════════════════════════════════════════════════════════
   DESIGNER LAYOUT
   ════════════════════════════════════════════════════════════════════ */

.designer-container {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    height: calc(100vh - 80px);
    background: #F5F5F5;
}

/* ═══════════════════════════════════════════════════════════════════
   LEFT SIDEBAR - TOOLS
   ════════════════════════════════════════════════════════════════════ */

.designer-sidebar {
    background: white;
    padding: 2rem;
    overflow-y: auto;
    border-right: 1px solid #E5E5E5;
}

.designer-sidebar h3 {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 2rem;
    color: #0A0A0A;
}

.tool-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #F5F5F5;
}

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

.tool-section h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #0A0A0A;
}

.tool-select,
.tool-input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #E5E5E5;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s;
    margin-bottom: 1rem;
}

.tool-select:focus,
.tool-input:focus {
    outline: none;
    border-color: #FFD700;
}

.tool-btn {
    width: 100%;
    padding: 0.8rem;
    background: #FFD700;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tool-btn:hover {
    background: #E6C200;
    transform: translateY(-2px);
}

.tool-btn-danger {
    width: 100%;
    padding: 0.8rem;
    background: #EF4444;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tool-btn-danger:hover {
    background: #DC2626;
}

.upload-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: #0A0A0A;
    color: white;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.upload-btn:hover {
    background: #1A1A1A;
    transform: translateY(-2px);
}

.tool-note {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Template Grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.template-item {
    background: #F5F5F5;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.template-item:hover {
    background: #FFD700;
    transform: translateY(-3px);
}

.template-preview {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.template-item span {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Text Controls */
.tool-slider {
    width: 100%;
    margin: 0.5rem 0;
}

#font-size-value {
    font-weight: 700;
    color: #FFD700;
}

/* Color Picker Grid */
.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
}

.color-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.color-option:hover {
    transform: scale(1.1);
    border-color: #FFD700;
}

.color-option.active {
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════
   CENTER CANVAS AREA
   ════════════════════════════════════════════════════════════════════ */

.designer-canvas-area {
    display: flex;
    flex-direction: column;
    background: #E5E5E5;
}

.canvas-header {
    background: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #E5E5E5;
}

.canvas-header h2 {
    font-size: 1.5rem;
    font-weight: 900;
}

.canvas-actions {
    display: flex;
    gap: 0.5rem;
}

.canvas-actions .tool-btn {
    width: auto;
    padding: 0.6rem 1.2rem;
}

.canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: auto;
}

.product-mockup {
    position: relative;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.mockup-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

.design-layer {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 60%;
    border: 2px dashed transparent;
    transition: border-color 0.3s;
}

.design-layer:hover {
    border-color: #FFD700;
}

/* Design Elements */
.design-element {
    position: absolute;
    cursor: move;
    user-select: none;
}

.design-element.selected {
    outline: 2px solid #FFD700;
    outline-offset: 4px;
}

.design-element img {
    max-width: 100%;
    height: auto;
    pointer-events: none;
}

.design-element.text-element {
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    padding: 5px;
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #FFD700;
    border: 2px solid white;
    border-radius: 50%;
    cursor: nwse-resize;
}

.resize-handle.top-left { top: -6px; left: -6px; }
.resize-handle.top-right { top: -6px; right: -6px; cursor: nesw-resize; }
.resize-handle.bottom-left { bottom: -6px; left: -6px; cursor: nesw-resize; }
.resize-handle.bottom-right { bottom: -6px; right: -6px; }

.canvas-footer {
    background: white;
    padding: 1.5rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    border-top: 1px solid #E5E5E5;
}

.canvas-footer button {
    padding: 1rem 2rem;
    font-size: 1.05rem;
}

/* ═══════════════════════════════════════════════════════════════════
   RIGHT SIDEBAR - LAYERS & PROPERTIES
   ════════════════════════════════════════════════════════════════════ */

.designer-properties {
    background: white;
    padding: 2rem;
    overflow-y: auto;
    border-left: 1px solid #E5E5E5;
}

.designer-properties h3 {
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
}

.layers-panel {
    margin-bottom: 2rem;
}

.empty-layers {
    text-align: center;
    padding: 2rem 1rem;
    background: #F5F5F5;
    border-radius: 10px;
}

.empty-layers p {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.empty-layers small {
    color: #666;
    font-size: 0.85rem;
}

.layer-item {
    background: #F5F5F5;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.layer-item.active {
    background: #FFD700;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.layer-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.layer-icon {
    font-size: 1.5rem;
}

.layer-name {
    font-weight: 600;
}

.layer-actions {
    display: flex;
    gap: 0.5rem;
}

.layer-action-btn {
    background: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.layer-action-btn:hover {
    background: #0A0A0A;
    color: white;
}

.properties-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #F5F5F5;
}

.properties-section h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.design-info {
    background: #F5F5F5;
    padding: 1rem;
    border-radius: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #E5E5E5;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row span {
    color: #666;
}

.info-row strong {
    color: #0A0A0A;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .designer-container {
        grid-template-columns: 280px 1fr 280px;
    }
}

@media (max-width: 992px) {
    .designer-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        height: auto;
    }

    .designer-sidebar,
    .designer-properties {
        border: none;
        border-bottom: 1px solid #E5E5E5;
    }

    .template-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 768px) {
    .canvas-header {
        flex-direction: column;
        gap: 1rem;
    }

    .canvas-footer {
        flex-direction: column;
    }

    .template-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
