/* Cap Designer Styles */

.capza-designer-wrapper {
    margin: 20px 0;
}

.capza-design-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.capza-design-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.capza-design-button svg {
    stroke: #fff;
}

.cap-design-preview {
    margin-top: 15px;
}

/* Modal Styles */
.capza-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    overflow-y: auto;
}

.capza-modal-content {
    background: #fff;
    margin: 30px auto;
    max-width: 1400px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.capza-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.capza-modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.capza-close-modal {
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.capza-close-modal:hover {
    transform: rotate(90deg);
}

.capza-modal-body {
    padding: 0;
}

/* Designer Container */
.capza-designer-container {
    display: flex;
    min-height: 600px;
}

/* Tools Panel */
.capza-tools-panel {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
    overflow-y: auto;
    max-height: 600px;
}

.capza-tool-section {
    margin-bottom: 30px;
}

.capza-tool-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
}

.capza-tool-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.capza-tool-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.capza-tool-btn svg {
    stroke: #667eea;
}

.capza-delete-btn {
    background: #fff0f0;
    border-color: #ff4444;
    color: #ff4444;
}

.capza-delete-btn:hover {
    background: #ffe0e0;
}

.capza-delete-btn svg {
    stroke: #ff4444;
}

/* Text Controls */
#text-controls label {
    display: block;
    margin-bottom: 15px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

#text-controls input[type="text"],
#text-controls select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 5px;
}

#text-controls input[type="range"] {
    width: calc(100% - 50px);
    margin-top: 5px;
}

#text-controls input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 5px;
}

#font-size-value {
    display: inline-block;
    width: 40px;
    text-align: center;
    font-weight: 600;
    color: #667eea;
}

.text-style-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.text-style-buttons button {
    flex: 1;
    padding: 8px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.text-style-buttons button:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

/* Color Swatches */
.color-swatches {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.color-swatch {
    width: 50px;
    height: 50px;
    border: 3px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

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

.color-swatch.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Layers Panel */
.layers-list {
    max-height: 200px;
    overflow-y: auto;
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin-bottom: 5px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.layer-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.layer-item.active {
    border-color: #667eea;
    background: #667eea;
    color: #fff;
}

.layer-name {
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-delete {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 4px;
}

.layer-delete:hover {
    background: rgba(255, 68, 68, 0.1);
}

.layer-item.active .layer-delete svg {
    stroke: #fff;
}

.layer-delete svg {
    stroke: #ff4444;
}

.no-layers {
    text-align: center;
    padding: 20px;
    margin: 0;
}

/* Canvas Panel */
.capza-canvas-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: #ffffff;
}

.capza-canvas-wrapper {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

#capza-canvas {
    border: 1px solid #e0e0e0;
}

/* Preview Panel */
.capza-preview-panel {
    width: 300px;
    background: #f8f9fa;
    border-left: 1px solid #e0e0e0;
    padding: 20px;
    overflow-y: auto;
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

.capza-preview-panel h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #333;
}

.capza-preview-images {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.preview-current-view {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.preview-overlay {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-overlay img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* View Tabs */
.capza-view-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.capza-view-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 500;
}

.capza-view-tab img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.capza-view-tab:hover:not(.disabled) {
    border-color: #667eea;
    background: #f0f4ff;
}

.capza-view-tab.active {
    border-color: #667eea;
    background: #667eea;
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.capza-view-tab.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.preview-note {
    font-size: 12px;
    color: #777;
    margin-top: 15px;
    line-height: 1.5;
}

/* Modal Footer */
.capza-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.capza-cancel-btn {
    padding: 12px 24px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.capza-cancel-btn:hover {
    border-color: #999;
    background: #f5f5f5;
}

.capza-save-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff !important;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.capza-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .capza-designer-container {
        flex-direction: column;
    }
    
    .capza-tools-panel,
    .capza-preview-panel {
        width: 100%;
        max-height: none;
    }
    
    .capza-canvas-panel {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .capza-modal-content {
        margin: 10px;
    }
    
    .capza-canvas-wrapper {
        max-width: 100%;
        overflow-x: auto;
    }
    
    #capza-canvas {
        max-width: 100%;
    }
}

/* Order Display Styles */
.capza-order-design {
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.capza-order-design img {
    max-width: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 10px;
}

.design-details p {
    margin: 5px 0;
    font-size: 13px;
    color: #555;
}
