/**
 * POD Designer Pro - Frontend Styles
 */

/* Container */
.pod-designer-container {
    margin: 30px 0;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* Toolbar */
.pod-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    gap: 10px;
}

.pod-toolbar-section {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pod-tools-primary {
    flex: 1;
}

/* Buttons */
.pod-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #333;
}

.pod-btn:hover {
    background: #f0f0f0;
    border-color: #bbb;
    transform: translateY(-1px);
}

.pod-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pod-btn-primary {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

.pod-btn-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

.pod-btn-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.pod-btn-danger:hover {
    background: #dc3545;
    color: #fff;
}

.pod-btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

.pod-btn-block {
    width: 100%;
    justify-content: center;
}

/* Workspace */
.pod-designer-workspace {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .pod-designer-workspace {
        grid-template-columns: 1fr;
    }
}

/* Canvas Area */
.pod-canvas-area {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pod-product-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pod-mockup-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.pod-mockup-img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

#pod-design-canvas {
    position: absolute;
    top: 0;
    left: 0;
    border: 2px dashed #007cba;
    background: rgba(0, 124, 186, 0.05);
    cursor: crosshair;
}

.pod-design-area-overlay {
    position: absolute;
    border: 2px dashed #007cba;
    background: rgba(0, 124, 186, 0.05);
    pointer-events: none;
    display: none;
}

.pod-area-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #007cba;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
}

/* View Switcher */
.pod-view-switcher {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.pod-view-btn {
    padding: 8px 20px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.pod-view-btn.active {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

/* Zoom Controls */
.pod-zoom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.pod-zoom-controls button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-weight: bold;
}

.pod-zoom-controls button:hover {
    background: #f0f0f0;
}

#pod-zoom-level {
    font-size: 14px;
    color: #666;
    min-width: 50px;
    text-align: center;
}

/* Sidebar */
.pod-properties-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pod-panel {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pod-panel h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* Form Controls */
.pod-control-group {
    margin-bottom: 15px;
}

.pod-control-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.pod-control-group input[type="text"],
.pod-control-group input[type="number"],
.pod-control-group input[type="color"],
.pod-control-group select,
.pod-control-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.pod-control-group input[type="range"] {
    width: calc(100% - 50px);
    vertical-align: middle;
}

.pod-control-group input[type="color"] {
    height: 40px;
    cursor: pointer;
}

/* Button Groups */
.pod-btn-group {
    display: flex;
    gap: 5px;
}

.pod-btn-group .pod-btn {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
}

/* Transform Controls */
.pod-transform-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.pod-transform-controls .pod-btn {
    padding: 6px;
    font-size: 12px;
}

/* Color Picker */
.pod-color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pod-color-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pod-color-btn:hover {
    transform: scale(1.1);
}

.pod-color-btn.active {
    border-color: #007cba;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #007cba;
}

/* Layers Panel */
.pod-layers-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

.pod-layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
}

.pod-layer-item:hover {
    background: #f0f0f0;
}

.pod-layer-item.active {
    background: #e3f2fd;
    color: #007cba;
}

.pod-layer-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Action Bar */
.pod-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.pod-action-left,
.pod-action-center,
.pod-action-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pod-action-center {
    flex: 1;
    justify-content: center;
}

/* Preview Result */
#pod-preview-result {
    position: relative;
}

#pod-preview-result img {
    max-width: 150px;
    max-height: 150px;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 5px;
    background: #fff;
}

#pod-preview-result::before {
    content: '✓';
    position: absolute;
    top: -10px;
    right: -10px;
    background: #28a745;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

/* Status */
.pod-status {
    font-size: 13px;
    color: #666;
}

.pod-status.success {
    color: #28a745;
}

.pod-status.error {
    color: #dc3545;
}

/* Loading Overlay */
#pod-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 15px;
}

.pod-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Designer Notice */
.pod-designer-notice {
    background: #e3f2fd;
    border-left: 4px solid #007cba;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.pod-designer-notice strong {
    color: #007cba;
    display: block;
    margin-bottom: 5px;
}

/* Canvas Selection Styles */
.canvas-container .canvas-container {
    box-shadow: 0 0 0 2px #007cba;
}

/* Responsive */
@media (max-width: 768px) {
    .pod-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .pod-toolbar-section {
        justify-content: center;
    }

    .pod-action-bar {
        flex-direction: column;
    }

    .pod-action-left,
    .pod-action-center,
    .pod-action-right {
        width: 100%;
        justify-content: center;
    }
}

/* Disabled Add to Cart Button */
#pod-add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* No Mockup State */
.pod-no-mockup {
    padding: 60px 20px;
    text-align: center;
    background: #f0f0f0;
    border-radius: 8px;
    color: #666;
    font-style: italic;
}

/* Custom Badge */
.pod-badge {
    display: inline-block;
    background: #007cba;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: normal;
}
