/* Window Designer Frontend Styles - Matching Spray Vue Theme */

.window-designer-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: #64009e;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
}

.wd-header {
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 25px 30px;
    text-align: center;
    max-height: 75px;
}

.wd-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    text-shadow: none;
    color: #ffffff !important;
}

.wd-title h3 {
    color: #ffffff !important;
}

.wd-content {
    position: relative;
    min-height: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.wd-step {
    display: none;
    padding: 40px;
    color: #1F2937;
}

.wd-step.active {
    display: block;
}

.wd-step-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.wd-step-number {
    background: #64009e;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 15px;
    font-size: 16px;
    box-shadow: 0 4px 6px rgba(139, 92, 246, 0.3);
}

.wd-step-header h4 {
    margin: 0;
    font-size: 20px;
    color: #374151;
    font-weight: 600;
}

/* Upload Area Styles */
.wd-upload-area {
    border: 2px dashed #C084FC;
    border-radius: 16px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    position: relative;
    overflow: hidden;
}

.wd-upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wd-upload-area:hover::before,
.wd-upload-area.wd-drag-over::before {
    opacity: 1;
}

.wd-upload-area:hover,
.wd-upload-area.wd-drag-over {
    border-color: #8B5CF6;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.2);
}

.wd-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.wd-upload-icon {
    color: #8B5CF6;
    margin-bottom: 20px;
    font-size: 48px;
}

.wd-upload-text {
    font-size: 18px;
    color: #374151;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.wd-upload-hint {
    font-size: 16px;
    color: #6B7280;
    margin: 0;
}

.wd-preview-container {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wd-preview-image {
    max-width: 100%;
    max-height: 300px;
    display: block;
}

.wd-remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.wd-remove-image:hover {
    background: rgba(0, 0, 0, 0.9);
}

.wd-remove-image svg {
    color: white;
}

/* Colors Grid Styles */
.wd-colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.wd-color-option {
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.wd-color-option:hover {
    border-color: #8B5CF6;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.25);
    background: rgba(255, 255, 255, 1);
}

.wd-color-option.selected {
    border-color: #8B5CF6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
    transform: translateY(-4px);
}

.wd-color-swatch {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    margin: 0 auto 12px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.wd-color-name {
    font-size: 14px;
    color: #374151;
    font-weight: 600;
}

.wd-selected-color {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.wd-selected-swatch {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wd-selected-name {
    font-weight: 600;
    color: #374151;
    font-size: 16px;
}

/* Processing Styles */
.wd-processing-content {
    text-align: center;
    padding: 40px 20px;
}

.wd-spinner {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
}

.wd-spinner-svg {
    animation: wd-spin 2s linear infinite;
}

.wd-spinner-path {
    stroke: #8B5CF6;
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    animation: wd-dash 1.5s ease-in-out infinite;
}

@keyframes wd-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes wd-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.wd-processing-text {
    font-size: 18px;
    color: #374151;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.wd-processing-hint {
    font-size: 14px;
    color: #9ca3af;
    margin: 0;
}

/* Result Styles */
.wd-target-options { margin-top: 16px; color: #000; }
.wd-target-options h5 { margin: 8px 0; font-weight: 700; }
.wd-target-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.wd-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.wd-comparison-item {
    text-align: center;
}

.wd-comparison-item h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.wd-result-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wd-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Error Styles */
.wd-target-item { background: rgba(255,255,255,0.9); border: 1px solid rgba(0,0,0,0.1); border-radius: 8px; padding: 8px 12px; color: #000; }
.wd-target-hint { font-size: 12px; opacity: 0.9; margin-top: 8px; color: #000; }
.wd-zoom { position: relative; overflow: hidden; border-radius: 12px; }
.wd-error-content {
    text-align: center;
    padding: 20px;
}

.wd-error-message {
    font-size: 16px;
    color: #dc2626;
    margin-bottom: 20px;
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

.wd-zoom img { transition: transform 0.35s ease; transform-origin: center center; display: block; width: 100%; height: auto; }
.wd-zoom:hover img { transform: scale(1.1); }
.wd-error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Button Styles */
.wd-step-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 40px;
}

.wd-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.wd-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wd-btn:hover::before {
    opacity: 1;
}

.wd-btn-primary {
    background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.wd-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.wd-btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #6B46C1;
    border: 2px solid rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(10px);
}

.wd-btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
    border-color: #8B5CF6;
}

.wd-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.wd-btn:disabled::before {
    display: none;
}

/* Progress Bar */
.wd-progress-bar {
    height: 6px;
    background: rgba(139, 92, 246, 0.2);
    position: relative;
    overflow: hidden;
    border-radius: 3px;
}

.wd-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B5CF6, #A855F7, #C084FC);
    transition: width 0.5s ease;
    position: relative;
    border-radius: 3px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .window-designer-container {
        margin: 0 10px;
    }
    
    .wd-header {
        padding: 16px 20px;
    }
    
    .wd-title {
        font-size: 20px;
    }
    
    .wd-step {
        padding: 20px;
    }
    
    .wd-colors-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .wd-color-swatch {
        width: 50px;
        height: 50px;
    }
    
    .wd-comparison {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .wd-step-actions,
    .wd-result-actions,
    .wd-error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .wd-btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .wd-upload-area {
        padding: 30px 15px;
    }
    
    .wd-upload-text {
        font-size: 14px;
    }
    
    .wd-colors-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .wd-color-swatch {
        width: 40px;
        height: 40px;
    }
    
    .wd-color-name {
        font-size: 11px;
    }
}

/* Accessibility */
.wd-color-option:focus,
.wd-btn:focus,
.wd-upload-area:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .window-designer-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .wd-step-actions,
    .wd-result-actions,
    .wd-error-actions {
        display: none;
    }
}