/* Product Designer Styles - Full Customization Studio */

/* Additional styles for the new designer */
.color-swatch {
    transition: transform 0.2s, box-shadow 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-type-btn.active {
    transition: all 0.3s;
}

.view-toggle-btn.active {
    transition: all 0.3s;
}

.size-btn.selected {
    background-color: #3B82F6;
    color: white;
    border-color: #3B82F6;
}

#design-canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

#preview-canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Scrollbar styling for dark mode */
.dark ::-webkit-scrollbar {
    width: 8px;
}

.dark ::-webkit-scrollbar-track {
    background: #1F2937;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4B5563;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6B7280;
}

/* Layer item hover effects */
#layers-list > div:hover {
    transform: translateX(2px);
    transition: transform 0.2s;
}

/* Grid overlay animation */
#grid-overlay {
    background-image: 
        linear-gradient(to right, rgba(156, 163, 175, 0.3) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(156, 163, 175, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Shirt Designer Styles (Legacy) */

.design-shirt-section {
    margin: 2rem 0;
    text-align: center;
}

.btn-design-shirt {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border: none;
    padding: 1.1rem 2.8rem;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 35px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-design-shirt::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-design-shirt:hover::before {
    left: 100%;
}

.btn-design-shirt:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
}

.btn-design-shirt:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.btn-design-shirt i {
    font-size: 1.4rem;
    transition: transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: white !important;
}

.btn-design-shirt:hover i {
    transform: rotate(15deg) scale(1.15);
}

.btn-design-shirt span {
    display: inline-block;
}

/* Designer Modal */
.designer-modal-content {
    max-width: 1400px;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    margin: 2vh auto;
}

.designer-modal-content::-webkit-scrollbar {
    width: 8px;
}

.designer-modal-content::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 4px;
}

.designer-modal-content::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: 4px;
}

.designer-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gray);
}

.designer-body {
    padding: 1.5rem;
    min-height: auto;
    overflow: visible;
    padding-bottom: 2rem;
}

.designer-main {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    min-height: auto;
    align-items: start;
}

/* Shirt Preview */
.shirt-preview-container {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.shirt-view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.view-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--medium-gray);
    background: var(--white);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark-gray);
}

.view-btn:hover {
    border-color: var(--primary);
    background: var(--light-gray);
}

.view-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.shirt-preview-container h4 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.2rem;
}

.shirt-preview {
    position: relative;
    background: var(--light-gray);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.shirt-mockup-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
}

.shirt-mockup-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 0;
}

.shirt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border-radius: 8px;
    z-index: 2;
}

/* Shirt Color Overlay - Precise masking */
#shirt-color-overlay {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.shirt-canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 0;
}

.logo-on-shirt {
    position: absolute;
    cursor: move;
    pointer-events: all;
    z-index: 10;
    border: 2px dashed transparent;
    transition: border-color 0.3s;
    transform-origin: center center;
}

.logo-on-shirt:hover {
    border-color: var(--primary);
}

.logo-on-shirt.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.logo-on-shirt img {
    max-width: 100%;
    height: auto;
    display: block;
}

.logo-controls {
    position: absolute;
    top: -30px;
    right: 0;
    display: flex;
    gap: 0.5rem;
    background: var(--white);
    padding: 0.25rem;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logo-control-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-control-btn:hover {
    background: var(--secondary);
}

.shirt-controls {
    margin-top: 1rem;
}

.shirt-controls label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 1.1rem;
}

/* Phone Color Picker Styles */
.phone-color-picker {
    width: 100%;
    margin-top: 0.5rem;
}

.phone-frame {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 25px;
    padding: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 
                0 0 0 2px rgba(255, 255, 255, 0.1) inset,
                0 0 40px rgba(0, 0, 0, 0.5);
    position: relative;
    max-width: 350px;
    margin: 0 auto;
}

.phone-screen {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.phone-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem 1rem 1rem;
    text-align: center;
    position: relative;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 25px;
    background: #1a1a1a;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.phone-header h5 {
    margin: 0;
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 1.5rem;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

.color-swatch {
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-swatch::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.color-swatch:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    border-color: var(--primary);
    z-index: 10;
}

.color-swatch:hover::before {
    opacity: 1;
}

.color-swatch.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3), 
                0 6px 20px rgba(0, 0, 0, 0.25);
    transform: scale(1.1);
    z-index: 10;
}

.color-swatch.active::after {
    content: '✓';
    position: absolute;
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.color-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s;
    z-index: 1;
}

.color-swatch:hover .color-name,
.color-swatch.active .color-name {
    transform: translateY(0);
}

.phone-footer {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    padding: 1rem;
    border-top: 2px solid #e9ecef;
}

.selected-color-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.selected-label {
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 0.9rem;
}

.selected-color-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.selected-color-name {
    font-weight: 600;
    color: var(--primary);
    font-size: 1rem;
    text-transform: capitalize;
}

/* Animation for color change */
@keyframes colorPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.color-swatch.active .selected-color-box {
    animation: colorPulse 0.5s ease;
}

/* Designer Sidebar */
.designer-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: calc(95vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

.designer-sidebar::-webkit-scrollbar {
    width: 6px;
}

.designer-sidebar::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 3px;
}

.designer-sidebar::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: 3px;
}

.designer-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gray);
}

.logo-repository,
.selected-logos,
.design-options {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.logo-repository h4,
.selected-logos h4,
.design-options h4 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.1rem;
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 0.5rem;
}

.logo-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.logo-item {
    aspect-ratio: 1;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.logo-item:hover {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

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

.selected-logos-list {
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
}

.no-logos-message {
    text-align: center;
    color: var(--dark-gray);
    padding: 2rem 1rem;
    font-style: italic;
}

.selected-logo-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--light-gray);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 2px solid var(--medium-gray);
}

.selected-logo-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: var(--white);
    padding: 0.25rem;
    border-radius: 4px;
}

.selected-logo-item .logo-info {
    flex: 1;
}

.selected-logo-item .logo-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--dark-gray);
}

.selected-logo-item .logo-actions {
    display: flex;
    gap: 0.5rem;
}

.logo-action-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.logo-action-btn:hover {
    background: var(--secondary);
}

.logo-action-btn.remove {
    background: #e74c3c;
}

.logo-action-btn.remove:hover {
    background: #c0392b;
}

.design-options .size-selection {
    margin-bottom: 1.5rem;
}

.design-options .size-selection label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--dark-gray);
}

.design-options .size-options {
    display: flex;
    gap: 0.75rem;
}

.design-options .size-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--medium-gray);
    background: var(--white);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.design-options .size-btn:hover {
    border-color: var(--primary);
    background: var(--light-gray);
}

.design-options .size-btn.selected {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.design-options .quantity-selector {
    margin-bottom: 1.5rem;
}

.design-options .quantity-selector label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--dark-gray);
}

.design-options .quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.design-options .quantity-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--medium-gray);
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
}

.design-options .quantity-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--medium-gray);
    background: var(--white);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.design-options .quantity-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.design-price {
    padding-top: 1rem;
    border-top: 2px solid var(--light-gray);
}

.design-price p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.design-price strong {
    color: var(--primary);
    font-size: 1.2rem;
}

.custom-design-note {
    font-size: 0.85rem;
    color: var(--dark-gray);
    font-style: italic;
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--light-gray);
}

.designer-modal-content .modal-footer {
    padding: 1.5rem;
    border-top: 2px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0;
    position: sticky;
    bottom: 0;
    background: var(--white);
    z-index: 100;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    margin-bottom: -1.5rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .designer-main {
        grid-template-columns: 1fr;
    }

    .designer-sidebar {
        order: -1;
    }

    .logo-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .designer-modal-content {
        width: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .shirt-preview {
        min-height: 300px;
        padding: 1rem;
    }

    #shirt-canvas {
        width: 100%;
        height: auto;
    }

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

    .btn-design-shirt {
        width: 100%;
        justify-content: center;
    }
    
    .phone-frame {
        max-width: 100%;
        padding: 8px;
    }
    
    .phone-screen {
        border-radius: 15px;
    }
    
    .color-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .phone-header {
        padding: 1.25rem 1rem 0.75rem;
    }
    
    .phone-header h5 {
        font-size: 1rem;
    }
    
    .phone-notch {
        width: 100px;
        height: 20px;
    }
    
    .selected-color-display {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .selected-color-box {
        width: 35px;
        height: 35px;
    }
    
    .selected-color-name {
        font-size: 0.9rem;
    }
}

