.simple-product-designer {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.designer-toolbar {
    background: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.designer-toolbar button {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.designer-toolbar button:hover {
    background: #005a87;
}

.designer-toolbar button:active {
    transform: translateY(1px);
}

.designer-container {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: center;
}

#product-canvas {
    border: 2px solid #ddd;
    border-radius: 4px;
    max-width: 100%;
    height: auto;
    cursor: crosshair;
}

.designer-properties {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.designer-properties h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

.designer-properties label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #555;
}

.designer-properties input,
.designer-properties select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 5px;
    font-size: 14px;
}

.designer-properties input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.designer-properties input[type="number"] {
    width: 80px;
}

/* Responsive design */
@media (max-width: 768px) {
    .simple-product-designer {
        padding: 10px;
    }
    
    .designer-toolbar {
        flex-direction: column;
    }
    
    .designer-toolbar button {
        width: 100%;
    }
    
    #product-canvas {
        width: 100%;
        height: auto;
    }
}

/* Canvas selection styles */
.canvas-container {
    position: relative;
}

/* Fabric.js selection styles */
.canvas-container .upper-canvas {
    cursor: crosshair;
}

.canvas-container .lower-canvas {
    cursor: crosshair;
}

/* Loading state */
.designer-container.loading {
    position: relative;
}

.designer-container.loading::after {
    content: "Loading...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1000;
}

/* Success/Error messages */
.message {
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
    font-weight: bold;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Keyboard shortcuts hint */
.keyboard-hints {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

.keyboard-hints strong {
    color: #333;
}

/* Animation for new elements */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.canvas-container canvas {
    animation: fadeIn 0.3s ease-in-out;
}

/* Customize Button Styles */
.spd-customize-btn {
    margin-left: 10px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    /* Colors will be set dynamically via PHP */
}

.spd-customize-btn .dashicons {
    margin-right: 5px;
    vertical-align: middle;
}

/* Customize Modal Styles */
.spd-customize-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spd-customize-content {
    background: white;
    border-radius: 0;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

.spd-customize-header {
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    border-radius: 0;
}

.spd-customize-header h2 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.spd-customize-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.spd-customize-close:hover {
    background: #f0f0f0;
    color: #333;
}

.spd-customize-body {
    flex: 1;
    padding: 10px;
    overflow: hidden;
    display: flex;
    gap: 10px;
    align-items: stretch;
    min-height: 0;
}

.spd-customize-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.spd-customize-canvas-container {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #f9f9f9;
    position: relative;
}

.spd-customize-toolbar {
    padding: 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.spd-customize-toolbar button {
    padding: 8px 12px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

.spd-customize-toolbar button:hover {
    background: #005a87;
}

.spd-customize-properties {
    width: 300px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    overflow-y: auto;
    max-height: 100%;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.spd-customize-properties h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 5px;
}

.spd-customize-properties .property-group {
    margin-bottom: 20px;
}

.spd-customize-properties label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 12px;
}

.spd-customize-properties input,
.spd-customize-properties select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 10px;
}

.spd-customize-properties input[type="color"] {
    width: 50px;
    height: 35px;
    padding: 2px;
    margin-bottom: 10px;
}

.spd-customize-properties input[type="number"] {
    width: 80px;
}

/* Override any conflicting styles */
.spd-customize-modal .spd-customize-properties {
    position: static !important;
    float: none !important;
    clear: none !important;
    display: block !important;
    width: 300px !important;
    flex-shrink: 0 !important;
    order: 2 !important;
}

/* Force the layout to work */
.spd-customize-body {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px !important;
    align-items: stretch !important;
    min-height: 0 !important;
}

.spd-customize-main {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    order: 1 !important;
}

.spd-customize-properties {
    width: 300px !important;
    flex-shrink: 0 !important;
    order: 2 !important;
    background: #f9f9f9 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 15px !important;
    overflow-y: auto !important;
    max-height: 100% !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Ensure the main content area doesn't overflow */
.spd-customize-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.spd-customize-footer {
    padding: 10px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f9f9f9;
    border-radius: 0;
}

/* Footer Button Styles - Matching View Buttons */
.spd-customize-footer button {
    padding: 8px 16px !important;
    border: 2px solid #6c757d !important;
    background: #6c757d !important;
    color: white !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 80px !important;
}

.spd-customize-footer button:hover {
    background: #5a6268 !important;
    border-color: #5a6268 !important;
    color: white !important;
}

.spd-customize-footer button:active {
    background: #545b62 !important;
    border-color: #545b62 !important;
}

/* Primary button (Add to Cart) */
.spd-customize-footer button.button-primary {
    background: #007cba !important;
    border-color: #007cba !important;
}

.spd-customize-footer button.button-primary:hover {
    background: #005a87 !important;
    border-color: #005a87 !important;
}

.spd-customize-footer button.button-primary:active {
    background: #004a6f !important;
    border-color: #004a6f !important;
}

/* Simple Toolbar Styles - No Backgrounds */
.simple-toolbar-btn {
    width: 100%;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    font-size: 12px;
    transition: color 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #333;
    padding: 4px 1px;
    border-radius: 0;
    gap: 2px;
    box-shadow: none !important;
    outline: none;
    min-height: 35px;
    flex-shrink: 0;
}

.simple-toolbar-btn:hover {
    background: transparent !important;
    color: #007cba;
    border: none !important;
    box-shadow: none !important;
}

.simple-toolbar-btn:active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.simple-toolbar-btn:focus {
    outline: none;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.toolbar-icon {
    font-size: 28px;
    line-height: 1;
    display: block;
}

.toolbar-text {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    line-height: 1;
    color: inherit;
}

/* Override any conflicting button styles */
.spd-customize-toolbar button,
.spd-customize-toolbar .simple-toolbar-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    margin: 0 !important;
    padding: 8px 4px !important;
}

/* Triangle/Ellipse styles inherit defaults; visibility controlled by JS settings */

/* Ensure text icon is always visible */
#add-text .toolbar-icon {
    font-size: 28px !important;
    line-height: 1 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    color: #333 !important;
}

#add-text {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

#add-text:hover .toolbar-icon {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    color: #007cba !important;
}

/* Ensure save button is always visible */
#save-design {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

#save-design .toolbar-icon {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    color: #333 !important;
    font-size: 28px !important;
}

#save-design:hover .toolbar-icon {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    color: #007cba !important;
}

.spd-customize-toolbar button:hover,
.spd-customize-toolbar .simple-toolbar-btn:hover {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #007cba !important;
}

.spd-customize-toolbar button:active,
.spd-customize-toolbar .simple-toolbar-btn:active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.spd-customize-toolbar button:focus,
.spd-customize-toolbar .simple-toolbar-btn:focus {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .spd-customize-content {
        width: 95%;
        height: 95%;
        max-width: none;
        max-height: none;
    }
    
    .spd-customize-header {
        padding: 15px;
    }
    
    .spd-customize-body {
        padding: 15px;
        flex-direction: column;
    }
    
    .spd-customize-properties {
        width: 100%;
        max-height: 200px;
        order: -1;
    }
    
    .spd-customize-footer {
        padding: 15px;
    }
    
    /* Mobile toolbar adjustments */
    .spd-customize-toolbar {
        width: 60px;
        padding: 10px 5px;
    }
    
    .toolbar-btn {
        min-height: 40px;
        padding: 6px 4px;
    }
    
    .toolbar-icon {
        font-size: 14px;
    }
    
    .toolbar-label {
        font-size: 8px;
    }
}

/* Customized product tag styles */
.spd-customized-tag {
    background: #ff6b6b;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 8px;
    text-transform: uppercase;
    font-weight: bold;
    display: inline-block;
    vertical-align: middle;
}

/* Cart item customized image styles */
.spd-customized-cart-image {
    max-width: 100px;
    height: auto;
    border: 2px solid #ff6b6b;
    border-radius: 4px;
}

/* Notification System */
.spd-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 400px;
    word-wrap: break-word;
    display: none;
}

.spd-notification-success {
    background: #28a745;
    border-left: 4px solid #1e7e34;
}

.spd-notification-error {
    background: #dc3545;
    border-left: 4px solid #c82333;
}

.spd-notification-info {
    background: #17a2b8;
    border-left: 4px solid #138496;
}

.spd-notification-warning {
    background: #ffc107;
    border-left: 4px solid #e0a800;
    color: #212529;
}

/* Load Design Modal */
.spd-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
}

.spd-modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.spd-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.spd-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.spd-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.spd-modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.spd-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.spd-design-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spd-design-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.spd-design-item:hover {
    border-color: #007cba;
    background: #f0f8ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 186, 0.1);
}

.spd-design-info {
    flex: 1;
}

.spd-design-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

.spd-design-date {
    color: #666;
    font-size: 12px;
}

.spd-load-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.spd-load-btn:hover {
    background: #005a87;
}

.spd-modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    background: #f8f9fa;
}

.spd-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.spd-btn-secondary {
    background: #6c757d;
    color: white;
}

.spd-btn-secondary:hover {
    background: #5a6268;
}

/* Responsive Design for Modal */
@media (max-width: 768px) {
    .spd-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .spd-modal-header,
    .spd-modal-body,
    .spd-modal-footer {
        padding: 15px;
    }
    
    .spd-design-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .spd-load-btn {
        align-self: flex-end;
    }
    
    .spd-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
} 