/* Brick by Brick Portrait Plugin Styles */

#bbp-customization-tool {
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 30px;
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bbp-section h3 {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0 0 15px 0;
    text-align: center;
}

.bbp-steps {
    color: #666;
    text-align: center;
    margin: 0 0 30px 0;
    font-size: 16px;
}

/* Upload Section */
.bbp-upload-section {
    margin-bottom: 30px;
}

.bbp-upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.bbp-file-input-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* File input overlay pointer events controlled by JavaScript */

.bbp-reset-btn, .bbp-change-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin: 10px 5px;
    font-size: 14px;
    transition: background 0.3s ease;
    position: relative;
    z-index: 3;
}

.bbp-reset-btn:hover, .bbp-change-btn:hover {
    background: #005a87;
}

.bbp-upload-area:hover {
    border-color: #999;
    background: #f0f0f0;
}

.bbp-upload-area.drag-over {
    border-color: #007cba;
    background: #e8f4f8;
}

.bbp-upload-content {
    max-width: 400px;
    width: 100%;
}

.bbp-upload-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.bbp-upload-content p {
    margin: 10px 0;
    line-height: 1.4;
}

.bbp-upload-content p:first-of-type {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.bbp-upload-hint {
    color: #666;
    font-size: 14px;
}


/* Main Layout */
.bbp-main-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.bbp-left-section {
    flex: 1;
}

.bbp-right-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Controls Section */
.bbp-controls-section {
    width: 100%;
    margin-bottom: 20px;
}

.bbp-controls {
    width: 100%;
}

.bbp-instructions {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
    font-size: 14px;
}

.bbp-control-group {
    margin-bottom: 25px;
}

.bbp-control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.bbp-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.bbp-slider::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
    transition: background 0.3s ease;
}

.bbp-slider::-webkit-slider-thumb:hover {
    background: #005a87;
}

.bbp-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
    border: none;
    transition: background 0.3s ease;
}

.bbp-slider::-moz-range-thumb:hover {
    background: #005a87;
}

.bbp-position-hint {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 20px;
}

/* Preview Section */
.bbp-preview-section {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.bbp-preview-container {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbp-preview-placeholder {
    text-align: center;
    color: #999;
    padding: 20px;
}

.bbp-preview-placeholder p {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #DAA520;
}

#bbp-preview-canvas {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 400px;
    max-height: 400px;
    cursor: grab;
    object-fit: contain;
}

#bbp-preview-canvas:active {
    cursor: grabbing;
}

/* Actions */
.bbp-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.bbp-confirm-btn {
    background: #F4D03F;
    color: #333;
    border: none;
    padding: 15px 40px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    text-transform: none;
}

.bbp-confirm-btn:hover {
    background: #F1C40F;
}

.bbp-add-cart-btn {
    background: #8FA8B0;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    text-transform: none;
}

.bbp-add-cart-btn:hover:not(:disabled) {
    background: #7A9BA5;
}

.bbp-add-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bbp-main-layout {
        flex-direction: column;
    }
    
    .bbp-preview-container {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .bbp-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .bbp-confirm-btn,
    .bbp-add-cart-btn {
        width: 100%;
        max-width: 300px;
    }
}

/* WooCommerce Integration */
.woocommerce-variation-add-to-cart {
    display: none !important;
}

#bbp-customization-tool.confirmed .woocommerce-variation-add-to-cart {
    display: block !important;
}

/* Cart Item Display */
.bbp-cart-preview {
    max-width: 80px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 5px;
}