.design-studio {
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
}

.studio-header {
    text-align: center;
    margin-bottom: 30px;
}

.studio-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 800;
}

.studio-header p {
    font-size: 1.1rem;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
}

.studio-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 30px;
}

.product-display {
    max-height: 90vh;
    flex: 1;
    min-width: 300px;
    position: relative;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.05);
}

.canvas-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    overflow: hidden;
    cursor: default;
}

.canvas-container.zooming {
    animation: zoomPulse 0.3s ease;
}

@keyframes zoomPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.product-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 20px;
}

.product-image {
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: default;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

.zoom-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 20;
    border: 1px solid #e9ecef;
    backdrop-filter: blur(10px);
}

.zoom-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #3498db;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-size: 14px;
}

.zoom-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

#reset-zoom {
    background: #95a5a6;
}

#reset-zoom:hover {
    background: #7f8c8d;
}

.zoom-level {
    font-weight: 600;
    color: #2c3e50;
    min-width: 50px;
    text-align: center;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.customization-panel {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.panel-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #e74c3c;
}

.panel-section:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.bespoke-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bespoke-section-title i {
    font-size: 20px;
    color: #e74c3c;
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.color-option {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.color-option:hover {
    transform: scale(1.15) rotate(5deg);
}

.color-option.active {
    border: 3px solid #2c3e50;
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.logo-suggestions {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 5px;
    margin-bottom: 20px;
}

.suggestion-logo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    object-fit: contain;
    padding: 5px;
    border: 1px solid #eee;
    flex-shrink: 0;
    background: transparent;
}

.suggestion-logo:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #3498db;
    background-color: rgba(52, 152, 219, 0.05);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 40px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.logo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
}

.logo-item {
    width: 65px;
    height: 65px;
    border: 1px solid #eee;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    cursor: move;
    transition: all 0.3s ease;
    background: transparent;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
}

.logo-item:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.logo-item img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.remove-logo {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 15;
}

.logo-item:hover .remove-logo {
    opacity: 1;
}

.text-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.text-input {
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.text-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    background: white;
}

.style-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.style-btn {
    padding: 10px 14px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

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

.style-btn.active {
    background: #2c3e50;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.add-text-btn {
    padding: 14px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.add-text-btn:hover {
    background: #4caf50;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* DESIGN ELEMENTS - SMOOTH DRAG & DROP */
.design-element {
    position: absolute;
    cursor: move;
    user-select: none;
    z-index: 10;
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.2s ease;
    will-change: transform;
}

.design-element.dragging {
    z-index: 1000;
    transform: scale(1.05);
    opacity: 0.9;
    transition: transform 0.1s ease;
    cursor: grabbing !important;
}

.logo-element {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px dashed transparent;
    transition: border 0.3s ease, transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.logo-element:hover {
    border: 1px dashed #ccc;
}

.logo-element img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.text-element {
    padding: 8px 16px;
    background: transparent;
    cursor: move;
    user-select: none;
    min-width: 60px;
    min-height: 30px;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border: 1px dashed transparent;
    transition: border 0.3s ease, transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    will-change: transform;
}

.text-element:hover {
    border: 1px dashed #ccc;
}

.resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #3498db;
    border-radius: 50%;
    bottom: -7px;
    right: -7px;
    cursor: nwse-resize;
    z-index: 11;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    transition: all 0.2s ease;
    opacity: 0;
}

.design-element:hover .resize-handle {
    opacity: 1;
}

.resize-handle:hover {
    background: #2980b9;
    transform: scale(1.2);
}

.remove-element {
    position: absolute;
    top: -12px;
    right: -12px;
    background: #e74c3c;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 12;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    opacity: 0;
}

.design-element:hover .remove-element {
    opacity: 1;
}

.remove-element:hover {
    transform: scale(1.1);
}

/* SELECTED LOGO CONTAINER - TRANSPARENT AND CENTERED */
.selected-logo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 25;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 150px;
    height: 150px;
    background: transparent;
    border-radius: 8px;
    padding: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px dashed transparent;
    cursor: move;
    will-change: transform;
}

.selected-logo-container.dragging {
    z-index: 1000;
    transform: scale(1.05) translate(-50%, -50%);
    opacity: 0.9;
    cursor: grabbing !important;
}

.selected-logo-container:hover {
    border: 1px dashed #ccc;
}

.selected-logo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: transparent;
    pointer-events: none;
}

.selected-logo-remove {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #e74c3c;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 26;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.selected-logo-container:hover .selected-logo-remove {
    opacity: 1;
}

.selected-logo-resize {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: #3498db;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: nwse-resize;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 26;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.selected-logo-container:hover .selected-logo-resize {
    opacity: 1;
}

.color-selection {
    margin-bottom: 15px;
}

.color-selection h4 {
    margin-bottom: 8px;
    font-size: 14px;
    color: #2c3e50;
}

@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    80% {
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.new-element {
    animation: popIn 0.4s ease;
}

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

    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* SMOOTH DRAG INDICATOR */
.drag-ghost {
    opacity: 0.7;
    transform: rotate(5deg);
    transition: none;
}

/* Selection and Control Styles */
.design-element.selected {
    z-index: 100;
    border: 2px solid #3498db !important;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.design-element.selected .remove-element,
.design-element.selected .resize-handle {
    opacity: 1 !important;
}

.selected-logo-container.selected {
    border: 2px solid #3498db !important;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.selected-logo-container.selected .selected-logo-remove,
.selected-logo-container.selected .selected-logo-resize {
    opacity: 1 !important;
}

/* Improved resize handles */
.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #3498db;
    border: 2px solid white;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 20;
}

.resize-handle.top-left {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.resize-handle.top-right {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.resize-handle.bottom-left {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.resize-handle.bottom-right {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

.resize-handle:hover {
    background: #2980b9;
    transform: scale(1.2);
}

/* Remove button improvements */
.remove-element {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 22px;
    height: 22px;
    background: #e74c3c;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 21;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.remove-element:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Smooth transitions for all interactive elements */
.design-element,
.selected-logo-container {
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Prevent text selection during interactions */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

@media (max-width: 900px) {
    .studio-container {
        flex-direction: column;
    }

    .customization-panel {
        flex: 1;
        width: 100%;
    }

    .studio-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .design-studio {
        margin: 20px auto;
        padding: 10px;
    }

    .studio-container {
        padding: 20px;
    }

    .panel-section {
        padding: 15px;
    }

    .style-options {
        gap: 8px;
    }

    .style-btn {
        padding: 8px 10px;
        font-size: 14px;
    }

    .selected-logo-container {
        width: 120px;
        height: 120px;
    }
}
