/**
 * Wall Designer Styles
 */

/* Container */
.wall-designer-container {
    min-height: 100vh;
    background: #f5f5f5;
}

/* Header */
.designer-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.designer-header h1 {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    color: #333;
}

.designer-header p {
    margin: 0;
    color: #666;
    font-size: 1rem;
}

/* Main Layout */
.designer-main {
    padding-bottom: 2rem;
}

.designer-layout {
    display: grid;
    grid-template-columns: 300px 1fr 320px;
    gap: 1.5rem;
    min-height: calc(100vh - 250px);
}

/* Product Selector */
.product-selector {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
    position: sticky;
    top: 20px;
}

.selector-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.selector-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.selector-search,
.selector-filter {
    padding: 0 1.5rem;
    margin-bottom: 1rem;
}

.selector-search input,
.selector-filter select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.product-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem 1.5rem;
}

/* Product Card */
.product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: grab;
    transition: all 0.2s;
}

.product-card:hover {
    border-color: #000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-card:active {
    cursor: grabbing;
}

.product-card-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.product-card-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
}

.product-card-price.has-discount {
    color: #e74c3c;
}

.product-card-price .original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

/* Canvas Workspace */
.canvas-workspace {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.workspace-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.control-group select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f5f5f5;
    border-color: #000;
}

.ml-auto {
    margin-left: auto;
}

.total-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.total-price span {
    color: #666;
}

.total-price strong {
    color: #000;
    font-size: 1.25rem;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    position: relative;
    /* Geçici duvar dokusu - Gerçek duvar resmi için DUVAR-RESMI-EKLEME.md dosyasına bakın */
    background: 
        linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(135deg, #f8f8f8 25%, transparent 25%),
        linear-gradient(225deg, #f8f8f8 25%, transparent 25%),
        linear-gradient(45deg, #f8f8f8 25%, transparent 25%),
        linear-gradient(315deg, #f8f8f8 25%, #fafafa 25%);
    background-size: 
        50px 50px,
        50px 50px,
        40px 40px,
        40px 40px,
        40px 40px,
        40px 40px;
    background-position: 
        0 0,
        0 0,
        20px 0,
        20px 0,
        0 0,
        0 0;
    border: 2px dashed #ddd;
    border-radius: 8px;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.05);
}

#wallCanvas {
    max-width: 100%;
    max-height: 100%;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s;
}

.canvas-overlay.hidden {
    opacity: 0;
}

.overlay-content {
    text-align: center;
    color: #999;
}

.overlay-content svg {
    margin-bottom: 1rem;
}

.overlay-content p {
    margin: 0;
    font-size: 1rem;
}

/* Workspace Actions */
.workspace-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.workspace-actions .btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-primary {
    background: #000;
    color: #fff;
}

.btn-primary:hover {
    background: #333;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Properties Panel */
.properties-panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: calc(100vh - 200px);
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.panel-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 2rem 0;
}

.empty-state svg {
    margin-bottom: 1rem;
}

.empty-state p {
    margin: 0;
}

/* Product Properties */
.product-properties {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.property-image {
    width: 100%;
    border-radius: 6px;
}

.property-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.property-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.property-value {
    font-size: 1rem;
    color: #333;
}

.size-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.size-option {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
}

.size-option:hover:not(:disabled) {
    border-color: #000;
    background: #f9f9f9;
}

.size-option.active,
.size-option.recommended {
    border-color: #4CAF50;
    background: #f1f8f4;
}

.size-option:disabled,
.size-option.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9f9f9;
}

.size-option .variant-name {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

.size-option .variant-price {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.size-option .variant-badge {
    font-size: 0.7rem;
    color: #4CAF50;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.size-option .stock-badge {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
}

.property-actions {
    display: flex;
    gap: 0.5rem;
}

.property-actions .btn {
    flex: 1;
    padding: 0.75rem;
    font-size: 0.9rem;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-dialog {
    background: #fff;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .designer-layout {
        grid-template-columns: 280px 1fr 280px;
        gap: 1rem;
    }
}

@media (max-width: 992px) {
    .designer-layout {
        grid-template-columns: 1fr;
    }
    
    .product-selector,
    .properties-panel {
        position: static;
        max-height: none;
    }
    
    .product-selector {
        order: 2;
    }
    
    .canvas-workspace {
        order: 1;
    }
    
    .properties-panel {
        order: 3;
    }
}

@media (max-width: 768px) {
    .designer-header h1 {
        font-size: 1.5rem;
    }
    
    .workspace-controls {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .control-group {
        flex: 1 1 calc(50% - 0.375rem);
        min-width: 140px;
    }
    
    .control-group label {
        display: block;
        margin-bottom: 0.25rem;
    }
    
    .control-group select {
        width: 100%;
    }
    
    .ml-auto {
        flex: 1 1 100%;
        margin-left: 0;
    }
    
    .total-price {
        justify-content: center;
        padding: 0.5rem;
        background: #f5f5f5;
        border-radius: 6px;
    }
    
    .canvas-container {
        min-height: 400px;
    }
    
    .workspace-actions {
        flex-direction: column;
    }
}
